Merge pull request #5479 from cevich/auto_release

Cirrus: Disable non-docs release processing
This commit is contained in:
OpenShift Merge Robot 2020-03-23 14:36:30 +01:00 committed by GitHub
commit b743f60a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 39 deletions

View File

@ -420,9 +420,6 @@ testing_task:
integration_test_script: '$SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP} | ${LOGFORMAT} integration_test' integration_test_script: '$SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP} | ${LOGFORMAT} integration_test'
system_test_script: '$SCRIPT_BASE/system_test.sh |& ${TIMESTAMP} | ${LOGFORMAT} system_test' system_test_script: '$SCRIPT_BASE/system_test.sh |& ${TIMESTAMP} | ${LOGFORMAT} system_test'
apiv2_test_script: '$SCRIPT_BASE/apiv2_test.sh |& ${TIMESTAMP} | ${LOGFORMAT} apiv2_test' apiv2_test_script: '$SCRIPT_BASE/apiv2_test.sh |& ${TIMESTAMP} | ${LOGFORMAT} apiv2_test'
build_release_script: '$SCRIPT_BASE/build_release.sh |& ${TIMESTAMP}'
# For PRs this confirms uploading releases after merge, is functional.
upload_release_archive_script: '$SCRIPT_BASE/upload_release_archive.sh |& ${TIMESTAMP}'
# When examining a particular run, provide convenient access to release files. # When examining a particular run, provide convenient access to release files.
tar_artifacts: tar_artifacts:
@ -552,7 +549,6 @@ special_testing_cross_task:
networking_script: '${CIRRUS_WORKING_DIR}/${SCRIPT_BASE}/networking.sh' networking_script: '${CIRRUS_WORKING_DIR}/${SCRIPT_BASE}/networking.sh'
setup_environment_script: '$SCRIPT_BASE/setup_environment.sh |& ${TIMESTAMP}' setup_environment_script: '$SCRIPT_BASE/setup_environment.sh |& ${TIMESTAMP}'
build_release_script: '$SCRIPT_BASE/build_release.sh |& ${TIMESTAMP}' build_release_script: '$SCRIPT_BASE/build_release.sh |& ${TIMESTAMP}'
upload_release_archive_script: '$SCRIPT_BASE/upload_release_archive.sh |& ${TIMESTAMP}'
on_failure: on_failure:
failed_branch_script: '$CIRRUS_WORKING_DIR/$SCRIPT_BASE/notice_branch_failure.sh' failed_branch_script: '$CIRRUS_WORKING_DIR/$SCRIPT_BASE/notice_branch_failure.sh'
@ -697,7 +693,6 @@ verify_test_built_images_task:
# "probably" work. A full round of testing will happen again after $*_CACHE_IMAGE_NAME # "probably" work. A full round of testing will happen again after $*_CACHE_IMAGE_NAME
# are updated in this or another PR (w/o '***CIRRUS: TEST IMAGES***'). # are updated in this or another PR (w/o '***CIRRUS: TEST IMAGES***').
integration_test_script: '$SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP}' integration_test_script: '$SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP}'
build_release_script: '$SCRIPT_BASE/build_release.sh |& ${TIMESTAMP}'
system_test_script: '$SCRIPT_BASE/system_test.sh |& ${TIMESTAMP}' system_test_script: '$SCRIPT_BASE/system_test.sh |& ${TIMESTAMP}'
always: always:

View File

