diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-08-15 15:07:48 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-08-15 15:07:48 +0200 |
commit | 15cceca6a25b9e5c228a6aa39fb087f8063273f6 (patch) | |
tree | 310e0914cd2c1e294faefbf7876b67b37ca2f384 /roles/workspace/tasks/project.yml | |
parent | import my_dotfiles role (diff) | |
download | infra-ansible-15cceca6a25b9e5c228a6aa39fb087f8063273f6.tar.gz infra-ansible-15cceca6a25b9e5c228a6aa39fb087f8063273f6.zip |
workspace -> my_workspace
Diffstat (limited to 'roles/workspace/tasks/project.yml')
-rw-r--r-- | roles/workspace/tasks/project.yml | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/roles/workspace/tasks/project.yml b/roles/workspace/tasks/project.yml deleted file mode 100644 index ae139f5..0000000 --- a/roles/workspace/tasks/project.yml +++ /dev/null @@ -1,70 +0,0 @@ -- name: Set project URL - ansible.builtin.set_fact: - project_url: '{{ item.url | default(item) }}' - -- name: Set project name - ansible.builtin.set_fact: - project_name: "{{ item.name | default(project_url | urlsplit('path') | basename | regex_replace('\\.git$', '')) }}" - -- name: Set project directory - ansible.builtin.set_fact: - project_dir: '{{ workspace_dir }}/{{ project_name }}' - -- name: 'Update repository: {{ project_name }}' - ansible.builtin.git: - accept_hostkey: true - dest: '{{ project_dir }}' - repo: '{{ project_url }}' - -- name: Check for Makefile - ansible.builtin.file: - path: '{{ project_dir }}/Makefile' - state: file - register: makefile_check - ignore_errors: true - -- name: This project uses make - become: true - when: makefile_check is succeeded - block: - - name: Run make - ansible.builtin.command: make - args: - chdir: '{{ project_dir }}' - register: make_output - when: makefile_check is succeeded - - - name: Show make output - ansible.builtin.debug: - var: make_output - -- name: Check for docker-compose.yml - ansible.builtin.file: - path: '{{ project_dir }}/docker-compose.yml' - state: file - register: docker_compose_check - ignore_errors: true - -- name: This project uses docker-compose - become: true - when: makefile_check is not succeeded and docker_compose_check is succeeded - block: - - name: docker-compose pull - ansible.builtin.command: docker-compose pull - args: - chdir: '{{ project_dir }}' - - - name: docker-compose build - ansible.builtin.command: docker-compose build --force-rm --pull -q - args: - chdir: '{{ project_dir }}' - - - name: docker-compose up - ansible.builtin.command: docker-compose up --remove-orphans -d - args: - chdir: '{{ project_dir }}' - register: docker_compose_up - - - name: Show docker-compose up output - ansible.builtin.debug: - var: docker_compose_up |