Skip to content

Commit

Permalink
mandatorize clab version during the build and add runargs
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Nov 28, 2024
1 parent dbde8e5 commit c46dcbf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
16 changes: 10 additions & 6 deletions .devcontainer/dood/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
"CLAB_VERSION": "${localEnv:CLAB_VERSION}"
}
},
"runArgs": [
"--network=host",
"--pid=host",
"--privileged"
],
"mounts": [
"type=bind,src=/run/netns,dst=/run/netns"
],
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"version": "26.1.4",
"dockerDashComposeVersion": "none",
"moby": "false"
},
// Add sshd to support gh cli codespace cp.
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
// Add sshd to support gh cli codespaces cp.
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
},
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-devcontainer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: build-devcontainer
on:
workflow_call:
inputs:
CLAB_VERSION:
description: "Containerlab version"
required: true
type: string
workflow_dispatch:
inputs:
CLAB_VERSION:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-') != true
needs: build-and-release
uses: ./.github/workflows/build-devcontainer.yml

with:
CLAB_VERSION: ${{ github.ref_name && github.ref_name[1:] }} # remove the leading 'v'
# update docs allows to make the docs changes outside of the release cycle
# it skips the code build/release and proceeds with docs publishing
# the intended usage is to provide fixes/updates to docs, which do not require code changes
Expand Down

0 comments on commit c46dcbf

Please sign in to comment.