playbooks/build generate-image.yml

22 lines
699 B
YAML
Raw Permalink Normal View History

2024-05-17 12:02:07 +03:30
---
2024-05-17 18:10:38 +03:30
- name: build generate-image
2024-05-17 12:02:07 +03:30
hosts: all
tasks:
2024-05-17 12:30:54 +03:30
# - name: Change to the app directory and update the repository
# git:
# repo: 'https://gt.eron.co/eron/inception.git' # Replace with your repository URL
# dest: /root/code/inception
# version: master
# register: git_result
2024-05-17 12:42:00 +03:30
- name: Go to the application directory
2024-05-17 18:10:38 +03:30
command: chdir=/root/code/generate-image git pull origin main
2024-05-17 12:42:00 +03:30
register: git_result
2024-05-17 12:02:07 +03:30
2024-05-17 12:05:43 +03:30
- name: Build docker image if there were changes
docker_image:
source: build
build:
2024-05-17 18:06:47 +03:30
path: /root/code/generate-image
name: generate-image
2024-05-17 12:46:41 +03:30
tag: "{{semaphore_vars.task_details.target_version}}"
2024-05-17 12:42:00 +03:30
when: git_result.changed