-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push the container as molecule side-effect
Signed-off-by: Bas Meijer <[email protected]>
- Loading branch information
1 parent
4fe95ab
commit eb968d1
Showing
4 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,7 @@ | |
extends: default | ||
|
||
rules: | ||
line-length: | ||
max: 160 | ||
truthy: | ||
check-keys: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# export DOCKER_REGISTRY | ||
- name: Commit, tag, and push Docker image | ||
hosts: localhost | ||
gather_facts: false | ||
connection: local | ||
vars: | ||
github_actions: "{{ lookup('env', 'GITHUB_ACTIONS') }}" | ||
docker_registry: "{{ lookup('env','DOCKER_REGISTRY') }}" | ||
image_name: "dockpack/base_amq" | ||
image_tag: "{{ lookup('pipe', 'date +%Y%m%d%H') }}" # Generates a date hour stamp | ||
tasks: | ||
- name: Commit the container | ||
ansible.builtin.command: | ||
cmd: "docker commit base_amq {{ image_name }}:{{ image_tag }}" | ||
changed_when: true | ||
register: commit_output | ||
|
||
- name: Tag and push the Docker image | ||
when: not github_actions | bool | ||
community.docker.docker_image: | ||
name: "{{ docker_registry }}{% if docker_registry | length > 1 %}/{% endif %}{{ image_name }}" | ||
tag: "{{ image_tag }}" | ||
push: true | ||
source: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
collections: | ||
- name: community.docker |