This template supports Maven and Container release jobs.
+This template uses a git commit choosing strategy that builds the merged
+commit with the release yaml file, not the tip of the target branch, so
+projects can repeat the release action in case of merge job failure.
+
:Template Name: {project-name}-release-merge
:Comment Trigger: remerge
signs the tag and pushes the tag to the git server. The release merge
template accepts neither a branch nor a stream parameter.
+These templates use a git commit choosing strategy that builds the merged
+commit with the release yaml file, not the tip of the target branch, so
+projects can repeat the release action in case of merge job failure.
+
:Template Names:
- {project-name}-pypi-release-merge
PackageCloud Release Verify
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-This template supports PackageCloud release jobs.
+This template supports PackageCloud release jobs. Checks that the specified
+packages are present in the staging repository and absent from the release
+repository.
:Template Name: {project-name}-packagecloud-release-verify
PackageCloud Release Merge
~~~~~~~~~~~~~~~~~~~~~~~~~~
-This template supports PackageCloud release jobs.
+This template supports PackageCloud release jobs. Promotes the specified
+packages from the staging repository to the release repository.
+
+This template uses a git commit choosing strategy that builds the merged
+commit with the release yaml file, not the tip of the target branch, so
+projects can repeat the release action in case of merge job failure.
:template name: {project-name}-packagecloud-release-merge
submodule-recursive: "{submodule-recursive}"
submodule-timeout: "{submodule-timeout}"
submodule-disable: "{submodule-disable}"
- choosing-strategy: gerrit
+ # merge jobs always build from tip
+ choosing-strategy: default
triggers:
- gerrit:
submodule-recursive: "{submodule-recursive}"
submodule-timeout: "{submodule-timeout}"
submodule-disable: "{submodule-disable}"
- choosing-strategy: gerrit
+ # merge jobs always build from tip
+ choosing-strategy: default
triggers:
- timed: "{obj:cron}"
submodule-disable: true
submodule-recursive: false
submodule-timeout: 10
+ # release merge jobs build from commit not tip
choosing-strategy: gerrit
triggers:
submodule-recursive: "{submodule-recursive}"
submodule-timeout: "{submodule-timeout}"
submodule-disable: "{submodule-disable}"
+ # release merge jobs build from commit not tip
choosing-strategy: gerrit
triggers:
submodule-disable: true
submodule-recursive: false
submodule-timeout: 10
+ # release merge jobs build from commit not tip
choosing-strategy: gerrit
triggers:
--- /dev/null
+---
+fixes:
+ - |
+ Branch discovery and build polling implemented.
+ If a Branch has not been seen by rtd
+ we trigger a build with rtd and poll till that build
+ is complete.
+ we can then enable the branch and trigger a build
+ against it, again polling all builds untill they are
+ complete.
--- /dev/null
+---
+fixes:
+ - |
+ Use git choosing strategy default in tox and pypi merge jobs for
+ gerrit. This makes those jobs consistent with maven and other
+ merge jobs for gerrit that always build from tip of the target
+ branch to create artifacts from the latest & greatest code.
+ Building from tip (not from Gerrit commit/merge point) avoids
+ confusion about content when changes are merged out of order.
+ For example, a fix is submitted and merged, but the merge job
+ fails. In the mean time, a different change that happened
+ earlier in commit history gets merged (or the merge job is
+ retriggered), causing a new artifact to be pushed. But that
+ artifact does not have the expected fix.
+
+ Add comments to release merge jobs why their choosing strategy
+ is not default.
+
+ Document the git commit choosing strategy for the release merge jobs.
kpn_default="$(get_cfg "$(dirname "$cfg_file")/cloud.cfg" KEY_PAIR_NAME "jenkins-ssh")"
key_pair_name=$(get_cfg "$cfg_file" KEY_PAIR_NAME "$kpn_default")
num_executors=$(get_cfg "$cfg_file" NUM_EXECUTORS "1")
- jvm_options=$(get_cfg "$cfg_file" JVM_OPTIONS "null")
+ jvm_options=$(get_cfg "$cfg_file" JVM_OPTIONS "")
fs_root=$(get_cfg "$cfg_file" FS_ROOT "/w")
connection_type=$(get_cfg "$cfg_file" CONNECTION_TYPE "SSH")
launcher_factory=$(get_launcher_factory "$connection_type")
echo "---> rtdv3.sh"
set -euo pipefail
+watchbuild(){
+ echo "INFO: Running build against branch $1"
+ local buildid
+ local result
+ buildid=$(lftools rtd project-build-trigger "$rtdproject" "$1" | jq '.build.id')
+
+ result=null
+ while [ $result == null ]; do
+ sleep 10
+ result=$(lftools rtd project-build-details "$rtdproject" "$buildid" | jq '.success')
+ echo "INFO Current result of running build $result"
+ if [[ $result == failed ]]; then
+ echo "INFO: read the docs build completed with status: $result"
+ exit 1
+ fi
+ done
+ echo "INFO: read the docs build completed with status: $result"
+}
+
project_dashed="${PROJECT////-}"
umbrella=$(echo "$GERRIT_URL" | awk -F'.' '{print $2}')
if [[ "$SILO" == "sandbox" ]]; then
lftools rtd project-update "$rtdproject" default_version="$default_version"
fi
- lftools rtd project-build-trigger "$rtdproject" "$GERRIT_BRANCH"
if [[ $GERRIT_BRANCH == "master" ]]; then
- echo "INFO: triggering latest"
- lftools rtd project-build-trigger "$rtdproject" latest
+ echo "INFO: triggering $rtdproject latest"
+ watchbuild latest
else
- echo "INFO: triggering stable"
- lftools rtd project-build-trigger "$rtdproject" stable
+
+ #read the docs only understands lower case branch names
+ branch=$(echo "$GERRIT_BRANCH" | tr '[:upper:]' '[:lower:]')
+ echo "INFO: Checking if read the docs has seen branch $branch"
+
+ #if this is 404. then run discover branch
+ if ! lftools rtd project-version-details "$rtdproject" "$branch" | jq '.active'; then
+ echo "INFO: read the docs has not seen branch $branch for project $rtdproject"
+ echo "INFO: triggering $rtdproject latest to instantiate new branch discovery"
+ watchbuild latest
+ fi
+
+ echo "INFO: triggering $rtdproject $branch"
+ watchbuild "$branch"
+
+ #Make newly discovered branches visible in the u/i
+ isactive=$(lftools rtd project-version-details "$rtdproject" "$branch" | jq '.active')
+ if [[ "$isactive" == false ]]; then
+ echo "INFO: Marking $branch as active for project $rtdproject"
+ lftools rtd project-version-update "$rtdproject" "$branch" true
+ fi
+
fi
fi