-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplantTree.template.sh
executable file
·74 lines (55 loc) · 1.97 KB
/
plantTree.template.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
#!/bin/bash
echo "****⛏🌳 Planting the Tree ****"
echo "👾👾👾👾👾👾👾👾👾👾"
echo "🌲"
echo "🎄🎄🎄🎄"
echo "🌳"
echo "🌷"
echo "🍁"
echo "👾👾👾👾👾👾👾👾👾👾"
echo "⛳️Digging the hole for the tree"
######################################################
######################################################
# These values need to be customized for your computer and remote Linux server
######
mode="staging" # OR "production"
pemPath="/Users/user-name/user-files/super-secret-path/linux-server-access-file.pem"
sourceRepoPath="/Users/user-name/my-code-folder/bitcoin-api-full-stack"
destinationUserName="ec2-user"
destinationUrl="ec2-instance-name.ec2-instance-region.compute.amazonaws.com"
destinationHomePath="/home/ec2-user"
######################################################
######################################################
### The code below is taken care of by Bitcoin-Api😁✌🕊💕🏛 ###
treePath="${sourceRepoPath}/1-backend/giraffeDeploy/tree"
commonUtilitiesPath="${sourceRepoPath}/1-backend/giraffeDeploy/commonUtilities"
destinationPath="${destinationHomePath}/treeDeploy/giraffeDeploy"
treenvPath="${sourceRepoPath}/1-backend/${mode}Credentials/tree"
treenvDestinationPath="${destinationHomePath}/treeDeploy/stagingCredentials/tree/.env"
for environmentalActivistPath in \
$treePath \
$commonUtilitiesPath
do
pushd $environmentalActivistPath
rm -rf ./node_modules
popd
done
echo "⛰The planting has commenced🌋"
scp \
-i $pemPath \
-r \
$treePath \
$commonUtilitiesPath \
"${destinationUserName}@${destinationUrl}:${destinationPath}"
scp \
-i $pemPath \
$treenvPath \
"${destinationUserName}@${destinationUrl}:${treenvDestinationPath}"
echo "💦A new tree lives☀️"
echo "👾👾👾👾👾👾👾👾👾👾"
echo "🌲"
echo "🎄🎄🎄🎄"
echo "🌳"
echo "🌷"
echo "🍁"
echo "****⛏🌳 Successfully Planted Tree ****"