@ -19,36 +19,19 @@ then
BUCKET="libpod-pr-releases" BUCKET="libpod-pr-releases"
elif [[ -n "$CIRRUS_BRANCH" ]] elif [[ -n "$CIRRUS_BRANCH" ]]
then then
# Only release binaries for tagged commit ranges, unless working on docs # Only release binaries for docs
if is_release || [[ $CIRRUS_TASK_NAME =~ "docs" ]] if [[ $CIRRUS_TASK_NAME =~ "docs" ]]
then then
PR_OR_BRANCH="$CIRRUS_BRANCH" PR_OR_BRANCH="$CIRRUS_BRANCH"
BUCKET="libpod-$CIRRUS_BRANCH-releases" BUCKET="libpod-$CIRRUS_BRANCH-releases"
else else
warn "" "Skipping release processing: Commit range|CIRRUS_TAG is development tagged." warn "" "Skipping release processing for non-docs task."
exit 0 exit 0
fi fi
else else
die 1 "Expecting either \$CIRRUS_PR or \$CIRRUS_BRANCH to be non-empty." die 1 "Expecting either \$CIRRUS_PR or \$CIRRUS_BRANCH to be non-empty."
fi fi
echo "Parsing actual_release.txt contents: $(< actual_release.txt)"
cd $GOSRC
RELEASETXT=$(<actual_release.txt) # see build_release.sh
[[ -n "$RELEASETXT" ]] || \
die 3 "Could not obtain metadata from actual_release.txt"
RELEASE_INFO=$(echo "$RELEASETXT" | grep -m 1 'X-RELEASE-INFO:' | sed -r -e 's/X-RELEASE-INFO:\s*(.+)/\1/')
if [[ "$?" -ne "0" ]] || [[ -z "$RELEASE_INFO" ]]
then
die 4 "Metadata is empty or invalid: '$RELEASETXT'"
fi
# Format specified in Makefile
# e.g. libpod v1.3.1-166-g60df124e fedora 29 amd64
# or libpod-remote v1.3.1-166-g60df124e windows - amd64
FIELDS="RELEASE_BASENAME RELEASE_VERSION RELEASE_DIST RELEASE_DIST_VER RELEASE_ARCH"
read $FIELDS <<< $RELEASE_INFO
req_env_var $FIELDS
# Functional local podman required for uploading # Functional local podman required for uploading
echo "Verifying a local, functional podman, building one if necessary." echo "Verifying a local, functional podman, building one if necessary."
[[ -n "$(type -P podman)" ]] || \ [[ -n "$(type -P podman)" ]] || \
@ -64,7 +47,7 @@ echo "$RELEASE_GCPJSON" > "$TMPF"
unset RELEASE_GCPJSON unset RELEASE_GCPJSON
cd $GOSRC cd $GOSRC
for filename in $(ls -1 *.tar.gz *.zip *.msi $SWAGGER_FILEPATH) for filename in $(ls -1 $SWAGGER_FILEPATH)
do do
unset EXT unset EXT
EXT=$(echo "$filename" | sed -r -e 's/.+\.(.+$)/\1/g') EXT=$(echo "$filename" | sed -r -e 's/.+\.(.+$)/\1/g')
@ -85,19 +68,7 @@ do
# For doc. ref. this must always be a static filename, e.g. swagger-latest-master.yaml # For doc. ref. this must always be a static filename, e.g. swagger-latest-master.yaml
ALSO_FILENAME="swagger-latest-${PR_OR_BRANCH}.yaml" ALSO_FILENAME="swagger-latest-${PR_OR_BRANCH}.yaml"
else else
# Form the generic "latest" file for this branch or pr die "Uploading non-docs files has been disabled"
TO_PREFIX="${RELEASE_BASENAME}-latest-${PR_OR_BRANCH}-${RELEASE_DIST}"
# Form the fully-versioned filename for historical sake
ALSO_PREFIX="${RELEASE_BASENAME}-${RELEASE_VERSION}-${PR_OR_BRANCH}-${RELEASE_DIST}"
TO_SUFFIX="${RELEASE_ARCH}.${EXT}"
if [[ "$RELEASE_DIST" == "windows" ]] || [[ "$RELEASE_DIST" == "darwin" ]]
then
TO_FILENAME="${TO_PREFIX}-${TO_SUFFIX}"
ALSO_FILENAME="${ALSO_PREFIX}-${TO_SUFFIX}"
else
TO_FILENAME="${TO_PREFIX}-${RELEASE_DIST_VER}-${TO_SUFFIX}"
ALSO_FILENAME="${ALSO_PREFIX}-${TO_SUFFIX}"
fi
fi fi
[[ "$OS_RELEASE_ID" == "ubuntu" ]] || \ [[ "$OS_RELEASE_ID" == "ubuntu" ]] || \