diff options
author | Trevor Bramwell <tbramwell@linuxfoundation.org> | 2018-03-22 19:56:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-03-22 19:56:33 +0000 |
commit | bd72451d3b714b95789f6128f9d0cf7d82514fa6 (patch) | |
tree | 432e328f163db4cd32bd7c53edcc8ba75729f751 /jjb/releng/releng-release-create-branch.sh | |
parent | 14b5f30468a96c5e400d2139caac7c52a1542b26 (diff) | |
parent | 4260e9d3c2c9f1ed9a0d550abc032d93e89cf55c (diff) |
Merge "Release Automation"
Diffstat (limited to 'jjb/releng/releng-release-create-branch.sh')
-rw-r--r-- | jjb/releng/releng-release-create-branch.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/jjb/releng/releng-release-create-branch.sh b/jjb/releng/releng-release-create-branch.sh new file mode 100644 index 000000000..ec8365340 --- /dev/null +++ b/jjb/releng/releng-release-create-branch.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# SPDX-License-Identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 The Linux Foundation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +set -xe + +# Configure the git user/email as we'll be pushing up changes +git config user.name "jenkins-ci" +git config user.email "jenkins-opnfv-ci@opnfv.org" + +# Ensure we are able to generate Commit-IDs for new patchsets +curl -kLo .git/hooks/commit-msg https://gerrit.opnfv.org/gerrit/tools/hooks/commit-msg +chmod +x .git/hooks/commit-msg + +# Activate virtualenv, supressing shellcheck warning +# shellcheck source=/dev/null +. $WORKSPACE/venv/bin/activate +pip install -r releases/scripts/requirements.txt + +STREAM=${STREAM:-'nostream'} +RELEASE_FILES=$(git diff HEAD^1 --name-only -- "releases/$STREAM") + +for release_file in $RELEASE_FILES; do + python releases/scripts/create_branch.py -f $release_file + python releases/scripts/create_jobs.py -f $release_file + NEW_FILES=$(git status --porcelain --untracked=no | cut -c4-) + if [ -n "$NEW_FILES" ]; then + git add $NEW_FILES + git commit -m "Create Stable Branch Jobs for $(basename $release_file .yaml)" + git push origin HEAD:refs/for/master + fi +done |