openstack-zuul-jobs/playbooks/legacy/groups-release-branch/run.yaml

90 lines
3.3 KiB
YAML

- hosts: all
name: Autoconverted job legacy-groups-release-branch from old job groups-release-branch
roles:
- bindep
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
function cleanup {
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelihood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
https://opendev.org $ZUUL_PROJECT
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -x
sudo rm -f /etc/sudoers.d/zuul
# Prove that general sudo access is actually revoked
! sudo -n true
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
/usr/local/jenkins/slave_scripts/version-properties.sh
source version.properties
# fetch drush
mkdir drush
curl -L https://github.com/drush-ops/drush/archive/6.0.0.tar.gz | tar -xz -C drush --strip 1
# build distribution
export PATH=./drush:$PATH
scripts/dev-build.sh
# Clean/create a tarball directory
rm -rf tarballs
mkdir -p tarballs
# Create an archive tarball.
tar -czf groups-$PROJECT_VER.tar.gz publish/
cp groups-$PROJECT_VER.tar.gz tarballs/groups-latest.tar.gz
mv groups-$PROJECT_VER.tar.gz tarballs/
# generate md5 checksums
cd tarballs
md5sum groups-$PROJECT_VER.tar.gz > groups-$PROJECT_VER.md5
sed s/$PROJECT_VER/latest/g groups-$PROJECT_VER.md5 > groups-latest.md5
cd ..
# build manifest file
if [[ "$COMMITS_SINCE_TAG" == "" ]]; then
VERSION=7.x-$PROJECT_VER
else
VERSION=7.x-0.x-dev
fi
MD5HASH=$(cat tarballs/groups-$PROJECT_VER.md5 | cut -d ' ' -f1)
OUTFILE=drupal-updates/release-history/groups/7.x
MANIFESTURL=http://tarballs.openstack.org/groups/drupal-updates/release-history/groups/7.x
mkdir -p drupal-updates/release-history/groups
scripts/release-manifest.php --version=$VERSION --releasetar=groups-$PROJECT_VER.tar.gz --md5=$MD5HASH --outfile=$OUTFILE --manifest-url=$MANIFESTURL --verbose --debug
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'