Skip to content

Commit 214c491

Browse files
authored
[REL-4161] some minor fixes and cleanup (#520)
Fixes for some minor issues that cursor found in the Release GHA. <!-- ld-jira-link --> --- Related Jira issue: [REL-4161: Migrate ld-find-code-refs from Releaser to GHA](https://launchdarkly.atlassian.net/browse/REL-4161) <!-- end-ld-jira-link -->
1 parent 87028fa commit 214c491

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

scripts/release/commit-and-tag.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ set -euo pipefail
44

55
RELEASE_TAG="v${LD_RELEASE_VERSION}"
66

7+
tag_exists() (
8+
git fetch --tags
9+
git rev-parse "${RELEASE_TAG}" >/dev/null 2>&1
10+
)
11+
712
echo "Changes staged for release $RELEASE_TAG:"
813
git diff
914

scripts/release/prepare-release.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ update_bitbucket() (
2323
sed -i "s#image: launchdarkly/ld-find-code-refs-bitbucket-pipeline:.*#image: launchdarkly/ld-find-code-refs-bitbucket-pipeline:${LD_RELEASE_VERSION}#g" build/metadata/bitbucket/pipe.yml
2424
)
2525

26-
tag_exists() (
27-
git fetch --tags
28-
git rev-parse "${RELEASE_TAG}" >/dev/null 2>&1
29-
)
30-
3126
update_go
3227
update_orb
3328
update_gha

scripts/release/publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
set -euo pipefail
44

5-
sudo docker login --username ${DOCKER_USERNAME} --password-stdin ${DOCKER_TOKEN}
5+
echo ${DOCKER_TOKEN} | sudo docker login --username ${DOCKER_USERNAME} --password-stdin
66

77
sudo PATH=${PATH} GITHUB_TOKEN=${GITHUB_TOKEN} make publish
88

99
# make bitbucket and github known hosts to push successfully
10-
mkdir m700 ~/.ssh
10+
mkdir -m700 ~/.ssh
1111
touch ~/.ssh/known_hosts
1212
chmod 644 ~/.ssh/known_hosts
1313
ssh-keyscan -t rsa bitbucket.org >> ~/.ssh/known_hosts

scripts/release/targets/bitbucket.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ publish_bitbucket() (
2525
setup_bitbucket
2626
cd bitbucketMetadataUpdates
2727

28-
if git ls-remote --tags origin "refs/tags/v$VERSION" | grep -q "v$VERSION"; then
28+
if git ls-remote --tags origin "refs/tags/v$LD_RELEASE_VERSION" | grep -q "v$LD_RELEASE_VERSION"; then
2929
echo "Version exists; skipping publishing BitBucket Pipe"
3030
else
3131
echo "Live run: will publish pipe to bitbucket."

scripts/release/targets/gha.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ clean_up_gha() (
3939
publish_gha() (
4040
setup_gha
4141

42-
if git ls-remote --tags origin "refs/tags/v$VERSION" | grep -q "v$VERSION"; then
42+
if git ls-remote --tags origin "refs/tags/v$LD_RELEASE_VERSION" | grep -q "v$LD_RELEASE_VERSION"; then
4343
echo "Version exists; skipping publishing GHA"
4444
else
4545
echo "Live run: will publish action to github action marketplace."
@@ -51,7 +51,7 @@ publish_gha() (
5151
gh release create $RELEASE_TAG --notes "$RELEASE_NOTES"
5252
fi
5353

54-
clean_up
54+
clean_up_gha
5555
)
5656

5757
dry_run_gha() (

0 commit comments

Comments
 (0)