Convert remaining jobs to Zuul v3 native
Stop using transitional Zuul v2 compatibility shims and switch to native Zuul v3 variables and paradigms. Change-Id: I70ef35e349b0257a4e032ac2af40cb7f4a37c351
This commit is contained in:
parent
88c5d8511c
commit
948ad9297a
|
@ -6,17 +6,17 @@
|
|||
timeout: 1800
|
||||
|
||||
- job:
|
||||
# This is included into the osf/openstackid release pipeline from the
|
||||
# openstack/project-config .zuul.d/projects.yaml
|
||||
name: openstackid-release-master
|
||||
parent: legacy-publish-openstack-artifacts
|
||||
parent: publish-openstack-artifacts
|
||||
run: playbooks/openstackid-release-master/run.yaml
|
||||
post-run: playbooks/openstackid-release-master/post.yaml
|
||||
timeout: 1800
|
||||
|
||||
- job:
|
||||
name: openstackid-unittests
|
||||
parent: legacy-base
|
||||
run: playbooks/openstackid-unittests/run.yaml
|
||||
post-run: playbooks/openstackid-unittests/post.yaml
|
||||
timeout: 1800
|
||||
|
||||
- project:
|
||||
|
@ -34,9 +34,6 @@
|
|||
post:
|
||||
jobs:
|
||||
- openstackid-release-branch
|
||||
release:
|
||||
jobs:
|
||||
- openstackid-release-branch
|
||||
promote:
|
||||
jobs:
|
||||
- promote-tox-docs-infra
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
- hosts: all
|
||||
name: Autoconverted job legacy-openstackid-release-branch from old job openstackid-release-branch
|
||||
name: Branch tarball job for OpenStackID
|
||||
|
||||
tasks:
|
||||
|
||||
- include_role:
|
||||
name: setup-test-laravel-env
|
||||
chdir: '{{ zuul.project.src_dir }}'
|
||||
|
||||
- include_role:
|
||||
name: bindep
|
||||
|
||||
- include_role:
|
||||
name: revoke-sudo
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
set -e
|
||||
|
@ -43,7 +45,7 @@
|
|||
rm -rf tarballs
|
||||
mkdir -p tarballs
|
||||
# Create an archive tarball.
|
||||
tar -czf $ZUUL_SHORT_PROJECT_NAME-$PROJECT_VER.tar.gz dist/
|
||||
tar -czf {{ zuul.project.short_name }}-$PROJECT_VER.tar.gz dist/
|
||||
cp {{ zuul.project.short_name }}-$PROJECT_VER.tar.gz \
|
||||
tarballs/{{ zuul.project.short_name }}-latest.tar.gz
|
||||
mv {{ zuul.project.short_name }}-$PROJECT_VER.tar.gz tarballs/
|
||||
|
|
|
@ -1,41 +1,15 @@
|
|||
- hosts: primary
|
||||
tasks:
|
||||
|
||||
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
|
||||
synchronize:
|
||||
src: '{{ ansible_user_dir }}/workspace/'
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
copy_links: true
|
||||
verify_host: true
|
||||
rsync_opts:
|
||||
- --include=/cover/**
|
||||
- --include=*/
|
||||
- --exclude=*
|
||||
- --prune-empty-dirs
|
||||
|
||||
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
|
||||
synchronize:
|
||||
src: '{{ ansible_user_dir }}/workspace/'
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
copy_links: true
|
||||
verify_host: true
|
||||
rsync_opts:
|
||||
- --include=/./reports/**
|
||||
- --include=*/
|
||||
- --exclude=*
|
||||
- --prune-empty-dirs
|
||||
|
||||
- name: Ensure artifact transit directory exists
|
||||
file:
|
||||
path: '{{ zuul.executor.work_root }}/artifacts'
|
||||
state: directory
|
||||
delegate_to: localhost
|
||||
|
||||
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
|
||||
- name: Copy files from {{ zuul.project.src_dir }}/tarballs/ on node
|
||||
synchronize:
|
||||
src: '{{ ansible_user_dir }}/workspace/tarballs/'
|
||||
src: '{{ zuul.project.src_dir }}/tarballs/'
|
||||
dest: '{{ zuul.executor.work_root }}/artifacts/'
|
||||
mode: pull
|
||||
verify_host: true
|
||||
|
|
|
@ -1,74 +1,42 @@
|
|||
- hosts: all
|
||||
name: Autoconverted job legacy-openstackid-release-master from old job openstackid-release-master
|
||||
name: Tag tarball job for OpenStackID
|
||||
|
||||
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 }}'
|
||||
|
||||
- include_role:
|
||||
name: setup-test-laravel-env
|
||||
|
||||
- include_role:
|
||||
name: bindep
|
||||
|
||||
- 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 }}'
|
||||
- include_role:
|
||||
name: revoke-sudo
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
set -e
|
||||
set -x
|
||||
/usr/local/jenkins/slave_scripts/version-properties.sh
|
||||
executable: /bin/bash
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
set -e
|
||||
set -x
|
||||
source version.properties
|
||||
curl -s https://getcomposer.org/installer | /usr/bin/php
|
||||
/usr/bin/php composer.phar install --prefer-dist --ignore-platform-reqs
|
||||
/usr/bin/php composer.phar install --prefer-dist \
|
||||
--ignore-platform-reqs
|
||||
|
||||
# copied from https://opendev.org/openstack/openstack-zuul-jobs/
|
||||
# src/branch/master/roles/legacy-copy-jenkins-scripts/files/
|
||||
# version-properties.sh
|
||||
# but there is probably a better solution for this
|
||||
SCM_TAG=$(git describe --abbrev=0 --tags) || true
|
||||
SCM_SHA=$(git rev-parse --short HEAD) || true
|
||||
COMMITS_SINCE_TAG=$(git describe \
|
||||
| awk '{split($0,a,"-"); print a[2]}') || true
|
||||
if [[ "${SCM_TAG}" == "" ]]; then
|
||||
SCM_TAG=$SCM_SHA
|
||||
fi
|
||||
if [[ "${COMMITS_SINCE_TAG}" == "" ]]; then
|
||||
PROJECT_VER=$SCM_TAG
|
||||
else
|
||||
PROJECT_VER="$SCM_TAG.$COMMITS_SINCE_TAG.$SCM_SHA"
|
||||
fi
|
||||
|
||||
# Clone to dist
|
||||
rm -rf dist
|
||||
mkdir dist
|
||||
|
@ -77,9 +45,9 @@
|
|||
rm -rf tarballs
|
||||
mkdir -p tarballs
|
||||
# Create an archive tarball.
|
||||
tar -czf $ZUUL_SHORT_PROJECT_NAME-$PROJECT_VER.tar.gz dist/
|
||||
cp $ZUUL_SHORT_PROJECT_NAME-$PROJECT_VER.tar.gz tarballs/$ZUUL_SHORT_PROJECT_NAME-latest.tar.gz
|
||||
mv $ZUUL_SHORT_PROJECT_NAME-$PROJECT_VER.tar.gz tarballs/
|
||||
tar -czf {{ zuul.project.short_name }}-$PROJECT_VER.tar.gz dist/
|
||||
cp {{ zuul.project.short_name }}-$PROJECT_VER.tar.gz \
|
||||
tarballs/{{ zuul.project.short_name }}-latest.tar.gz
|
||||
mv {{ zuul.project.short_name }}-$PROJECT_VER.tar.gz tarballs/
|
||||
executable: /bin/bash
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
chdir: '{{ zuul.project.src_dir }}'
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
- hosts: primary
|
||||
tasks:
|
||||
|
||||
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
|
||||
synchronize:
|
||||
src: '{{ ansible_user_dir }}/workspace/'
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
copy_links: true
|
||||
verify_host: true
|
||||
rsync_opts:
|
||||
- --include=/cover/**
|
||||
- --include=*/
|
||||
- --exclude=*
|
||||
- --prune-empty-dirs
|
||||
|
||||
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
|
||||
synchronize:
|
||||
src: '{{ ansible_user_dir }}/workspace/'
|
||||
dest: '{{ zuul.executor.log_root }}'
|
||||
mode: pull
|
||||
copy_links: true
|
||||
verify_host: true
|
||||
rsync_opts:
|
||||
- --include=/./reports/**
|
||||
- --include=*/
|
||||
- --exclude=*
|
||||
- --prune-empty-dirs
|
|
@ -1,57 +1,16 @@
|
|||
- hosts: all
|
||||
name: Autoconverted job legacy-openstackid-unittests from old job gate-openstackid-unittests
|
||||
name: Laravel unit test job for OpenStackID
|
||||
|
||||
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 }}'
|
||||
|
||||
- include_role:
|
||||
name: setup-test-laravel-env
|
||||
|
||||
- include_role:
|
||||
name: bindep
|
||||
|
||||
- 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 }}'
|
||||
- include_role:
|
||||
name: revoke-sudo
|
||||
|
||||
- shell:
|
||||
cmd: |
|
||||
|
@ -59,12 +18,11 @@
|
|||
set -x
|
||||
curl -s https://getcomposer.org/installer | /usr/bin/php
|
||||
/usr/bin/php composer.phar install --prefer-dist --ignore-platform-reqs
|
||||
/usr/bin/php artisan doctrine:clear:metadata:cache;
|
||||
/usr/bin/php artisan doctrine:clear:query:cache;
|
||||
/usr/bin/php artisan doctrine:clear:result:cache;
|
||||
/usr/bin/php artisan doctrine:generate:proxies;
|
||||
/usr/bin/php artisan view:clear;
|
||||
/usr/bin/php artisan view:cache;
|
||||
/usr/bin/php artisan doctrine:clear:metadata:cache
|
||||
/usr/bin/php artisan doctrine:clear:query:cache
|
||||
/usr/bin/php artisan doctrine:clear:result:cache
|
||||
/usr/bin/php artisan doctrine:generate:proxies
|
||||
/usr/bin/php artisan view:clear
|
||||
/usr/bin/php artisan view:cache
|
||||
./vendor/bin/phpunit
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
chdir: '{{ zuul.project.src_dir }}'
|
||||
|
|
|
@ -56,6 +56,5 @@
|
|||
SERVER_NAME={{ server_name }}
|
||||
EOF
|
||||
executable: /bin/bash
|
||||
chdir: '{{ ansible_user_dir }}/workspace'
|
||||
environment: '{{ zuul | zuul_legacy_vars }}'
|
||||
become: yes
|
||||
chdir: '{{ zuul.project.src_dir }}'
|
||||
become: yes
|
||||
|
|
Loading…
Reference in New Issue