Skip to content

Commit

Permalink
chore: bump to go 1.21.7, publish build image to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
cmars committed Feb 21, 2024
1 parent be39828 commit 5f595b4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .circleci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM --platform=$TARGETPLATFORM golang:1.21-bullseye

# Link the image to the source project. This grants snyk/cli's Github Actions permission to publish the image.
LABEL org.opencontainers.image.source="https://github.com/snyk/cli"

# A description shown for the image in the Github Container Registry UI.
LABEL org.opencontainers.image.description="Snyk CLI build environment"

# install "normal" stuff

ARG NODEVERSION
Expand Down
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ parameters:
go_version:
type: string
# https://go.dev/doc/devel/release
default: '1.21.5'
default: '1.21.7'
aws_version:
type: string
# https://github.com/aws/aws-cli/blob/v2/CHANGELOG.rst
Expand All @@ -38,12 +38,12 @@ executors:
- image: alpine:3.17
docker-amd64:
docker:
- image: cimg/go:1.21-node
- image: ghcr.io/snyk/cli-build:20240214-145818
working_directory: /mnt/ramdisk/snyk
resource_class: large
docker-arm64:
docker:
- image: cimg/go:1.21-node
- image: ghcr.io/snyk/cli-build-arm64:20240214-145818
working_directory: /mnt/ramdisk/snyk
resource_class: arm.large
linux-ubuntu-mantic-amd64:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/create-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
- uses: docker/setup-buildx-action@v2
- name: Build Docker image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: token
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_HOST: ghcr.io
DOCKER_BUILDKIT: 1
run: scripts/create-build-image.sh
2 changes: 1 addition & 1 deletion cliv2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/snyk/cli/cliv2

go 1.21

toolchain go1.21.5
toolchain go1.21.7

require (
github.com/elazarl/goproxy v0.0.0-20231031074852-3ec07828be7a
Expand Down
6 changes: 2 additions & 4 deletions scripts/create-build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ pushd "$SCRIPT_DIR/.."
NODEVERSION=$(head -1 .nvmrc)
export NODEVERSION

docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"

BASE_IMG_NAME=$DOCKER_USERNAME/cli-build
BASE_IMG_NAME=ghcr.io/snyk/cli-build
docker buildx build \
--build-arg NODEVERSION="$NODEVERSION" \
--build-arg ARCH="x86_64" \
Expand All @@ -31,7 +29,7 @@ pushd "$SCRIPT_DIR/.."
--push \
--file .circleci/Dockerfile .

BASE_IMG_NAME=$DOCKER_USERNAME/cli-build-arm64
BASE_IMG_NAME=ghcr.io/snyk/cli-build-arm64
docker buildx build \
--build-arg NODEVERSION="$NODEVERSION" \
--build-arg ARCH="aarch64" \
Expand Down

0 comments on commit 5f595b4

Please sign in to comment.