-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy_to_aws.sh
62 lines (59 loc) · 1.9 KB
/
deploy_to_aws.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
#!/bin/bash
echo 'Starting to Deploy...'
ssh [email protected] << HERE
cd ProduseSiServicii
sudo docker-compose down
sudo docker system prune -f
sudo docker rmi -f findthebusinessfe
sudo docker rmi -f findthebusinessbe
git fetch origin
git reset --hard origin/master
cd FindTheBusinessFE
touch .env
echo "
NODE_ENV=${NODE_ENV}
VUE_APP_STRIPE_PUBLIC_KEY=${VUE_APP_STRIPE_PUBLIC_KEY}
VUE_APP_FACEBOOK_CLIENT_ID=${VUE_APP_FACEBOOK_CLIENT_ID}
VUE_APP_BACKEND=${VUE_APP_BACKEND}
VUE_APP_FRONTEND=${VUE_APP_FRONTEND}
" > .env.production
cd ..
echo "
#client
NODE_ENV=${NODE_ENV}
VUE_APP_STRIPE_PUBLIC_KEY=${VUE_APP_STRIPE_PUBLIC_KEY}
VUE_APP_FACEBOOK_CLIENT_ID=${VUE_APP_FACEBOOK_CLIENT_ID}
VUE_APP_BACKEND=${VUE_APP_BACKEND}
VUE_APP_FRONTEND=${VUE_APP_FRONTEND}
#server
SPRING_ENV=${SPRING_ENV}
JDBC_DATABASE_URL=${JDBC_DATABASE_URL}
JDBC_DATABASE_NAME=${JDBC_DATABASE_NAME}
JDBC_DATABASE_PORT=${JDBC_DATABASE_PORT}
JDBC_DATABASE_USERNAME=${JDBC_DATABASE_USERNAME}
JDBC_DATABASE_PASSWORD=${JDBC_DATABASE_PASSWORD}
AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
AWS_S3_BUCKET=${AWS_S3_BUCKET}
AWS_S3_REGION=${AWS_S3_REGION}
FACEBOOK_APP_ID=${FACEBOOK_APP_ID}
FACEBOOK_SECRET=${FACEBOOK_SECRET}
SPRING_APP_STRIPE=${SPRING_APP_STRIPE}
SPRING_APP_FRONTEND_1=${SPRING_APP_FRONTEND_1}
SPRING_APP_FRONTEND_2=${SPRING_APP_FRONTEND_2}
SPRING_APP_TOKEN_SECRET_REFRESH_TOKEN=${SPRING_APP_TOKEN_SECRET_REFRESH_TOKEN}
SPRING_APP_TOKEN_SECRET_ACCESS_TOKEN=${SPRING_APP_TOKEN_SECRET_ACCESS_TOKEN}
SPRING_APP_TOKEN_SECRET_CHANGE_PASSWORD=${SPRING_APP_TOKEN_SECRET_CHANGE_PASSWORD}
SPRING_APP_TOKEN_SECRET_CHANGE_INFO=${SPRING_APP_TOKEN_SECRET_CHANGE_INFO}
EMAIL_APP_PASS=${EMAIL_APP_PASS}
CRYPT_KEY=${CRYPT_KEY}
" > .env
sudo docker-compose up -d --build
rm -rf .env
cd FindTheBusinessFE
rm -rf .env
rm -rf .env.production
cd ..
cd ..
HERE
echo 'Deployment completed successfully'