Add build triggers
Include workflows for triggering nightly builds and custom dev builds from `build-` prefixed branches
This commit is contained in:
parent
72d528fa0e
commit
f9c3736994
32
.ci/dev-build
Executable file
32
.ci/dev-build
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
csource="${BASH_SOURCE[0]}"
|
||||
while [ -h "$csource" ] ; do csource="$(readlink "$csource")"; done
|
||||
root="$( cd -P "$( dirname "$csource" )/../" && pwd )"
|
||||
|
||||
. "${root}/.ci/load-ci.sh"
|
||||
|
||||
if [ "${#}" -ne 2 ]; then
|
||||
printf "Usage: %s BRANCH COMMIT_ID\n" "${0}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
branch="${1}"
|
||||
full_sha="${2}"
|
||||
|
||||
if [ -z "${branch}" ]; then
|
||||
failure "Branch variable is unset, required for dev build"
|
||||
fi
|
||||
if [ -z "${full_sha}" ]; then
|
||||
failure "The full_sha variable is unexpectedly missing, cannot trigger dev build"
|
||||
fi
|
||||
|
||||
# Trim the reference prefix if needed
|
||||
if [[ "${branch}" = *"refs/heads"* ]]; then
|
||||
debug "trimming branch reference value - %s" "${branch}"
|
||||
branch="${branch##*refs/heads/}"
|
||||
debug "trimmed branch value - %s" "${branch}"
|
||||
fi
|
||||
|
||||
info "Triggering development build %s (%s)" "${tag}" "${full_sha}"
|
||||
github_repository_dispatch "vagrant-builders" "build" "commit_id=${full_sha}" "branch=${branch}"
|
||||
21
.ci/nightly-build
Executable file
21
.ci/nightly-build
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
csource="${BASH_SOURCE[0]}"
|
||||
while [ -h "$csource" ] ; do csource="$(readlink "$csource")"; done
|
||||
root="$( cd -P "$( dirname "$csource" )/../" && pwd )"
|
||||
|
||||
. "${root}/.ci/load-ci.sh"
|
||||
|
||||
if [ "${#}" -ne 1 ]; then
|
||||
printf "Usage: %s COMMIT_ID\n" "${0}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
full_sha="${1}"
|
||||
|
||||
if [ -z "${full_sha}" ]; then
|
||||
failure "The full_sha variable is unexpectedly missing, cannot trigger nightly build"
|
||||
fi
|
||||
|
||||
info "Triggering nightly build %s (%s)" "${tag}" "${full_sha}"
|
||||
github_repository_dispatch "vagrant-builders" "nightlies" "commit_id=${full_sha}"
|
||||
18
.github/workflows/dev-build.yml
vendored
Normal file
18
.github/workflows/dev-build.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
on:
|
||||
push:
|
||||
branches: 'build-*'
|
||||
|
||||
jobs:
|
||||
trigger-build:
|
||||
if: github.repository == 'hashicorp/vagrant'
|
||||
name: Trigger Development Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Code Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Trigger Development Build
|
||||
run: ./.ci/dev-build "${BRANCH}" "${COMMIT_ID}"
|
||||
env:
|
||||
HASHIBOT_TOKEN: ${{ secrets.HASHIBOT_TOKEN }}
|
||||
BRANCH: ${{ github.ref_name }}
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
17
.github/workflows/nightlies.yml
vendored
Normal file
17
.github/workflows/nightlies.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
on:
|
||||
schedule:
|
||||
- cron: 30 22 * * *
|
||||
|
||||
jobs:
|
||||
trigger-nightly:
|
||||
if: github.repository == 'hashicorp/vagrant'
|
||||
name: Trigger Nightly Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Code Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Trigger Nightly Build
|
||||
run: ./.ci/nightly-build "${COMMIT_ID}"
|
||||
env:
|
||||
HASHIBOT_TOKEN: ${{ secrets.HASHIBOT_TOKEN }}
|
||||
COMMIT_ID: ${{ github.sha }}
|
||||
Loading…
x
Reference in New Issue
Block a user