Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build devspace dockers with goreleaser #579

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/chainlink-cluster/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: mockserver
repository: https://www.mock-server.com
version: 5.14.0
digest: sha256:059ea904117893108a9e39e9c8506179847ab1a480658f4fc30f7cd4b03acd90
generated: "2024-03-05T10:19:41.127258+01:00"
2 changes: 1 addition & 1 deletion charts/chainlink-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Configure your `cluster` setup (one time setup, internal usage only)
```
export DEVSPACE_IMAGE="..."
cd charts/chainlink-cluster
./setup.sh ${my-personal-namespace-name-crib}
TBD
```

Build and deploy current commit
Expand Down
26 changes: 20 additions & 6 deletions charts/chainlink-cluster/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ 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 annotate namespace ${DEVSPACE_NAMESPACE} janitor/ttl=${NS_TTL} || true
kubectl label namespace/${DEVSPACE_NAMESPACE} network=crib || true
if [ -n "$1" ]; then
Expand Down Expand Up @@ -93,11 +93,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
GOARCH=amd64 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
30 changes: 24 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
go = go_1_19;
go = go_1_21;
postgresql = postgresql_14;
nodejs = nodejs-16_x;
nodejs = nodejs-18_x;
nodePackages = pkgs.nodePackages.override { inherit nodejs; };
in
mkShell {
nativeBuildInputs = [
go

goreleaser
postgresql
python3
python3Packages.pip
Expand All @@ -30,8 +30,10 @@ mkShell {
delve
golangci-lint
github-cli
jq

# deployment
awscli2
devspace
kubectl
kubernetes-helm
Expand All @@ -48,8 +50,4 @@ mkShell {

PGDATA = "db";
CL_DATABASE_URL = "postgresql://chainlink:chainlink@localhost:5432/chainlink_test?sslmode=disable";
shellHook = ''
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
'';
}
Loading