-
Notifications
You must be signed in to change notification settings - Fork 0
/
runscript.sh
executable file
·90 lines (75 loc) · 2.19 KB
/
runscript.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
88
89
90
#!/bin/bash
ENVFILE=".env"
#Stupid if statements, googles says there should be multiple for loop like solutions, but I couldn't get any to work in 5 minutes
if [[ -v NODE_ENV ]] && [[ $NODE_ENV == "production" ]] ; then
echo "Running in prod mode"
touch /node-express-mongoose-demo/.env
else
if [[ -v FACEBOOK_CLIENTID ]]; then
echo "FACEBOOK_CLIENTID=${FACEBOOK_CLIENTID}" >> $ENVFILE
else
echo 'FACEBOOK_CLIENTID=<ID>' >> $ENVFILE
fi
if [[ -v FACEBOOK_SECRET ]]; then
echo "FACEBOOK_SECRET=${FACEBOOK_CLIENTID}" >> $ENVFILE
else
echo 'FACEBOOK_SECRET=<SECRET>' >> $ENVFILE
fi
if [[ -v TWITTER_CLIENTID ]]; then
echo "TWITTER_CLIENTID=${TWITTER_CLIENTID}" >> $ENVFILE
else
echo 'TWITTER_CLIENTID=<ID>' >> $ENVFILE
fi
if [[ -v TWITTER_SECRET ]]; then
echo "TWITTER_SECRET=${TWITTER_CLIENTID}" >> $ENVFILE
else
echo 'TWITTER_SECRET=<SECRET>' >> $ENVFILE
fi
if [[ -v GITHUB_CLIENTID ]]; then
echo "GITHUB_CLIENTID=${GITHUB_CLIENTID}" >> $ENVFILE
else
echo 'GITHUB_CLIENTID=<ID>' >> $ENVFILE
fi
if [[ -v GITHUB_SECRET ]]; then
echo "GITHUB_SECRET=${GITHUB_CLIENTID}" >> $ENVFILE
else
echo 'GITHUB_SECRET=<SECRET>' >> $ENVFILE
fi
if [[ -v LINKEDIN_CLIENTID ]]; then
echo "LINKEDIN_CLIENTID=${LINKEDIN_CLIENTID}" >> $ENVFILE
else
echo 'LINKEDIN_CLIENTID=<ID>' >> $ENVFILE
fi
if [[ -v LINKEDIN_SECRET ]]; then
echo "LINKEDIN_SECRET=${LINKEDIN_CLIENTID}" >> $ENVFILE
else
echo 'LINKEDIN_SECRET=<SECRET>' >> $ENVFILE
fi
if [[ -v GOOGLE_CLIENTID ]]; then
echo "GOOGLE_CLIENTID=${GOOGLE_CLIENTID}" >> $ENVFILE
else
echo 'GOOGLE_CLIENTID=<ID>' >> $ENVFILE
fi
if [[ -v GOOGLE_SECRET ]]; then
echo "GOOGLE_SECRET=${GOOGLE_CLIENTID}" >> $ENVFILE
else
echo 'GOOGLE_SECRET=<SECRET>' >> $ENVFILE
fi
if [[ -v IMAGER_S3_KEY ]]; then
echo "IMAGER_S3_KEY=${IMAGER_S3_KEY}" >> $ENVFILE
else
echo 'IMAGER_S3_KEY=AWS_S3_KEY' >> $ENVFILE
fi
if [[ -v IMAGER_S3_SECRET ]]; then
echo "IMAGER_S3_SECRET=${IMAGER_S3_SECRET}" >> $ENVFILE
else
echo 'IMAGER_S3_SECRET=AWS_S3_SECRET' >> $ENVFILE
fi
if [[ -v IMAGER_S3_BUCKET ]]; then
echo "IMAGER_S3_BUCKET=${IMAGER_S3_BUCKET}" >> $ENVFILE
else
echo 'IMAGER_S3_BUCKET=AWS_S3_BUCKET' >> $ENVFILE
fi
fi
# start app
npm start