-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
devcontainer: Fix kubectl path (#1441)
* Adds `jq`. * Adds a _devcontainer_ CI workflow Signed-off-by: Oliver Gould <ver@buoyant.io> (cherry picked from commit 8f38eb3) Signed-off-by: Oliver Gould <ver@buoyant.io>
- Loading branch information
Showing
3 changed files
with
62 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: devcontainer | ||
|
||
# When a pull request is opened that changes the Devcontainer configuration, | ||
# ensure that the container continues to build properly. | ||
on: | ||
pull_request: | ||
paths: | ||
- rust-toolchain | ||
- .devcontainer/** | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 | ||
- run: docker build .devcontainer | ||
|
||
rust-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 | ||
- run: | | ||
versions=$(sed -nE 's|^FROM (.*/)?rust:([^ -]+)|\2|p' .devcontainer/Dockerfile) | ||
ex=0 | ||
for mismatch in $(echo "$versions" | grep -vF "$(cat rust-toolchain)" || true) ; do | ||
echo "::error file=.devcontainer/Dockerfile::Devcontainer uses incorrect rust version(s): $mismatch" | ||
ex=$((ex + 1)) | ||
done | ||
exit $ex | ||
devcontainer-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 | ||
- run: | | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update | ||
sudo apt-get -y --no-install-recommends install jq | ||
- run: | | ||
image=$(sed -E '/^\s*\/\/.*/d' .devcontainer/devcontainer.json |jq -Mr .image) | ||
if [ "$image" == "null" ]; then | ||
echo "::error file=.devcontainer/devcontainer.json::Missing image" | ||
exit 1 | ||
fi | ||
if ! docker pull "$image" ; then | ||
echo "::error file=.devcontainer/devcontainer.json::Unable to pull image: $image" | ||
exit 1 | ||
fi |