-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-staging.yaml
More file actions
executable file
·65 lines (55 loc) · 1.48 KB
/
Copy pathdeploy-staging.yaml
File metadata and controls
executable file
·65 lines (55 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env ansible-playbook
- hosts: staging
gather_facts: True
vars_files:
- ./variables/common.yaml
tasks:
- name: Print variable
debug:
msg: "{{ ansible_fqdn }}"
- name: Delete execution directory
file:
state: absent
path: "{{ exepath }}"
- name: Create execution directory
file:
path: "{{ exepath }}"
recurse: yes
state: directory
mode: 0755
group: root
owner: root
- name: Find files to copy
shell: ls -a . | grep -vE '^\.{1,}|^tools$'
args:
executable: /bin/bash
delegate_to: "localhost"
register: files_to_copy
- name: Print variable
debug:
msg: "{{ files_to_copy.stdout_lines }}"
- name: Copy files to remote
copy:
src: "{{ item }}"
dest: "{{ exepath }}/"
owner: root
group: root
mode: 0755
with_items: "{{ files_to_copy.stdout_lines }}"
- name: Docker login Github registry
shell: echo {{ access_token }} | docker login ghcr.io -u {{ access_user }} --password-stdin
args:
executable: /bin/bash
register: shell_result
- name: Print Result
debug:
msg: "{{ shell_result.stdout }}"
- name: Deploy web service
shell: "{{ exe_cmd }}"
args:
chdir: "{{ exepath }}"
executable: /bin/bash
register: shell_result
- name: Print Result
debug:
msg: "{{ shell_result.stdout }}"