Updating Docker Gate use of zuul.newrev

- Zuul updated ansible to 2.7, no longer allows missing variables.
- Using default value when it isn't available.
- airship_deckhand_path isn't working, but is a non-voting gate.

Based on Aaron Sheffield's PS for Pegleg: https://review.openstack.org/#/c/645631/

Change-Id: I6fe13d2043480cd6de6785203373f35d83545196
This commit is contained in:
Aaron Sheffield 2019-03-22 13:01:29 -05:00
parent 6208baf9d5
commit 7685456ef2
7 changed files with 22 additions and 22 deletions

View File

@ -30,7 +30,7 @@
environment: environment:
BRANCH: "{{ zuul.branch }}" BRANCH: "{{ zuul.branch }}"
CHANGE: "{{ zuul.change }}" CHANGE: "{{ zuul.change }}"
COMMIT: "{{ zuul.newrev }}" COMMIT: "{{ zuul.newrev | default('') }}"
PATCHSET: "{{ zuul.patchset }}" PATCHSET: "{{ zuul.patchset }}"
register: image_tags register: image_tags
@ -83,7 +83,7 @@
DOCKER_REGISTRY: "quay.io" DOCKER_REGISTRY: "quay.io"
IMAGE_PREFIX: "airshipit" IMAGE_PREFIX: "airshipit"
IMAGE_TAG: "{{ item }}" IMAGE_TAG: "{{ item }}"
COMMIT: "{{ zuul.newrev }}" COMMIT: "{{ zuul.newrev | default('') }}"
PUSH_IMAGE: "true" PUSH_IMAGE: "true"
with_items: "{{ image_tags.stdout_lines }}" with_items: "{{ image_tags.stdout_lines }}"

View File

@ -18,7 +18,7 @@
latest_tag: latest latest_tag: latest
org: airshipit org: airshipit
image: deckhand image: deckhand
new_tag: "{{ zuul.newrev }}" new_tag: "{{ zuul.newrev | default('') }}"
token: "{{ airship_deckhand_quay_creds.token }}" token: "{{ airship_deckhand_quay_creds.token }}"
quay_repo_api_url: "https://quay.io/api/v1/repository" quay_repo_api_url: "https://quay.io/api/v1/repository"
tasks: tasks:

View File

@ -27,7 +27,7 @@
shell: cd "{{ work_dir }}"; pwd shell: cd "{{ work_dir }}"; pwd
register: airship_deckhand_path register: airship_deckhand_path
vars: vars:
work_dir: "{{ zuul.project.src_dir }}/{{ zuul_airship_deckhand_relative_path | default('') }}" work_dir: "{{ zuul.project.src_dir | default('') }}/{{ zuul_airship_deckhand_relative_path | default('') }}"
- name: Build Airship-Deckhand Image - name: Build Airship-Deckhand Image
when: proxy.http is undefined or (proxy.http | trim == "") when: proxy.http is undefined or (proxy.http | trim == "")

View File

@ -20,7 +20,7 @@
docker run \ docker run \
--rm \ --rm \
--net=host \ --net=host \
-v "{{ deckhand_conf_dir }}":/etc/deckhand "{{ airship_deckhand_image_id.stdout }}" alembic upgrade head -v "{{ deckhand_conf_dir | default('') }}":/etc/deckhand "{{ airship_deckhand_image_id.stdout }}" alembic upgrade head
# Allow migrations to complete. # Allow migrations to complete.
sleep 10 sleep 10
@ -32,7 +32,7 @@
--rm \ --rm \
--net=host \ --net=host \
-p 9000:9000 \ -p 9000:9000 \
-v "{{ deckhand_conf_dir }}":/etc/deckhand "{{ airship_deckhand_image_id.stdout }}" server & -v "{{ deckhand_conf_dir | default('') }}":/etc/deckhand "{{ airship_deckhand_image_id.stdout }}" server &
# Give the server a chance to come up. Better to poll a health check. # Give the server a chance to come up. Better to poll a health check.
sleep 10 sleep 10

View File

@ -17,7 +17,7 @@
set -e; set -e;
./tools/gate/scripts/020-deploy-postgresql.sh ./tools/gate/scripts/020-deploy-postgresql.sh
args: args:
chdir: "{{ zuul.project.src_dir }}" chdir: "{{ zuul.project.src_dir | default('') }}"
register: _airship_deckhand_database_url register: _airship_deckhand_database_url
become: yes become: yes
@ -25,4 +25,4 @@
set_fact: set_fact:
airship_deckhand_database_url: "{{ _airship_deckhand_database_url.stdout_lines | last }}" airship_deckhand_database_url: "{{ _airship_deckhand_database_url.stdout_lines | last }}"
environment: environment:
AIRSHIP_DECKHAND_DATABASE_URL: "{{ airship_deckhand_database_url }}" AIRSHIP_DECKHAND_DATABASE_URL: "{{ airship_deckhand_database_url | default('') }}"

View File

