diff --git a/.circleci/config.yml b/.circleci/config.yml index efb2140b9c..644e6ba264 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,8 +35,12 @@ orbs: executors: alpine: docker: - - image: alpine:3.17 + - image: alpine:3.20 resource_class: xlarge + alpine-arm64: + docker: + - image: alpine:3.20 + resource_class: arm.xlarge generic-ubuntu: docker: - image: ubuntu:latest @@ -329,12 +333,21 @@ commands: - run: name: Installing Node.js + other test dependencies command: | - apk add --update nodejs npm bash maven git gradle python3 py3-pip elixir composer + arch=$(uname -m) + case "$arch" in + aarch64) arch="arm64";; + *) arch="amd64";; + esac + echo "using architecture: $arch" + apk add --update nodejs npm bash maven git python3 py3-pip elixir composer unzip pip3 install pipenv requests PyYAML setuptools==70.3.0 wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && chmod +x dotnet-install.sh && ./dotnet-install.sh - wget https://go.dev/dl/go<< pipeline.parameters.go_version >>.linux-amd64.tar.gz -O /tmp/go.tgz && \ + wget https://go.dev/dl/go<< pipeline.parameters.go_version >>.linux-$arch.tar.gz -O /tmp/go.tgz && \ tar -C /usr/local -xzvf /tmp/go.tgz && \ ln -s /usr/local/go/bin/go /usr/local/bin + wget https://services.gradle.org/distributions/gradle-8.10-bin.zip -O /tmp/gradle.zip && \ + unzip -d /usr/local /tmp/gradle.zip && \ + ln -s /usr/local/gradle-8.10/bin/gradle /usr/local/bin failed-release-notification: steps: @@ -477,6 +490,17 @@ workflows: requires: - prepare-build + - build-artifact: + name: build alpine arm64 + go_target_os: alpine + go_os: linux + go_arch: arm64 + go_download_base_url: << pipeline.parameters.go_download_base_url >> + executor: docker-arm64 + c_compiler: /usr/bin/musl-gcc + requires: + - prepare-build + - build-artifact: name: build macOS amd64 go_target_os: darwin @@ -590,6 +614,23 @@ workflows: install_deps_extension: alpine-full dont_skip_tests: 0 + - acceptance-tests: + name: acceptance-tests alpine arm64 + context: + - nodejs-install + - team_hammerhead-cli + filters: + branches: + ignore: + - main + - '/release.*/' + requires: + - build alpine arm64 + executor: alpine-arm64 + test_snyk_command: ./binary-releases/snyk-alpine-arm64 + install_deps_extension: alpine-full + dont_skip_tests: 0 + - acceptance-tests: name: acceptance-tests macOS amd64 context: @@ -686,6 +727,7 @@ workflows: - sign macos arm64 - sign windows amd64 - build alpine amd64 + - build alpine arm64 - build linux amd64 - build linux arm64 - build fix & protect @@ -1127,6 +1169,8 @@ jobs: default: 3 executor: << parameters.executor >> parallelism: << parameters.shards >> + environment: + PIP_BREAK_SYSTEM_PACKAGES: 1 steps: - prepare-workspace - install-deps-<< parameters.install_deps_extension >> diff --git a/Makefile b/Makefile index bbf9fad66c..7c1bba3d8b 100644 --- a/Makefile +++ b/Makefile @@ -119,6 +119,10 @@ $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-alpine: prepack | $(BINARY_RELEASES_FOLDER $(PKG) -t node$(PKG_NODE_VERSION)-alpine-x64 -o $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-alpine $(MAKE) $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-alpine.sha256 +$(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-alpine-arm64: prepack | $(BINARY_RELEASES_FOLDER_TS_CLI) + $(PKG) -t node$(PKG_NODE_VERSION)-alpine-arm64 -o $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-alpine-arm64 --no-bytecode + $(MAKE) $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-alpine-arm64.sha256 + $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-linux: prepack | $(BINARY_RELEASES_FOLDER_TS_CLI) $(PKG) -t node$(PKG_NODE_VERSION)-linux-x64 -o $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-linux $(MAKE) $(BINARY_RELEASES_FOLDER_TS_CLI)/snyk-linux.sha256 @@ -266,7 +270,7 @@ release-pre: @echo "-- Validating artifacts" @./release-scripts/validate-checksums.sh @echo "-- Validating upload permissions" - @./release-scripts/upload-artifacts.sh --dry-run preview latest github npm + @./release-scripts/upload-artifacts.sh --dry-run latest github npm @echo "-- Publishing to S3 /version" @./release-scripts/upload-artifacts.sh version diff --git a/binary-deployments.json b/binary-deployments.json index edd548e616..2febdc2abf 100644 --- a/binary-deployments.json +++ b/binary-deployments.json @@ -7,7 +7,8 @@ "amd64": "snyk-win.exe" }, "alpine": { - "amd64": "snyk-alpine" + "amd64": "snyk-alpine", + "arm64": "snyk-alpine-arm64" }, "linux": { "amd64": "snyk-linux", diff --git a/release-scripts/release.json b/release-scripts/release.json index 101741e724..b872c806d5 100644 --- a/release-scripts/release.json +++ b/release-scripts/release.json @@ -6,6 +6,11 @@ "sha256": "snyk-alpine-sha256", "sha256Url": "https://downloads.snyk.io/cli/v1.0.0-monorepo/snyk-alpine.sha256" }, + "snyk-alpine-arm64": { + "url": "https://downloads.snyk.io/cli/v1.0.0-monorepo/snyk-alpine-arm64", + "sha256": "snyk-alpine-arm64-sha256", + "sha256Url": "https://downloads.snyk.io/cli/v1.0.0-monorepo/snyk-alpine-arm64.sha256" + }, "snyk-linux": { "url": "https://downloads.snyk.io/cli/v1.0.0-monorepo/snyk-linux", "sha256": "snyk-linux-sha256", diff --git a/release-scripts/upload-artifacts.sh b/release-scripts/upload-artifacts.sh index d3286dc110..540c3e34c8 100755 --- a/release-scripts/upload-artifacts.sh +++ b/release-scripts/upload-artifacts.sh @@ -6,12 +6,14 @@ PROTOCOL_VERSION_FILE=$(basename "$(/bin/ls binary-releases/ls-protocol-version* declare -a StaticFiles=( "binary-releases/$PROTOCOL_VERSION_FILE" "binary-releases/snyk-alpine" + "binary-releases/snyk-alpine-arm64" "binary-releases/snyk-linux" "binary-releases/snyk-linux-arm64" "binary-releases/snyk-macos" "binary-releases/snyk-macos-arm64" "binary-releases/snyk-win.exe" "binary-releases/snyk-alpine.sha256" + "binary-releases/snyk-alpine-arm64.sha256" "binary-releases/snyk-linux.sha256" "binary-releases/snyk-linux-arm64.sha256" "binary-releases/snyk-macos.sha256" diff --git a/ts-binary-wrapper/test/acceptance/basic.spec.ts b/ts-binary-wrapper/test/acceptance/basic.spec.ts index 1f4431c1b4..b55858bc4f 100644 --- a/ts-binary-wrapper/test/acceptance/basic.spec.ts +++ b/ts-binary-wrapper/test/acceptance/basic.spec.ts @@ -9,7 +9,7 @@ jest.setTimeout(60 * 1000); describe('Basic acceptance test', () => { const envSetup = new TestEnvironmentSetup(); const cliVersionForTesting = - '1.1228.0-dev.b6d3a5aed7033dd2fe9fcc1330effeca0e4250b2'; + '1.1294.0-dev.fb7d0fdb0ab3beb8af7142c84ded754b568ba2f4'; beforeEach(async () => { process.env.SNYK_DISABLE_ANALYTICS = '1';