-
Notifications
You must be signed in to change notification settings - Fork 0
add ansible/lint #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9ed0455
ec78bcf
b06bc8b
1a06bb5
4d87fb4
6544f7b
d7496b5
e411347
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,26 +3,33 @@ | |
|
||
tasks: | ||
- name: Clone the repository to a specific version (to a temp location) | ||
git: | ||
ansible.builtin.git: | ||
repo: "{{ repository_url }}" | ||
dest: /tmp/src | ||
accept_hostkey: yes | ||
accept_hostkey: true | ||
version: "{{ app_version }}" | ||
|
||
- name: Build with a given commit hash | ||
# This will be stored in local registry, and available as version to docker-compose | ||
# where we can just reference correct version | ||
shell: "cd /tmp/src && make docker/build V={{ app_version }}" | ||
ansible.builtin.command: | ||
chdir: /tmp/src | ||
cmd: "/usr/bin/make docker/build V={{ app_version }}" | ||
register: output | ||
changed_when: output.rc != 0 | ||
failed_when: output.rc != 0 | ||
artcz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Create a server Makefile to manage app tasks | ||
ansible.builtin.template: | ||
src: ../templates/app/Makefile.app.j2 | ||
src: app/Makefile.app.j2 | ||
dest: ./Makefile | ||
mode: "0640" | ||
|
||
- name: Set up docker-compose.yml for the app | ||
ansible.builtin.template: | ||
src: ../templates/app/docker-compose.app.yml.j2 | ||
src: app/docker-compose.app.yml.j2 | ||
dest: ./docker-compose.yml | ||
mode: "0640" | ||
|
||
- name: Check if the env file exists | ||
ansible.builtin.stat: | ||
|
@@ -31,8 +38,9 @@ | |
|
||
- name: If env file doesn't exist - copy the example | ||
ansible.builtin.copy: | ||
src: ../templates/app/intbot.env.example | ||
src: app/intbot.env.example | ||
dest: intbot.env.example | ||
mode: "0644" | ||
when: not env_file.stat.exists | ||
|
||
- name: If the env file doesn't exist - fail with error message | ||
|
@@ -41,10 +49,25 @@ | |
when: not env_file.stat.exists | ||
|
||
- name: Start docker compose to see if everything is running | ||
shell: "docker compose up -d" | ||
ansible.builtin.command: | ||
chdir: "{{ ansible_user_dir }}" | ||
cmd: "docker compose up -d" | ||
Comment on lines
+53
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Me not likey ansible.builtin.cmd. You could use community.docker.docker_compose_v2 |
||
register: output | ||
changed_when: output.rc != 0 | ||
failed_when: output.rc != 0 | ||
artcz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Migrate on prod | ||
shell: "make prod/migrate" | ||
ansible.builtin.command: | ||
chdir: "{{ ansible_user_dir }}" | ||
cmd: "/usr/bin/make prod/migrate" | ||
register: output | ||
changed_when: output.rc != 0 | ||
failed_when: output.rc != 0 | ||
artcz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Restart everything and finish | ||
shell: "docker compose up -d" | ||
ansible.builtin.command: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Me not likey ansible.builtin.cmd. You could use |
||
chdir: "{{ ansible_user_dir }}" | ||
cmd: "docker compose up -d" | ||
register: output | ||
changed_when: output.rc != 0 | ||
failed_when: output.rc != 0 | ||
artcz marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.