From 7b8326a74e2ec8f17b8290a7b5d46ef9501921f5 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Thu, 12 Oct 2017 21:52:31 +0200 Subject: [PATCH] convert deploy-guide to native zuul v3 Convert deploy-guide jobs to native zuul v3. Change-Id: I10527dab4de67b68c614fdb3615a691e952ef7d3 Depends-On: I2519419d1f7a34787adc09e554156a78f50bf96f --- playbooks/deploy-guide/post.yaml | 5 + playbooks/legacy/deploy-guide/post.yaml | 10 -- playbooks/legacy/deploy-guide/run.yaml | 129 ---------------------- zuul.d/jobs.yaml | 16 +++ zuul.d/project-templates.yaml | 12 ++ zuul.d/zuul-legacy-jobs.yaml | 13 --- zuul.d/zuul-legacy-project-templates.yaml | 22 ---- 7 files changed, 33 insertions(+), 174 deletions(-) create mode 100644 playbooks/deploy-guide/post.yaml delete mode 100644 playbooks/legacy/deploy-guide/post.yaml delete mode 100644 playbooks/legacy/deploy-guide/run.yaml diff --git a/playbooks/deploy-guide/post.yaml b/playbooks/deploy-guide/post.yaml new file mode 100644 index 00000000..4ab00985 --- /dev/null +++ b/playbooks/deploy-guide/post.yaml @@ -0,0 +1,5 @@ +- hosts: all + roles: + - role: fetch-tox-output + - role: fetch-sphinx-output + sphinx_output_src: "{{ zuul.project.src_dir }}/deploy-guide/build/html" diff --git a/playbooks/legacy/deploy-guide/post.yaml b/playbooks/legacy/deploy-guide/post.yaml deleted file mode 100644 index cfb21742..00000000 --- a/playbooks/legacy/deploy-guide/post.yaml +++ /dev/null @@ -1,10 +0,0 @@ -- hosts: primary - tasks: - - - name: Copy files from deploy-guide/build/html/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/deploy-guide/build/html/' - dest: '{{ zuul.executor.log_root }}/html/' - mode: pull - copy_links: true - verify_host: true diff --git a/playbooks/legacy/deploy-guide/run.yaml b/playbooks/legacy/deploy-guide/run.yaml deleted file mode 100644 index 46c812ee..00000000 --- a/playbooks/legacy/deploy-guide/run.yaml +++ /dev/null @@ -1,129 +0,0 @@ -- hosts: all - name: Autoconverted job legacy-deploy-guide from old job gate-{name}-deploy-guide - tasks: - - - name: Ensure legacy workspace directory - file: - path: '{{ ansible_user_dir }}/workspace' - state: directory - - - shell: - cmd: | - set -e - set -x - CLONEMAP=`mktemp` - REQS_DIR=`mktemp -d` - function cleanup { - mkdir -p $WORKSPACE - rm -rf $CLONEMAP $REQS_DIR - } - trap cleanup EXIT - cat > $CLONEMAP << EOF - clonemap: - - name: $ZUUL_PROJECT - dest: . - EOF - # zuul cloner works poorly if there are 2 names that are the - # same in here. - if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then - cat >> $CLONEMAP << EOF - - name: openstack/requirements - dest: $REQS_DIR - EOF - fi - /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ - git://git.openstack.org $ZUUL_PROJECT openstack/requirements - # REQS_DIR is not set for openstack/requirements and there is also - # no need to copy in this case. - if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then - cp $REQS_DIR/upper-constraints.txt ./ - fi - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh - 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 - VENV="deploy-guide" - GUIDEDIR="deploy-guide" - - # This script is used to publish project-specific deploy-guide and - # install-guide documents to the proper place. Master will be - # published to a draft directory, stable/X will be published to the X - # directory. For example stable/newton documents will life in the - # newton directory. - - # You need to pass in the following variables: - # VENV - virtual env to use - # GUIDEDIR - directory for building - - if [ -z "$VENV" ] ; then - echo "The variable VENV is not set." - exit 1 - fi - if [ -z "$GUIDEDIR" ] ; then - echo "The variable GUIDEDIR is not set." - exit 1 - fi - - export UPPER_CONSTRAINTS_FILE=$(pwd)/upper-constraints.txt - - tox -e $VENV - - [ -e .tox/$VENV/bin/pbr ] && freezecmd=pbr || freezecmd=pip - - echo "Begin pbr freeze output from test virtualenv:" - echo "======================================================================" - .tox/${VENV}/bin/${freezecmd} freeze - echo "======================================================================" - - MARKER_TEXT="Project: $ZUUL_PROJECT Ref: $ZUUL_REFNAME Build: $ZUUL_UUID Revision: $ZUUL_NEWREV" - echo $MARKER_TEXT > $GUIDEDIR/build/html/.root-marker - - if [ -z "$ZUUL_REFNAME" ]; then - TARGET="" - # Leave documents where they are - elif [ "$ZUUL_REFNAME" == "master" ] ; then - TARGET=draft - elif echo $ZUUL_REFNAME | grep stable/ >/dev/null ; then - # Put stable release changes in dir named after stable release under the - # build dir. When Jenkins copies these files they will be accessible under - # the developer docs root using the name of the stable release. - TARGET=$(echo $ZUUL_REFNAME | sed 's/stable.//') - else - # Put other branch changes in dir named after branch under the - # build dir. When Jenkins copies these files they will be - # accessible under the developer docs root using the branch name. - # EG: feature/foo or milestone-proposed - TARGET=$ZUUL_REFNAME - fi - - if [ ! -z $TARGET ] ; then - # Move the docs into subdir based on branch - TOP=`dirname $TARGET` - mv $GUIDEDIR/build/html $GUIDEDIR/build/tmp - mkdir -p $GUIDEDIR/build/html/$TOP - mv $GUIDEDIR/build/tmp $GUIDEDIR/build/html/$TARGET - fi - - exit - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 6853f276..0b8be6ef 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -444,6 +444,22 @@ - ^tox.ini$ - ^api-guide/.* +- job: + name: build-openstack-deploy-guide + parent: openstack-tox + description: | + Build deploy-guide document. + success-url: html/ + post-run: playbooks/build-deploy-guide/post + timeout: 1800 + vars: + tox_envlist: deploy-guide + files: + - ^tox.ini$ + - ^deploy-guide/.* + - bindep.txt + - other-requirements.txt + - job: name: legacy-base description: | diff --git a/zuul.d/project-templates.yaml b/zuul.d/project-templates.yaml index 46fe2481..8c4bad94 100644 --- a/zuul.d/project-templates.yaml +++ b/zuul.d/project-templates.yaml @@ -481,3 +481,15 @@ post: jobs: - publish-api-ref + +- project-template: + name: deploy-guide-jobs + check: + jobs: + - build-openstack-deploy-guide + gate: + jobs: + - build-openstack-deploy-guide + post: + jobs: + - publish-deploy-guide diff --git a/zuul.d/zuul-legacy-jobs.yaml b/zuul.d/zuul-legacy-jobs.yaml index e05fd705..b7566014 100644 --- a/zuul.d/zuul-legacy-jobs.yaml +++ b/zuul.d/zuul-legacy-jobs.yaml @@ -1419,19 +1419,6 @@ - openstack/murano-dashboard - openstack/python-muranoclient -- job: - name: legacy-deploy-guide - parent: legacy-base - success-url: html/ - run: playbooks/legacy/deploy-guide/run - post-run: playbooks/legacy/deploy-guide/post - timeout: 1800 - files: - - ^tox.ini$ - - ^deploy-guide/.* - - bindep.txt - - other-requirements.txt - - job: name: legacy-designate-dashboard-nodejs4-npm-run-lint parent: legacy-base diff --git a/zuul.d/zuul-legacy-project-templates.yaml b/zuul.d/zuul-legacy-project-templates.yaml index 369dd73e..7e670fa4 100644 --- a/zuul.d/zuul-legacy-project-templates.yaml +++ b/zuul.d/zuul-legacy-project-templates.yaml @@ -675,28 +675,6 @@ - legacy-chef-rake-integration-multinode: voting: false -- project-template: - name: deploy-guide-jobs - check: - jobs: - - legacy-deploy-guide: - files: - - ^tox.ini$ - - ^deploy-guide/.* - - bindep.txt - - other-requirements.txt - gate: - jobs: - - legacy-deploy-guide: - files: - - ^tox.ini$ - - ^deploy-guide/.* - - bindep.txt - - other-requirements.txt - post: - jobs: - - legacy-deploy-guide - - project-template: name: designate-dsvm-jobs check: