You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer on Flank, I want to move the release job to GitHub actions so I can automatically release new versions of Flank.
The Flank release job on Bitrise sometimes flakes out. Let's move all the bitrise jobs to GitHub actions. As part of migrating the release job, we should probably build a Kotlin CLI that automates the release. Then the GitHub Action will simply invoke this Kotlin CLI that has the complex release logic.
Example error:
+ jfrog bt mcs flank/maven/flank/v20.07.0[Info] Requesting content sync...[Error] bintray response: 404 Not Found{"message": "Version 'v20.07.0' was not found"}
Any part of the release process can fail. Maven sync is particularly flaky. The Kotlin wrapper code should be smart enough to intelligently retry on error after a delay.
Here's the bitrise job yaml:
---
format_version: '4'default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.gitproject_type: otherworkflows:
primary:
steps:
- script:
inputs:
- content: |- #!/usr/bin/env bash set -euxo pipefail curl -L https://github.com/github/hub/releases/download/v2.12.8/hub-linux-amd64-2.12.8.tgz | tar xvz mv hub-*/bin/hub . envman add --key PATH --value "`pwd`:$PATH"title: Install hub
- script:
inputs:
- content: |- #!/usr/bin/env bash set -euxo pipefail hub --versiontitle: Check hub version
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'title: Activate SSH key
- git-clone: {}
- cache-pull: {}
- script:
title: Set flank version.txtinputs:
- content: | #!/usr/bin/env bash set -ex # when triggered from a tag push BITRISE_GIT_TAG will already be defined # if BITRISE_GIT_TAG is null (-z) then we'll use flank_snapshot if [[ -z "$BITRISE_GIT_TAG" ]]; then BITRISE_GIT_TAG=flank_snapshot envman add --key MVN_VERSION --value "$BITRISE_GIT_TAG" else # drop leading v for maven. v4.4 -> 4.4 envman add --key MVN_VERSION --value "${BITRISE_GIT_TAG:1}" fi echo "$BITRISE_GIT_TAG" > ./test_runner/src/main/resources/version.txt envman add --key SNAPSHOT_TAG --value $BITRISE_GIT_TAG echo "$GIT_CLONE_COMMIT_HASH" > ./test_runner/src/main/resources/revision.txt envman add --key MVN_REVISION --value $GIT_CLONE_COMMIT_HASH # Update bugsnag curl https://build.bugsnag.com/ \ --header "Content-Type: application/json" \ --data '{ "apiKey": "$BUGSNAG_KEY", "appVersion": "'"$GIT_CLONE_COMMIT_HASH"'", "releaseStage": "production", "builderName": "bitrise", "sourceControl": { "provider": "github", "repository": "https://github.com/Flank/flank", "revision": "'"$GIT_CLONE_COMMIT_HASH"'" }, "metadata": {"bitrise_build": "'"$BITRISE_BUILD_URL"'"} }'
- script:
title: Delete old snapshotinputs:
- content: |- #!/usr/bin/env bash set -x curl -fL https://getcli.jfrog.io | sh ./jfrog bt config --user $MVN_USER --key $MVN_KEY --licenses Apache-2.0 ./jfrog bt version-delete flank/maven/flank/$MVN_VERSION --quiet exit 0
- gradle-runner:
inputs:
- gradle_task: "-p test_runner clean build shadowJar"
- gradlew_path: "./test_runner/gradlew"
- cache_level: alltitle: test_runner clean build shadowJar
- gradle-runner:
inputs:
- gradlew_path: "./test_runner/gradlew"
- gradle_task: "-p test_runner bintrayUpload"title: Gradle bintrayUpload
- script:
title: Rename flank jarinputs:
- content: | #!/usr/bin/env bash set -euxo pipefail ls -la ./test_runner/build/libs/ mv ./test_runner/build/libs/flank.jar "$BITRISE_DEPLOY_DIR/flank.jar" envman add --key COMMIT_HASH --value ${GIT_CLONE_COMMIT_HASH:0:7}
- script:
title: Hub remove old releaseinputs:
- content: |- #!/usr/bin/env bash set -e # Authorize hub mkdir -p ~/.config/ cat << EOF > ~/.config/hub github.com: - user: bootstraponline oauth_token: $GH_TOKEN protocol: https EOF # Verify hub is on path hub --version # Disable error reporting because we're expecting an error. set +e hub release delete "$SNAPSHOT_TAG" exit 0
- script:
inputs:
- content: |- #!/usr/bin/env bash # Only delete if tag is latest. Otherwise we'll go into a tag delete/trigger loop! if [[ "$SNAPSHOT_TAG" = "flank_snapshot" ]]; then curl -u bootstraponline:$GH_TOKEN -X "DELETE" "https://api.github.com/repos/Flank/flank/git/refs/tags/$SNAPSHOT_TAG" fi exit 0title: Remove old tag
- script:
run_if: enveq "SNAPSHOT_TAG" "flank_snapshot"title: Release - Snapshot Onlyinputs:
- content: |- #!/usr/bin/env bash # fail if any commands fails set -ex hub release create -p -a "$BITRISE_DEPLOY_DIR/flank.jar" -m "Flank $BITRISE_GIT_TAG" -m "Snapshot release for commit $COMMIT_HASH" "$SNAPSHOT_TAG"
- script:
run_if: not (enveq "SNAPSHOT_TAG" "flank_snapshot")title: Release - Stable Onlyinputs:
- content: |- #!/usr/bin/env bash # fail if any commands fails set -ex hub release create -a "$BITRISE_DEPLOY_DIR/flank.jar" -m "Flank $BITRISE_GIT_TAG" -m "Stable release for commit $COMMIT_HASH" "$SNAPSHOT_TAG"
- script@1:
title: Maven Central Syncinputs:
- content: |- #!/usr/bin/env bash # fail if any commands fails set -ex # Sync bintray to maven central jfrog bt mcs flank/maven/flank/"$SNAPSHOT_TAG"
- cache-push:
is_always_run: trueinputs:
- cache_paths: | $BITRISE_CACHE_DIR /root/.gradleapp:
envs:
- DONT_PUT_SECRETS_HERE: THIS_IS_A_PUBLIC_JOB
- opts:
is_expand: falseSNAPSHOT_TAG: flank_snapshottrigger_map:
- push_branch: masterworkflow: primary
- tag: v*workflow: primary
The text was updated successfully, but these errors were encountered:
Author the user story for this feature
As a developer on Flank, I want to move the release job to GitHub actions so I can automatically release new versions of Flank.
The Flank release job on Bitrise sometimes flakes out. Let's move all the bitrise jobs to GitHub actions. As part of migrating the release job, we should probably build a Kotlin CLI that automates the release. Then the GitHub Action will simply invoke this Kotlin CLI that has the complex release logic.
Example error:
Any part of the release process can fail. Maven sync is particularly flaky. The Kotlin wrapper code should be smart enough to intelligently retry on error after a delay.
Here's the bitrise job yaml:
The text was updated successfully, but these errors were encountered: