-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildserver.yml
More file actions
35 lines (31 loc) · 795 Bytes
/
Copy pathbuildserver.yml
File metadata and controls
35 lines (31 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
- name: "Docker Image/Build and Image/Push"
hosts: build
become: true
gather_facts: no
vars_files:
- docker.vars
tasks:
- name: "Build Step: Cloning Repository"
git:
repo: "{{ repo_url }}"
dest: "{{ repo_dest }}"
register: repo_status
- name: "Build Step: Login to remote Repository"
when: repo_status.changed == true
docker_login:
username: "{{ docker_username }}"
password: "{{ docker_password }}"
- name: "Build Step: Building image"
docker_image:
source: build
build:
path: "{{ repo_dest }}"
pull: yes
name: "{{ image_name }}"
tag: "{{ item }}"
push: true
force_tag: yes
force_source: yes
with_items:
- 1