Matt McEuen ef33f672a3 Fix airshipctl image publish
Resolve the following error when logging into the remote docker registry.

Failed to import the required Python library (Docker SDK for Python:
docker (Python >= 2.7) or docker-py (Python 2.6)) on
ubuntu-bionic-rax-dfw-0015461365's Python /usr/bin/python3.
Please read module documentation and install in the appropriate
location, for example via `pip install docker` or `pip install docker-py`
(Python 2.6). The error was: No module named 'docker'

Change-Id: I0df7e58aae886dfa3901815a60853e47c98b5e90
2020-03-25 16:21:16 -05:00

49 lines
1.5 KiB
YAML

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Install python-docker Module
apt:
pkg:
- python-docker
- python3-docker
- python-requests
- python3-requests
state: present
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: List Docker Images
shell: docker image ls
- name: Push Images
block:
- name: Login to Image Registry
docker_login:
username: "{{ airshipctl_image_repo_credentials.username }}"
password: "{{ airshipctl_image_repo_credentials.password }}"
registry_url: "{{ image_repo }}"
- name: Push Image with Latest Tag
make:
chdir: "{{ zuul.project.src_dir }}"
params:
DOCKER_IMAGE_TAG: latest
PUBLISH: true
target: images
- name: Push Image with Commit Tag
make:
chdir: "{{ zuul.project.src_dir }}"
params:
DOCKER_IMAGE_TAG: "{{ zuul.newrev }}"
PUBLISH: true
target: images