-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
87 lines (59 loc) · 1.77 KB
/
install.sh
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# -- BUILD AND INSTALL Tech Radar --
# Declare varibles
domain=$1
# Update machine package indexes
sudo apt-get update
# Download and run script to install node 7
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
# Install node 7
apt-get install -y nodejs
# Install 'typescript' node package
npm install -g typescript
# Install 'gulp' node package
npm install -g gulp
# Install 'angular-cli' node package
npm install -g @angular/cli
# Clone 'TechRadar' repository
git clone https://github.com/developersworkspace/TechRadar.git
# Replace domain
sed -i -- "s/yourdomain.com/$domain/g" ./TechRadar/web/src/environments/environment.prod.ts
sed -i -- "s/yourdomain.com/$domain/g" ./TechRadar/admin/src/environments/environment.prod.ts
sed -i -- "s/yourdomain.com/$domain/g" ./TechRadar/api/src/config.prod.ts
sed -i -- "s/yourdomain.com/$domain/g" ./TechRadar/nginx.conf
# Change directory to 'web'
cd ./TechRadar/web
# Install node packages for 'web'
npm install
# Build 'web'
npm run build
# Change directory to 'api'
cd ./../api
# Install node packages for 'api'
npm install
# Build 'api'
npm run build
# Change directory to 'admin'
cd ./../admin
# Install node packages for 'admin'
npm install
# Build 'admin'
npm run build
# Change to root of repository
cd ./../
# Build docker images
docker-compose build --no-cache
# Run docker compose as deamon
docker-compose up -d
# -- INSTALL NGINX --
# Update machine package indexes
sudo apt-get update
# Install NGINX
sudo apt-get install -y nginx
# Add rule to firewall
sudo ufw allow 'Nginx HTTP'
# Download nginx.conf to NGINX directory
curl -o /etc/nginx/nginx.conf https://raw.githubusercontent.com/developersworkspace/TechRadar/master/nginx.conf
# Restart NGINX
systemctl restart nginx
# Open 8181 port
sudo ufw allow 8181/tcp