mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Cirrus: Skip rebuilding images unless instructed
Given frequent merges, it doesn't make sense to rebuild the VM testing images every time. Instead, monitor the PR title and description for a magic string, only triggering builds on a match: ***CIRRUS: REBUILD IMAGES*** Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
@ -22,9 +22,7 @@ SCRIPT_BASE $SCRIPT_BASE
|
|||||||
PACKER_BASE $PACKER_BASE
|
PACKER_BASE $PACKER_BASE
|
||||||
"
|
"
|
||||||
|
|
||||||
# TODO: Skip building images if $CIRRUS_BRANCH =~ "master" and
|
require_regex '\*\*\*\s*CIRRUS:\s*REBUILD\s*IMAGES\s*\*\*\*' 'Not re-building VM images'
|
||||||
# commit message of $CIRRUS_CHANGE_IN_REPO contains a magic word
|
|
||||||
# produced by 'commit_and_create_upstream_pr.sh' script (see .cirrus.yml)
|
|
||||||
|
|
||||||
show_env_vars
|
show_env_vars
|
||||||
|
|
||||||
|
@ -117,6 +117,22 @@ cdsudo() {
|
|||||||
sudo --preserve-env=GOPATH --non-interactive bash -c "$CMD"
|
sudo --preserve-env=GOPATH --non-interactive bash -c "$CMD"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Skip a build if $1 does not match in the PR Title/Description with message $2
|
||||||
|
require_regex() {
|
||||||
|
req_env_var "
|
||||||
|
CIRRUS_CHANGE_MESSAGE $CIRRUS_CHANGE_MESSAGE
|
||||||
|
1 $1
|
||||||
|
2 $2
|
||||||
|
"
|
||||||
|
regex="$1"
|
||||||
|
msg="$2"
|
||||||
|
if ! echo "$CIRRUS_CHANGE_MESSAGE" | egrep -q "$regex"
|
||||||
|
then
|
||||||
|
echo "***** The PR Title/Description did not match the regular expression: $MAGIC_RE"
|
||||||
|
echo "***** $msg"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Helper/wrapper script to only show stderr/stdout on non-zero exit
|
# Helper/wrapper script to only show stderr/stdout on non-zero exit
|
||||||
install_ooe() {
|
install_ooe() {
|
||||||
@ -142,8 +158,8 @@ EOF
|
|||||||
install_cni_plugins() {
|
install_cni_plugins() {
|
||||||
echo "Installing CNI Plugins from commit $CNI_COMMIT"
|
echo "Installing CNI Plugins from commit $CNI_COMMIT"
|
||||||
req_env_var "
|
req_env_var "
|
||||||
GOPATH $GOPATH
|
GOPATH $GOPATH
|
||||||
CNI_COMMIT $CNI_COMMIT
|
CNI_COMMIT $CNI_COMMIT
|
||||||
"
|
"
|
||||||
DEST="$GOPATH/src/github.com/containernetworking/plugins"
|
DEST="$GOPATH/src/github.com/containernetworking/plugins"
|
||||||
rm -rf "$DEST"
|
rm -rf "$DEST"
|
||||||
@ -160,9 +176,9 @@ install_runc(){
|
|||||||
echo "Installing RunC from commit $RUNC_COMMIT"
|
echo "Installing RunC from commit $RUNC_COMMIT"
|
||||||
echo "Platform is $OS_RELEASE_ID"
|
echo "Platform is $OS_RELEASE_ID"
|
||||||
req_env_var "
|
req_env_var "
|
||||||
GOPATH $GOPATH
|
GOPATH $GOPATH
|
||||||
RUNC_COMMIT $RUNC_COMMIT
|
RUNC_COMMIT $RUNC_COMMIT
|
||||||
OS_RELEASE_ID $OS_RELEASE_ID
|
OS_RELEASE_ID $OS_RELEASE_ID
|
||||||
"
|
"
|
||||||
if [[ "$OS_RELEASE_ID" =~ "ubuntu" ]]; then
|
if [[ "$OS_RELEASE_ID" =~ "ubuntu" ]]; then
|
||||||
echo "Running make install.libseccomp.sudo for ubuntu"
|
echo "Running make install.libseccomp.sudo for ubuntu"
|
||||||
@ -202,8 +218,8 @@ install_buildah() {
|
|||||||
install_conmon(){
|
install_conmon(){
|
||||||
echo "Installing conmon from commit $CRIO_COMMIT"
|
echo "Installing conmon from commit $CRIO_COMMIT"
|
||||||
req_env_var "
|
req_env_var "
|
||||||
GOPATH $GOPATH
|
GOPATH $GOPATH
|
||||||
CRIO_COMMIT $CRIO_COMMIT
|
CRIO_COMMIT $CRIO_COMMIT
|
||||||
"
|
"
|
||||||
DEST="$GOPATH/src/github.com/kubernetes-sigs/cri-o.git"
|
DEST="$GOPATH/src/github.com/kubernetes-sigs/cri-o.git"
|
||||||
rm -rf "$DEST"
|
rm -rf "$DEST"
|
||||||
@ -234,8 +250,8 @@ install_criu(){
|
|||||||
install_testing_dependencies() {
|
install_testing_dependencies() {
|
||||||
echo "Installing ginkgo, gomega, and easyjson into \$GOPATH=$GOPATH"
|
echo "Installing ginkgo, gomega, and easyjson into \$GOPATH=$GOPATH"
|
||||||
req_env_var "
|
req_env_var "
|
||||||
GOPATH $GOPATH
|
GOPATH $GOPATH
|
||||||
GOSRC $GOSRC
|
GOSRC $GOSRC
|
||||||
"
|
"
|
||||||
cd "$GOSRC"
|
cd "$GOSRC"
|
||||||
ooe.sh go get -u github.com/onsi/ginkgo/ginkgo
|
ooe.sh go get -u github.com/onsi/ginkgo/ginkgo
|
||||||
|
Reference in New Issue
Block a user