- job: name: tcwg-gcc-release-automation project-type: freestyle defaults: global properties: - authorization: anonymous: - job-read - job-extended-read linaro: - job-build - job-cancel - build-discarder: days-to-keep: 10 num-to-keep: 10 parameters: - choice: name: tag_kind choices: - snapshot - candidate - release description: 'Type of release to do.' - string: name: spin default: '' description: 'Spin number' - string: name: rc_num default: '' description: 'Release candidate number (empty for RC1, 2 for RC2, ...)' - string: name: gcc_ref default: '' description: 'GCC tag or branch name (like linaro-6.3-2017.03, origin/linaro/gcc-6-branch)' - string: name: date default: '' description: 'snapshot or release date (yyyy.mm)' - string: name: abe_branch default: tested description: 'ABE branch to use.' - string: name: scripts_branch default: tested description: 'jenkins-scripts branch to use.' disabled: false node: tcwg-x86_64-dev-01 concurrent: true display-name: 'TCWG GCC Release Automation' scm: - git: url: https://git.linaro.org/toolchain/gcc.git refspec: +refs/heads/*:refs/remotes/origin/* branches: - refs/heads/master basedir: gcc_src per-build-tag: false wipe-workspace: true reference-repo: /home/tcwg-buildslave/snapshots-ref/gcc.git - git: url: https://git.linaro.org/toolchain/tcwg-release-tools refspec: +refs/heads/*:refs/remotes/origin/* branches: - refs/heads/automation basedir: tcwg-release-tools per-build-tag: false wipe-workspace: true execution-strategy: sequential: true wrappers: - timeout: timeout: 1800 - timestamps - ssh-agent-credentials: # tcwg-buildslave user id users: - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a' - build-name: name: '#${BUILD_NUMBER}-${ENV,var="tag"}' builders: - shell: | #!/bin/bash set -ex pushd gcc_src # Git/Gerrit config git config --local user.name "TCWG Automation" git config --local user.email linaro-toolchain@lists.linaro.org if git remote | grep -q gerrit; then git remote rm gerrit fi git remote add gerrit ssh://tcwg-buildslave@review.linaro.org:29418/toolchain/gcc git remote update FLAGS="-t $gcc_ref -e gerrit" [ "${date:+set}" = "set" ] && FLAGS+=" -d $date" case "$tag_kind" in snapshot) FLAGS+=" -S" ; dir_suffix="-snap";; candidate) FLAGS+=" -r $rc_num" ; touch ${WORKSPACE}/trig-bin ;; release) FLAGS+=" -R" ; touch ${WORKSPACE}/trig-bin ;; *) echo "ERROR: tag_king is missing"; exit 1 ;; esac [ "${spin:+set}" = "set" ] && FLAGS+=" $spin" ${WORKSPACE}/tcwg-release-tools/tcwg-release-tag.sh $FLAGS # Pick up the created tag. tag=$(git describe --abbrev=0) case ${tag} in *-4\.*) toolchainconf="gcc4_9" ;; *-5\.*) toolchainconf="gcc5" ;; *-6\.*) toolchainconf="gcc6" ;; *-7\.*) toolchainconf="gcc7" ;; *) echo "ERROR: Bad tag: ${tag}"; exit 1 ;; esac # Remove linaro-[snapshot-] prefix upload_dir=${tag#*ro-} upload_dir="/home/tcwg-buildslave/releases/sources/${upload_dir#*ot-}$dir_suffix" popd 1>/dev/null cat << EOF > ${WORKSPACE}/buildfarm_parameters override=gcc=gcc.git~$tag --extraconfigdir ../config/$toolchainconf log_name=${JOB_NAME}-${tag}-${BUILD_NUMBER}/@@host@@.\$target abe_branch=$abe_branch scripts_branch=$scripts_branch EOF cat << EOF > ${WORKSPACE}/env.properties tag=$tag toolchainconf=$toolchainconf upload_dir=$upload_dir EOF - trigger-builds: - project: tcwg-buildfarm property-file: buildfarm_parameters block: true - inject: properties-file: ${WORKSPACE}/env.properties - shell: | #!/bin/bash set -ex pushd /home/tcwg-buildslave/logs/${JOB_NAME}-${tag}-${BUILD_NUMBER} mkdir -p $upload_dir for i in * ; do cp ${i}/gcc-linaro-*-manifest.txt ${upload_dir}/${i}-gcc-${tag}-manifest.txt done popd 1>/dev/null - trigger-builds: - project: tcwg-make-source-tarball property-file: ${WORKSPACE}/env.properties block: true - conditional-step: condition-kind: file-exists condition-filename: ${WORKSPACE}/trig-bin steps: - trigger-builds: - project: tcwg-make-and-test-release property-file: ${WORKSPACE}/env.properties predefined-parameters: | gcc_src=gcc.git~$tag toolchain_config=$toolchainconf abe_branch=$abe_branch block: true publishers: - email-ext: recipients: 'yvan.roux@linaro.org' aborted: true - workspace-cleanup: clean-if: - success: true - unstable: false - failure: false - aborted: false - not-built: false