-
Notifications
You must be signed in to change notification settings - Fork 8
/
01_build_docker_image.yml
43 lines (39 loc) · 1.08 KB
/
01_build_docker_image.yml
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
36
37
38
39
40
41
42
43
- name: Check for prebuilt container image from github actions
stat:
path: /vagrant/dev/tmp/container-image.tar
register: container_image
- name: Remove docker image
docker_image:
name: docker_image
tag: local
force_absent: true
state: absent
when: not container_image.stat.exists
- name: Build docker image
docker_image:
name: ghcr.io/skatteetaten/vagrant-hashistack-template
tag: latest
build:
path: /vagrant/docker
pull: false
http_timeout: 120
args:
TEST_DOWNLOAD_BUILD_ARGUMENT: https://nrk.no
source: build
when: not container_image.stat.exists
# NB! Folder /vagrant is mounted to Minio
# Folder `dev` is going to be a bucket name
- name: Create tmp if it does not exist
file:
path: /vagrant/dev/tmp
state: directory
mode: '0755'
owner: vagrant
group: vagrant
- name: Archive docker image
docker_image:
name: ghcr.io/skatteetaten/vagrant-hashistack-template
tag: latest
archive_path: /vagrant/dev/tmp/container-image.tar
source: local
when: not container_image.stat.exists