You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
818 B
YAML
26 lines
818 B
YAML
|
2 years ago
|
- name: Deployment - Archive the app for deployment
|
||
|
|
become: false
|
||
|
|
ansible.builtin.shell: "git archive --format=tgz --prefix='app/' -o ../deployment/roles/archive/files/{{deployment_repo_name}}.tgz {{ release_tag }}"
|
||
|
|
args:
|
||
|
|
chdir: ../{{deployment_repo_name}}/
|
||
|
|
delegate_to: 127.0.0.1
|
||
|
|
|
||
|
|
- name: Deployment - if exists - removes /opt/ directory
|
||
|
|
shell: rm -rf /opt/
|
||
|
|
|
||
|
|
- name: Deployment - Creates /opt/ (application) directory
|
||
|
|
file:
|
||
|
|
path: /opt
|
||
|
|
state: directory
|
||
|
|
|
||
|
|
- name: Deployment - extract application archive
|
||
|
|
ansible.builtin.unarchive:
|
||
|
|
src: "{{deployment_repo_name}}.tgz"
|
||
|
|
dest: /opt/
|
||
|
|
|
||
|
|
- name: Deployment - copies the credentials file from the local app working copy repository
|
||
|
|
ansible.builtin.copy:
|
||
|
|
src: "../{{deployment_repo_name}}/params.yaml"
|
||
|
|
dest: "/opt/app"
|
||
|
|
mode: '0644'
|