@ -20,20 +20,20 @@
- name: Store deckhand_conf_dir in variable - name: Store deckhand_conf_dir in variable
set_fact: set_fact:
deckhand_conf_dir: "{{ _deckhand_conf_dir.path }}" deckhand_conf_dir: "{{ _deckhand_conf_dir.path | default('') }}"
environment: environment:
# Used by Deckhand's initialization script to search for config files. # Used by Deckhand's initialization script to search for config files.
AIRSHIP_DECKHAND_CONFIG_DIR: "{{ deckhand_conf_dir }}" AIRSHIP_DECKHAND_CONFIG_DIR: "{{ deckhand_conf_dir | default('') }}"
- name: Generate test deckhand.conf file when disable_keystone is true - name: Generate test deckhand.conf file when disable_keystone is true
when: disable_keystone == true when: disable_keystone == true
shell: |- shell: |-
set -ex; set -ex;
chmod 777 -R "{{ deckhand_conf_dir }}" chmod 777 -R "{{ deckhand_conf_dir | default('')}}"
conf_file="{{ deckhand_conf_dir }}"/deckhand.conf conf_file="{{ deckhand_conf_dir | default('') }}"/deckhand.conf
cp etc/deckhand/logging.conf.sample "{{ deckhand_conf_dir }}"/logging.conf cp etc/deckhand/logging.conf.sample "{{ deckhand_conf_dir | default('') }}"/logging.conf
envsubst '$AIRSHIP_DECKHAND_DATABASE_URL' < deckhand/tests/deckhand.conf.test > $conf_file envsubst '$AIRSHIP_DECKHAND_DATABASE_URL' < deckhand/tests/deckhand.conf.test > $conf_file
echo "Toggling development_mode on to disable Keystone authentication." echo "Toggling development_mode on to disable Keystone authentication."
@ -42,8 +42,8 @@
echo $conf_file 1>&2 echo $conf_file 1>&2
cat $conf_file 1>&2 cat $conf_file 1>&2
echo "{{ deckhand_conf_dir }}"/logging.conf 1>&2 echo "{{ deckhand_conf_dir | default('') }}"/logging.conf 1>&2
cat "{{ deckhand_conf_dir }}"/logging.conf 1>&2 cat "{{ deckhand_conf_dir | default('') }}"/logging.conf 1>&2
args: args:
chdir: "{{ airship_deckhand_path.stdout }}" chdir: "{{ airship_deckhand_path.stdout }}"
environment: environment:
@ -55,17 +55,17 @@
shell: |- shell: |-
set -ex; set -ex;
chmod 777 -R "{{ deckhand_conf_dir }}" chmod 777 -R "{{ deckhand_conf_dir | default('') }}"
conf_file="{{ deckhand_conf_dir }}"/deckhand.conf conf_file="{{ deckhand_conf_dir | default('') }}"/deckhand.conf
cp etc/deckhand/logging.conf.sample "{{ deckhand_conf_dir }}"/logging.conf cp etc/deckhand/logging.conf.sample "{{ deckhand_conf_dir | default('') }}"/logging.conf
envsubst '$AIRSHIP_DECKHAND_DATABASE_URL $TEST_BARBICAN_URL' < deckhand/tests/deckhand.conf.test > $conf_file envsubst '$AIRSHIP_DECKHAND_DATABASE_URL $TEST_BARBICAN_URL' < deckhand/tests/deckhand.conf.test > $conf_file
echo $conf_file 1>&2 echo $conf_file 1>&2
cat $conf_file 1>&2 cat $conf_file 1>&2
echo "{{ deckhand_conf_dir }}"/logging.conf 1>&2 echo "{{ deckhand_conf_dir | default('') }}"/logging.conf 1>&2
cat "{{ deckhand_conf_dir }}"/logging.conf 1>&2 cat "{{ deckhand_conf_dir | default('') }}"/logging.conf 1>&2
args: args:
chdir: "{{ airship_deckhand_path.stdout }}" chdir: "{{ airship_deckhand_path.stdout }}"
environment: environment:

View File

@ -17,7 +17,7 @@
shell: |- shell: |-
set -ex; set -ex;
echo "Using noauth-paste.ini to disable Keystone authentication." echo "Using noauth-paste.ini to disable Keystone authentication."
cp etc/deckhand/noauth-paste.ini "{{ deckhand_conf_dir }}"/noauth-paste.ini cp etc/deckhand/noauth-paste.ini "{{ deckhand_conf_dir | default('') }}"/noauth-paste.ini
args: args:
chdir: "{{ airship_deckhand_path.stdout }}" chdir: "{{ airship_deckhand_path.stdout }}"
@ -25,6 +25,6 @@
when: disable_keystone == false when: disable_keystone == false
shell: |- shell: |-
set -ex; set -ex;
cp etc/deckhand/deckhand-paste.ini "{{ deckhand_conf_dir }}"/deckhand-paste.ini cp etc/deckhand/deckhand-paste.ini "{{ deckhand_conf_dir | default('') }}"/deckhand-paste.ini
args: args:
chdir: "{{ airship_deckhand_path.stdout }}" chdir: "{{ airship_deckhand_path.stdout }}"