Skip to content

Commit

Permalink
F2calv/2023 10 ci update (#20)
Browse files Browse the repository at this point in the history
* update devcontainer

* update ci

* fix helm

* fix

* try this

* and again

* helm working

* push on main

* tweaks
  • Loading branch information
f2calv authored Oct 14, 2023
1 parent 731c777 commit c216cde
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 28 deletions.
47 changes: 33 additions & 14 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,51 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/rust
{
"name": "C# (.NET)",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
// Use bullseye when on local on arm64/Apple Silicon.
"VARIANT": "7.0-bullseye",
"NODE_VERSION": "none"
}
},
"postCreateCommand": "sh . ./.devcontainer/postCreateCommand.sh",
"postStartCommand": "sh . ./.devcontainer/postStartCommand.sh",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/powershell:1": {},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"version": "latest",
"helm": "3.9.2",
"minikube": "none"
},
"ghcr.io/eitsupi/devcontainer-features/jq-likes:2": {
"jqVersion": "latest",
"yqVersion": "latest"
}
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp",
"ms-azuretools.vscode-docker",
"ms-vscode.powershell",
"ms-vscode.azurecli"
"ms-vscode.azurecli",
"ms-azuretools.vscode-docker",
"ms-vscode-remote.vscode-remote-extensionpack",
"mutantdino.resourcemonitor"
]
}
},
"remoteUser": "vscode",
"features": {
"docker-from-docker": "latest",
"kubectl-helm-minikube": {
"version": "latest",
"helm": "3.9.2",
"minikube": "none"
},
"powershell": "latest"
}
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
"postCreateCommand": "sh . ./.devcontainer/postCreateCommand.sh",
"postStartCommand": "sh . ./.devcontainer/postStartCommand.sh",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
2 changes: 1 addition & 1 deletion .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: dotnet restore
run: dotnet restore --verbosity minimal --configfile NuGet.config
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/build-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ jobs:
runs-on: ubuntu-latest
permissions:
packages: write #for pushing helm package
contents: write #for creating releases/tags
env:
REGISTRY: ghcr.io
#CHART_REPOSITORY: Note: set dynamically, i.e. github.repository_owner/charts/IMAGE_NAME
GIT_TAG: ${{ inputs.semVer }}
HELM_EXPERIMENTAL_OCI: 1
HELM_VERSION_TO_INSTALL: 3.9.2 #Note: keep this version in sync inside the devcontainer
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 #Note: shallow clone may break git tag & ct lint...
- uses: actions/checkout@v4

- name: set vars (1 of 3)
run: |
Expand All @@ -35,8 +30,11 @@ jobs:

- name: set vars (3 of 3) #pulls helm version from devcontainer
run: |
HELM_VERSION_TO_INSTALL=$(cat .devcontainer/devcontainer.json | jq -r '.features."kubectl-helm-minikube".helm')
npm install --global json5
json5 -c .devcontainer/devcontainer.json
HELM_VERSION_TO_INSTALL=$(cat .devcontainer/devcontainer.json | jq -r '.features[] | select(.helm | . != null).helm')
echo "HELM_VERSION_TO_INSTALL=$HELM_VERSION_TO_INSTALL" >> $GITHUB_ENV
echo $HELM_VERSION_TO_INSTALL
- name: install helm
uses: azure/setup-helm@v3
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
permissions:
packages: write #for pushing container image
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: set vars (1 of 3)
run: |
Expand All @@ -49,6 +49,7 @@ jobs:
run: |
echo "TAG=${{ inputs.tagOverride }}" >> $GITHUB_ENV
echo "OVERRIDE_TAG=${{ inputs.semVer }}" >> $GITHUB_ENV
echo "IMAGE_PUSH=true" >> $GITHUB_ENV
- name: docker login ${{ inputs.registry }}
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ${{ inputs.registry }} -u ${{ github.actor }} --password-stdin
Expand All @@ -57,14 +58,19 @@ jobs:
run: |
docker buildx create --name multiarchtest --use
SOME_OPT=()
OPT_TAG=()
if [ ! -z "$OVERRIDE_TAG" ]; then
SOME_OPT=(-t "${{ inputs.registry }}/${{ github.repository }}:$OVERRIDE_TAG")
OPT_TAG=(-t "${{ inputs.registry }}/${{ github.repository }}:$OVERRIDE_TAG")
fi
OPT_PUSH=()
if [ ! -z "$IMAGE_PUSH" ]; then
OPT_PUSH=(--push)
fi
docker buildx build \
-t ${{ inputs.registry }}/${{ github.repository }}:$TAG \
"${SOME_OPT[@]}" \
"${OPT_TAG[@]}" \
--label "GITHUB_RUN_ID=${{ github.run_id }}" \
--label "IMAGE_NAME=$IMAGE_NAME" \
--label "org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}" \
Expand All @@ -77,5 +83,5 @@ jobs:
--build-arg GITHUB_RUN_NUMBER=${{ github.run_number }} \
--platform ${{ inputs.platform }} \
--pull \
--push \
"${OPT_PUSH[@]}" \
.
2 changes: 1 addition & 1 deletion .github/workflows/versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
semVer: ${{ steps.gitversion.outputs.semVer }}
fullSemVer: ${{ steps.gitversion.outputs.fullSemVer }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down

0 comments on commit c216cde

Please sign in to comment.