-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.yml
48 lines (47 loc) · 1.38 KB
/
setup.yml
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
---
- name: Setup the Project
hosts: all
gather_facts: false
become: yes
vars:
nodejs: 14.15.0
Dashboard: /home/rachit/StackingDashboard
vars_files:
- "vars/localhost.yml"
tasks:
- name: Update System
apt:
name: "*"
state: "latest"
- name: Install nodejs
apt: name=nodejs update_cache=yes
- name: Installing npm
apt: name=npm update_cache=yes
- name: Git
git:
repo: "https://github.com/StackedSats/Stacking-Dashboard"
dest: "{ { Dashboard } }"
- name: Install dependencies
command: chdir={{Dashboard}} npm install
ignore_errors: yes
- name: .env copy
copy:
src: "{{playbook_dir}}/env"
dest: "{ { Dashboard } }"
- name: Build frontend
command: chdir={{Dashboard}} npm run build
- name: Download server code
git:
repo: "https://github.com/StackedSats/Stacking-Server"
dest: /home/rachit/StackingServer
- name: Install server dependencies
command: chdir=/home/rachit/StackingServer npm install
ignore_errors: yes
- name: move build into server
command: mv {{Dashboard}} /home/rachit/StackingServer
- name: .env copy
copy:
src: "{{playbook_dir}}/env"
dest: "{ { Dashboard } }"
- name: spin up the server at port 4500
command: chdir=/home/rachit/StackingServer pm2 start index.js