Skip to content

Commit

Permalink
Get cross platform + goreleaser working for devspace (#12166)
Browse files Browse the repository at this point in the history
* Get cross platform + goreleaser working for devspace

* move docker build script under custom image build cmd

---------

Co-authored-by: Radek Scheibinger <[email protected]>
Co-authored-by: Radek Scheibinger <[email protected]>
  • Loading branch information
3 people authored Mar 4, 2024
1 parent d7c05c4 commit 2f73d04
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
39 changes: 24 additions & 15 deletions charts/chainlink-cluster/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,15 @@ pipelines:
run_dependencies --all
ensure_pull_secrets --all
build_images ---var DOCKER_DEFAULT_PLATFORM=linux/amd64 --all -t $(git rev-parse --short HEAD)
build_images --all
kubectl label namespace ${DEVSPACE_NAMESPACE} cleanup.kyverno.io/ttl=${NS_TTL} || true
kubectl label namespace/${DEVSPACE_NAMESPACE} network=crib || true
if [ -n "$1" ]; then
echo "Deploying tag $1"
tag=$1
image=${DEVSPACE_IMAGE}:$tag
else
echo "Deploying current commit tag: $(git rev-parse --short HEAD)"
tag=$(git rev-parse --short HEAD)
image=${DEVSPACE_IMAGE}:$tag
fi
echo "Checking tag: $tag"
tag=$(git rev-parse --short HEAD)
image=${DEVSPACE_IMAGE}:$tag
echo "Checking tag: '$tag'"
repository_name="chainlink-devspace"
desired_tag=$tag
Expand Down Expand Up @@ -97,11 +92,25 @@ commands:
images:
app:
image: ${DEVSPACE_IMAGE}
dockerfile: ../../core/chainlink.devspace.Dockerfile
context: ../..
docker:
disableFallback: true
tags:
- $(git rev-parse --short HEAD)
custom:
skipImageArg: true
command: |-
TOPLEVEL=$(git rev-parse --show-toplevel)
pushd $TOPLEVEL
pwd
goreleaser --version
MACOS_SDK_DIR=$(pwd)/tools/bin/MacOSX12.3.sdk ./tools/bin/goreleaser_wrapper release --snapshot --clean --config .goreleaser.develop.yaml
popd
BUILT_IMAGE=$(cat $TOPLEVEL/dist/artifacts.json | jq -r '.[] | select(.type == "Docker Image" and .goarch == "amd64" and (.name | contains("sha")) and ( .name | contains("root") | not) ) | .name')
echo "Tagging and pushing image"
tag=$(git rev-parse --short HEAD)
TAGGED_IMAGE=${DEVSPACE_IMAGE}:$tag
docker tag $BUILT_IMAGE ${runtime.images.app.image}:${runtime.images.app.tag}
echo "Tagged image: $TAGGED_IMAGE"
docker push $TAGGED_IMAGE
hooks:
- wait:
running: true
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ in
mkShell {
nativeBuildInputs = [
go

goreleaser
postgresql

python3
Expand Down

0 comments on commit 2f73d04

Please sign in to comment.