-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yaml
52 lines (52 loc) · 1.33 KB
/
playbook.yaml
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
---
- hosts: server
tasks:
- name: Install git and gpg
become: true
apt:
pkg:
- git
- gpg
- name: Checkout ASDF
git:
repo: 'https://github.com/asdf-vm/asdf.git'
dest: ~/.asdf/
version: v0.10.2
- name: Install ASDF
shell: |
echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc
echo ". $HOME/.asdf/completions/asdf.bash" >> ~/.bashrc
args:
executable: /bin/bash
- name: Install ASDF NodeJS
shell: |
bash -ilc "asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git"
bash -ilc "asdf install nodejs 18.12.1"
bash -ilc "asdf global nodejs 18.12.1"
- name: Install pm2
shell: |
bash -ilc "npm install pm2 -g"
args:
executable: /bin/bash
- name: Clone repo
git:
repo: https://github.com/raphaklaus/copa-proxy
dest: ~/app
version: main
accept_hostkey: yes
- name: Copy .env file
copy:
src: .env.config.cjs
dest: ~/app
- name: Install app dependencies
shell: |
bash -ilc "npm install"
args:
executable: /bin/bash
chdir: app/
- name: Run application
shell: |
bash -ilc "pm2 start .env.config.cjs"
args:
executable: /bin/bash
chdir: app/