Playbook: build and publish ci image
This commit is contained in:
parent
a1a499b370
commit
c97e3123c9
1 changed files with 26 additions and 9 deletions
35
build.yaml
35
build.yaml
|
@ -17,9 +17,31 @@
|
|||
ansible.builtin.debug:
|
||||
var: force_rm
|
||||
|
||||
- name: Get the version from git
|
||||
command: git describe --dirty --tags
|
||||
register: version
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
|
||||
- name: Build the base CI image
|
||||
containers.podman.podman_image:
|
||||
name: treetrail-backend-ci
|
||||
tag: "{{ version }}"
|
||||
state: build
|
||||
path: "{{ playbook_dir }}"
|
||||
build:
|
||||
format: oci
|
||||
force_rm: "{{ force_rm }}"
|
||||
cache: "{{ cache }}"
|
||||
file: Containerfile.ci
|
||||
push: true
|
||||
push_args:
|
||||
dest: "{{ repository }}/{{ organisation }}/treetrail-backend-ci"
|
||||
|
||||
- name: Build the base image, only with python dependencies
|
||||
containers.podman.podman_image:
|
||||
name: treetrail-backend-deps
|
||||
tag: "{{ version }}"
|
||||
state: build
|
||||
path: "{{ playbook_dir }}"
|
||||
build:
|
||||
|
@ -29,17 +51,12 @@
|
|||
file: Containerfile.deps
|
||||
push: true
|
||||
push_args:
|
||||
dest: "{{ repository }}/{{ organisation }}/treetrail-backend-deps"
|
||||
|
||||
- name: Get the version from git
|
||||
command: git describe --dirty --tags
|
||||
register: version
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}"
|
||||
dest: "{{ repository }}/{{ organisation }}"
|
||||
|
||||
- name: Build the backend container image
|
||||
containers.podman.podman_image:
|
||||
name: "treetrail-backend:{{ version.stdout }}"
|
||||
name: treetrail-backend
|
||||
tag: "{{ version.stdout }}"
|
||||
state: build
|
||||
force: true
|
||||
path: "{{ playbook_dir }}"
|
||||
|
@ -51,4 +68,4 @@
|
|||
extra_args: "--build-arg APP_VERSION={{ version.stdout }}"
|
||||
push: true
|
||||
push_args:
|
||||
dest: "{{ repository }}/{{ organisation }}/treetrail-backend:{{ version.stdout }}"
|
||||
dest: "{{ repository }}/{{ organisation }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue