-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: testground image not pushed to registry (#1479)
* Problem: testground image not pushed to registry Solution: - build the current version of the image in root flake - push to github container registry * fix entrypoint * check image validity * cleanup * test image
- Loading branch information
Showing
10 changed files
with
169 additions
and
171 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Push Testground Image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "v*.*.*" | ||
|
||
env: | ||
IMAGE_NAME: cronos-testground | ||
|
||
jobs: | ||
|
||
push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v23 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-24.05 | ||
extra_nix_config: | | ||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | ||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: cronos | ||
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" | ||
- name: build and push image | ||
run: | | ||
# login to ghcr.io | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
[ "$VERSION" == "main" ] && VERSION=latest | ||
echo "VERSION: $VERSION" | ||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME | ||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
echo "IMAGE_ID: $IMAGE_ID" | ||
BUILD_TAG="$(nix eval --raw .#testground-image.imageTag)" | ||
echo "BUILD_TAG: $BUILD_TAG" | ||
docker load -i "$(nix build --no-link --print-out-paths .#testground-image)" | ||
docker run --rm -e TEST_CASE=info $IMAGE_NAME:$BUILD_TAG | ||
docker tag $IMAGE_NAME:$BUILD_TAG $IMAGE_ID:$VERSION | ||
docker push $IMAGE_ID:$VERSION |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,15 @@ | ||
{ dockerTools, cronos-matrix, testground-testcase }: | ||
dockerTools.buildLayeredImage { | ||
name = "cronos-testground"; | ||
contents = [ | ||
testground-testcase | ||
cronos-matrix.cronosd | ||
]; | ||
config = { | ||
Expose = [ 9090 26657 26656 1317 26658 26660 26659 30000 ]; | ||
Cmd = [ "/bin/testground-testcase" ]; | ||
Env = [ | ||
"PYTHONUNBUFFERED=1" | ||
]; | ||
}; | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.