Skip to content

Commit 7ccf31c

Browse files
committed
Change way we deploy image-builder
1 parent 4e58cde commit 7ccf31c

File tree

7 files changed

+34
-19
lines changed

7 files changed

+34
-19
lines changed

ansible/delta-hosts/hosts

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ delta-consul-c
3737
[user-vault]
3838
localhost
3939

40+
[user-local]
41+
localhost
42+
4043
[worker]
4144
localhost
4245

ansible/gamma-hosts/hosts

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ gamma-consul-c
4141
[user-vault]
4242
localhost
4343

44+
[user-local]
45+
localhost
46+
4447
[worker]
4548
localhost
4649

ansible/group_vars/alpha-image-builder.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
app_name: image-builder
22
name: "{{ app_name }}"
3-
# namespace (can include "registry.runnable.com:")
4-
image_builder_docker_namespace: "{{ registry_host }}/runnable/image-builder"
5-
app_repo: [email protected]:CodeNow/{{ app_name }}.git
3+
4+
inject_ca: false
5+
repo: [email protected]:CodeNow/{{ name }}.git
6+
node_version: "4.8.0"
7+
npm_version: "2.15.11"
68

79
# consul values
810
consul_values:

ansible/image-builder.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
---
2+
- hosts: api
3+
vars_files:
4+
- group_vars/alpha-image-builder.yml
5+
roles:
6+
- { role: builder }
7+
28
- hosts: "{{ dock | default('docks') }}"
39
vars_files:
410
- group_vars/alpha-image-builder.yml
511
roles:
6-
- { role: notify, tags: [notify] }
7-
- { role: node, tags: [setup] }
8-
- { role: git_repo }
9-
- { role: image-builder }
12+
- { role: pull-image }
1013
- { role: consul_value, tags: [consul_value] }

ansible/roles/builder/tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,4 @@
192192
tags: deploy, build
193193
when: build_image
194194
become: yes
195-
command: docker logout
195+
command: docker logout {{ registry_host }}

ansible/roles/image-builder/tasks/main.yml

-11
This file was deleted.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
- name: login to registry
3+
tags: deploy
4+
become: yes
5+
command: docker login -u {{ registry_username }} -p {{ registry_token }} -e "[email protected]" {{ registry_host }}
6+
7+
- name: pull image
8+
tags: deploy
9+
become: true
10+
command: docker pull {{ container_image }}:{{ container_tag }}
11+
12+
- name: logout of registry
13+
tags: deploy
14+
become: yes
15+
command: docker logout {{ registry_host }}

0 commit comments

Comments
 (0)