master
omidshj 2024-05-17 18:06:47 +03:30
parent 7ecc25ea3f
commit fdfa834984
4 changed files with 3 additions and 38 deletions

View File

@ -9,14 +9,14 @@
# version: master # version: master
# register: git_result # register: git_result
- name: Go to the application directory - name: Go to the application directory
command: chdir=/root/code/inception git pull origin master command: chdir=/root/code/generate-image git pull origin master
register: git_result register: git_result
- name: Build docker image if there were changes - name: Build docker image if there were changes
docker_image: docker_image:
source: build source: build
build: build:
path: /root/code/inception path: /root/code/generate-image
name: inception name: generate-image
tag: "{{semaphore_vars.task_details.target_version}}" tag: "{{semaphore_vars.task_details.target_version}}"
when: git_result.changed when: git_result.changed

11
i3.yml
View File

@ -1,11 +0,0 @@
---
- name: update inception
hosts: all
tasks:
- name: Go to the application directory
command: chdir=/root/code/inception git pull origin master
register: git_output
- name: Run build script
command: chdir=/root/code/inception ./build.sh
when: git_output.changed

View File

@ -1,12 +0,0 @@
---
- name: update inception
hosts: all
tasks:
- name: Change directory to inception
chdir: /root/code/inception # Replace with the actual path
- name: Pull latest changes from Git repository
git:
repo: https://gt.eron.co/eron/inception.git
update: yes
- name: Run build script
command: ./build.sh

View File

@ -1,12 +0,0 @@
---
- name: Create a file in /root directory
hosts: all
# become: yes # This is necessary to gain root privileges
tasks:
- name: Ensure test.txt exists in /root directory
file:
path: /root/test.txt
state: touch
owner: root
group: root
mode: '0644'