playbooks/build inception.yml

24 lines
741 B
YAML
Raw Normal View History

2024-05-17 14:16:29 +03:30
---
- name: update inception
hosts: all
2025-02-04 21:54:52 +03:30
vars:
app_dir: "{{ app_dir | default('/root/code/inception') }}"
2024-05-17 14:16:29 +03:30
tasks:
# - 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
- name: Go to the application directory
2025-02-04 21:54:52 +03:30
command: chdir={{ app_dir }} git pull origin master
2024-05-17 14:16:29 +03:30
register: git_result
- name: Build docker image if there were changes
docker_image:
source: build
build:
2025-02-04 22:11:05 +03:30
path: "{{ app_dir }}"
2024-05-17 14:16:29 +03:30
name: inception
tag: "{{semaphore_vars.task_details.target_version}}"
when: git_result.changed