Skip to content

Commit

Permalink
Fix output paths for compile-release script.
Browse files Browse the repository at this point in the history
Co-authored-by: Yechiel Kalmenson <[email protected]>
  • Loading branch information
jsampson1 and achasveachas committed Jun 9, 2021
1 parent fed6969 commit 12de290
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
26 changes: 14 additions & 12 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,20 @@ jobs:
passed: [test]
params:
submodules: none
- do:
- task: compile-release
image: cred-alert-image
file: cred-alert/ci/tasks/compile-release.yml
- task: test
image: cred-alert-image
file: cred-alert/ci/tasks/test.yml
- task: compile-release
image: cred-alert-image
file: cred-alert/ci/tasks/compile-release.yml
- put: github-release
params:
name: release-params/tag-name
tag: release-params/tag-name
commitish: release-params/commit-sha
globs:
- "cred-alert-cli/cred-alert-cli_linux"
- "cred-alert-cli/cred-alert-cli_darwin"
- in_parallel:
- put: cli-linux
params:
Expand All @@ -121,11 +131,3 @@ jobs:
params:
file: "cred-alert-cli/cred-alert-cli_darwin"
acl: public-read
- put: github-release
params:
name: release-params/tag-name
tag: release-params/tag-name
commitish: release-params/commit-sha
globs:
- "cred-alert-cli/cred-alert-cli_linux"
- "cred-alert-cli/cred-alert-cli_darwin"
8 changes: 5 additions & 3 deletions ci/scripts/compile-release
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ export GOPATH="${PWD}/go"
export PATH="${GOPATH}/bin:${PATH}"

cred_alert_root=$(cd "$(dirname "${BASH_SOURCE}")"; cd ../..; pwd)
release_params_path="${PWD}/release-params"
cred_alert_cli_path="${PWD}/cred-alert-cli"

pushd "${cred_alert_root}"
tag_name=$(date +%Y-%m-%d-%H-%M-%S)
commit_sha="$(git rev-parse HEAD)"
version="$tag_name ($commit_sha)"

echo $tag_name > "${PWD}/release-params/tag-name"
echo $commit_sha > "${PWD}/release-params/commit-sha"
echo $tag_name > "${release_params_path}/tag-name"
echo $commit_sha > "${release_params_path}/commit-sha"

for goos in darwin linux; do
GOOS=$goos go build \
-ldflags "-X 'github.com/pivotal-cf/cred-alert/commands.version=${version}'" \
-x -v -o "${PWD}/cred-alert-cli/cred-alert-cli_${goos}"
-x -v -o "${cred_alert_cli_path}/cred-alert-cli_${goos}"
done
popd

0 comments on commit 12de290

Please sign in to comment.