Skip to content

Commit

Permalink
Add "Build docker image" step
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Action committed Jun 24, 2024
1 parent f4c952a commit 4813e4f
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .buildkite/docker-build-push.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ in
writeScript "docker-build-push" (''
#!${runtimeShell}
set -euo pipefail
set -euox pipefail
export PATH=${lib.makeBinPath [ docker gnused ]}
Expand All @@ -78,7 +78,7 @@ in
tags+=( "${image.imageTag}" )
tags+=( "latest" )
elif [[ "$git_tag" = "rc-latest" ]]; then
tags+=( "$git_tag" )
tags+=( "$git_tag")
else
echo 'Not pushing docker image because this is neither a rc-latest nor a v20* tag build.'
fi
Expand Down
11 changes: 10 additions & 1 deletion .buildkite/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ steps:
- ./scripts/buildkite/release/linux-package.sh
artifact_paths: [ "./result/linux/**" ]
agents:
system: ${linux}
system: x86_64-linux

- label: 'Refresh node state'
key: refresh-node-state
Expand All @@ -31,6 +31,15 @@ steps:
agents:
system: x86_64-linux

- label: 'Build Docker Image'
key: build-docker
depends_on:
- add-release-commits
commands:
./scripts/buildkite/release/docker-build.sh
agents:
system: x86_64-linux

- label: 'Run linux e2e tests'
depends_on:
- add-release-commits
Expand Down
2 changes: 1 addition & 1 deletion nix/docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
, glibcLocales ? null

# Used to generate the docker image names
, repoName ? "inputoutput/cardano-wallet"
, repoName ? "cardanofoundation/cardano-wallet"
}:


Expand Down
28 changes: 28 additions & 0 deletions scripts/buildkite/release/docker-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#! /usr/bin/env -S nix shell --command bash
# shellcheck shell=bash

set -euox pipefail

git fetch --all

RELEASE_COMMIT=$(buildkite-agent meta-data get "release-commit")

git checkout "$RELEASE_COMMIT"

mkdir -p config

echo '{ outputs = _: { dockerHubRepoName = "cardanofoundation/cardano-wallet"; }; }' \
> config/flake.nix

hostNixpkgs=$(nix eval --impure -I "$NIX_PATH" --expr '(import <nixpkgs> {}).path')

nix build .#dockerImage

nix build .#pushDockerImage \
--override-input hostNixpkgs "$hostNixpkgs" \
--override-input customConfig path:./config \
-o docker-build-push

cat docker-build-push

./docker-build-push
6 changes: 4 additions & 2 deletions scripts/buildkite/release/linux-package.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#! /usr/bin/env -S nix shell --command bash
# shellcheck shell=bash

RELEASE_CANDIDATE_BRANCH=$(buildkite-agent meta-data get "release-candidate-branch")
set -euox pipefail

git checkout "$RELEASE_CANDIDATE_BRANCH"
RELEASE_COMMIT=$(buildkite-agent meta-data get "release-commit")

git checkout "$RELEASE_COMMIT"

nix build -o result/linux .#ci.artifacts.linux64.release

0 comments on commit 4813e4f

Please sign in to comment.