Skip to content

Commit

Permalink
fix: create_deployment_artifacts needs go installed (#5288)
Browse files Browse the repository at this point in the history
In #5285 the script which extracts the LS protocol version from snyk-ls was
changed to use the Go module cache. `go install` is used as an alternative to
fetching directly from Github.

This requires Go to be installed during the deployment release build.

Adding more observability to the release script.
  • Loading branch information
cmars authored Jun 4, 2024
1 parent 9aa6f76 commit f82b0e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,10 @@ workflows:

- create_deployment_artifacts:
name: create deployment artifacts
go_target_os: linux
go_os: linux
go_arch: amd64
go_download_base_url: << pipeline.parameters.go_download_base_url >>
context: snyk-cli-pgp-signing
requires:
- sign macos amd64
Expand Down Expand Up @@ -1202,9 +1206,27 @@ jobs:
- binary-releases/fips/snyk-*

create_deployment_artifacts:
parameters:
go_os:
type: string
go_target_os:
type: string
go_arch:
type: string
go_download_base_url:
type: string
install_path:
type: string
default: '.'
executor: docker-amd64
steps:
- prepare-workspace
- install-go:
go_os: << parameters.go_os >>
go_target_os: << parameters.go_target_os >>
go_arch: << parameters.go_arch >>
base_url: << parameters.go_download_base_url >>
extraction_path: << parameters.install_path >>
- run:
name: Creating all shasums
command: find binary-releases -name "snyk-*" -exec make {}.sha256 \;
Expand Down
4 changes: 2 additions & 2 deletions release-scripts/write-ls-protocol-version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
)

func getGoreleaserYAML(commit string) (int, error) {
err := exec.Command("go", "install", "github.com/snyk/snyk-ls@"+commit).Run()
installOutput, err := exec.Command("go", "install", "github.com/snyk/snyk-ls@"+commit).CombinedOutput()
if err != nil {
return -3, fmt.Errorf("go install failed: %w", err)
return -3, fmt.Errorf("go install failed: %w: %q", err, string(installOutput))
}
modCacheDir, err := goModCache()
if err != nil {
Expand Down

0 comments on commit f82b0e8

Please sign in to comment.