Skip to content

Commit

Permalink
Include PIP options in devcontainer build
Browse files Browse the repository at this point in the history
  • Loading branch information
ipspace committed Jul 31, 2024
1 parent ff1ad6e commit dac0a1f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN sudo mkdir -p -m 755 /etc/apt/keyrings \
# install containerlab and tools
RUN apt update && \
apt install -y python3-pip && \
python3 -m pip install --break-system-packages networklab && \
python3 -m pip install --break-system-packages $PIP_OPTIONS networklab && \
apt install -y --no-install-recommends containerlab \
btop \
gh \
Expand Down
11 changes: 11 additions & 0 deletions .github/get-container-tags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
#
TAG=${1#release_}
XTAG=latest
if [[ $TAG == *"dev"* ]]; then
XTAG=dev
echo "PIP_OPTIONS=--pre"
else
echo "PIP_OPTIONS="
fi
echo "IMAGE_TAG=$TAG,$XTAG"
2 changes: 2 additions & 0 deletions .github/workflows/devcontainer-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ jobs:
imageName: ghcr.io/${{ github.repository }}/devcontainer
imageTag: ${{ inputs.docker-tags }}
push: always
env: |
PIP_OPTIONS=${{ inputs.pip-options }}
1 change: 1 addition & 0 deletions .github/workflows/devcontainer-devc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ jobs:
uses: ./.github/workflows/devcontainer-build.yml
with:
docker-tags: devc
pip-options: --pre
secrets:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
5 changes: 3 additions & 2 deletions .github/workflows/devcontainer-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ jobs:
steps:
- name: Find release tag
id: release_tag
run: echo "IMAGE_TAG=${GITHUB_REF_NAME#release_}" >> $GITHUB_OUTPUT
run: .github/get-contaienr-tags.sh $GITHUB_REF_NAME >> $GITHUB_OUTPUT

build:
needs: [ setup ]
uses: ./.github/workflows/devcontainer-build.yml
with:
docker-tags: ${{ needs.setup.outputs.IMAGE_TAG }},latest
docker-tags: ${{ needs.setup.outputs.IMAGE_TAG }}
pip-options: ${{ needs.setup.outputs.PIP_OPTIONS }}
secrets:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}

0 comments on commit dac0a1f

Please sign in to comment.