885f02e217
So that users can specify two docker image builds for the same repository, but with different tags, ensure that the temporary change_ tag attached to the image also includes the final tag name. This allows this configuration to work: docker_images: - repository: foo/image context: opensuse tags: - opensuse-latest - repository: foo/image context: ubuntu tags: - ubuntu-latest Change-Id: I917dcf8a74fc864ea06dc70bdb3e212dc170eb48
16 lines
555 B
YAML
16 lines
555 B
YAML
- name: Verify repository names
|
|
when: |
|
|
docker_credentials.repository is defined
|
|
and not item.repository | regex_search(docker_credentials.repository)
|
|
loop: "{{ docker_images }}"
|
|
fail:
|
|
msg: "{{ item.repository }} not permitted by {{ docker_credentials.repository }}"
|
|
- name: Log in to dockerhub
|
|
command: "docker login -u {{ docker_credentials.username }} -p {{ docker_credentials.password }}"
|
|
no_log: true
|
|
- name: Upload image to dockerhub
|
|
loop: "{{ docker_images }}"
|
|
loop_control:
|
|
loop_var: image
|
|
include_tasks: push.yaml
|