File tree Expand file tree Collapse file tree 6 files changed +107
-2
lines changed
Expand file tree Collapse file tree 6 files changed +107
-2
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ csource=" ${BASH_SOURCE[0]} "
4+ while [ -h " $csource " ] ; do csource=" $( readlink " $csource " ) " ; done
5+ root=" $( cd -P " $( dirname " $csource " ) /../" && pwd ) "
6+
7+ . " ${root} /.ci/load-ci.sh"
8+
9+ if [ " ${# } " -ne 2 ]; then
10+ printf " Usage: %s BRANCH COMMIT_ID\n" " ${0} " >&2
11+ exit 1
12+ fi
13+
14+ branch=" ${1} "
15+ full_sha=" ${2} "
16+
17+ if [ -z " ${branch} " ]; then
18+ failure " Branch variable is unset, required for dev build"
19+ fi
20+ if [ -z " ${full_sha} " ]; then
21+ failure " The full_sha variable is unexpectedly missing, cannot trigger dev build"
22+ fi
23+
24+ # Trim the reference prefix if needed
25+ if [[ " ${branch} " = * " refs/heads" * ]]; then
26+ debug " trimming branch reference value - %s" " ${branch} "
27+ branch=" ${branch##* refs/ heads/ } "
28+ debug " trimmed branch value - %s" " ${branch} "
29+ fi
30+
31+ info " Triggering development build %s (%s)" " ${tag} " " ${full_sha} "
32+ github_repository_dispatch " vagrant-builders" " build" " commit_id=${full_sha} " " branch=${branch} "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ csource=" ${BASH_SOURCE[0]} "
4+ while [ -h " $csource " ] ; do csource=" $( readlink " $csource " ) " ; done
5+ root=" $( cd -P " $( dirname " $csource " ) /../" && pwd ) "
6+
7+ . " ${root} /.ci/load-ci.sh"
8+
9+ if [ " ${# } " -ne 1 ]; then
10+ printf " Usage: %s COMMIT_ID\n" " ${0} " >&2
11+ exit 1
12+ fi
13+
14+ full_sha=" ${1} "
15+
16+ if [ -z " ${full_sha} " ]; then
17+ failure " The full_sha variable is unexpectedly missing, cannot trigger nightly build"
18+ fi
19+
20+ info " Triggering nightly build %s (%s)" " ${tag} " " ${full_sha} "
21+ github_repository_dispatch " vagrant-builders" " nightlies" " commit_id=${full_sha} "
Original file line number Diff line number Diff line change @@ -6,12 +6,27 @@ root="$( cd -P "$( dirname "$csource" )/../" && pwd )"
66
77. " ${root} /.ci/load-ci.sh"
88
9+ if [ " ${# } " -ne 2 ]; then
10+ printf " Usage: %s TAG COMMIT_ID\n" " ${0} " >&2
11+ exit 1
12+ fi
13+
14+ tag=" ${1} "
15+ full_sha=" ${2} "
16+
917if [ -z " ${tag} " ]; then
10- failure " Tag variable is unset (will be automatically set on tag push) "
18+ failure " Tag variable is unset, required for release "
1119fi
1220if [ -z " ${full_sha} " ]; then
1321 failure " The full_sha variable is unexpectedly missing, cannot trigger release"
1422fi
1523
24+ # Trim the prefix of the tag if it hasn't been
25+ if [[ " ${tag} " = * " refs/tags" * ]]; then
26+ debug " trimming tag reference value - %s" " ${tag} "
27+ tag=" ${tag##* refs/ tags/ } "
28+ debug " trimmed tag value - %s" " ${tag} "
29+ fi
30+
1631info " Triggering release %s (%s)" " ${tag} " " ${full_sha} "
1732github_repository_dispatch " vagrant-builders" " hashicorp-release" " commit_id=${full_sha} " " tag=${tag} "
Original file line number Diff line number Diff line change 1+ on :
2+ push :
3+ branches : ' build-*'
4+
5+ jobs :
6+ trigger-build :
7+ if : github.repository == 'hashicorp/vagrant'
8+ name : Trigger Development Build
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Code Checkout
12+ uses : actions/checkout@v3
13+ - name : Trigger Development Build
14+ run : ./.ci/dev-build "${BRANCH}" "${COMMIT_ID}"
15+ env :
16+ HASHIBOT_TOKEN : ${{ secrets.HASHIBOT_TOKEN }}
17+ BRANCH : ${{ github.ref_name }}
18+ COMMIT_ID : ${{ github.sha }}
Original file line number Diff line number Diff line change 1+ on :
2+ schedule :
3+ - cron : 30 22 * * *
4+
5+ jobs :
6+ trigger-nightly :
7+ if : github.repository == 'hashicorp/vagrant'
8+ name : Trigger Nightly Build
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Code Checkout
12+ uses : actions/checkout@v3
13+ - name : Trigger Nightly Build
14+ run : ./.ci/nightly-build "${COMMIT_ID}"
15+ env :
16+ HASHIBOT_TOKEN : ${{ secrets.HASHIBOT_TOKEN }}
17+ COMMIT_ID : ${{ github.sha }}
Original file line number Diff line number Diff line change 1111 - name : Code Checkout
1212 uses : actions/checkout@v3
1313 - name : Trigger Build
14- run : ./.ci/release
14+ run : ./.ci/release "${TAG}" "${COMMIT_ID}"
1515 env :
1616 HASHIBOT_TOKEN : ${{ secrets.HASHIBOT_TOKEN }}
17+ TAG : ${{ github.ref }}
18+ COMMIT_ID : ${{ github.sha }}
You can’t perform that action at this time.
0 commit comments