Skip to content

Commit 5d539a6

Browse files
committed
update deploy script
1 parent 07ffade commit 5d539a6

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

circle.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
machine:
2+
node:
3+
version: 7.5.0
4+
5+
deployment:
6+
production:
7+
branch: production
8+
commands:
9+
- ./deploy-production.sh
10+
staging:
11+
branch: master
12+
commands:
13+
- ./deploy-staging.sh

deploy.sh

+6-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ -n "$NOW_DOMAIN" ]
55
then
66

77
echo "Deploying "$NOW_DOMAIN
8-
DEPLOY=$(now --token=$NOW_TOKEN -n $NOW_DOMAIN)
8+
now --docker --token=$NOW_TOKEN -n $NOW_DOMAIN
99
echo ""
1010

1111
else
@@ -14,17 +14,7 @@ else
1414

1515
fi
1616

17-
#Find the ID
18-
if [ -n "$DEPLOY" ]
19-
then
20-
21-
CURRENTID=$(now --token=$NOW_TOKEN ls $NOW_DOMAIN | awk '/.*([A-Za-z0-9]{24}).*/ { print $1; }'| head -n 1 )
22-
else
23-
24-
echo "Deployment did not occur. Something is wrong."
25-
exit
26-
27-
fi
17+
CURRENTID=$(now --token=$NOW_TOKEN ls $NOW_DOMAIN | awk '/.*([A-Za-z0-9]{24}).*/ { print $1; }'| head -n 1 )
2818

2919
# Alias the site and remove old aliases
3020
if [ -n "$CURRENTID" ]
@@ -46,11 +36,13 @@ then
4636
echo "$NOW_DOMAIN used to be aliased to $OLDALIAS, we should remove that."
4737
echo "Removing old aliases..."
4838
now --token=$NOW_TOKEN ls $NOW_DOMAIN | grep -v "$CURRENTID" | awk '/.*([A-Za-z0-9]{24}).*/ { print $1; }' | xargs -I{} now --token=$NOW_TOKEN -y rm {}
49-
39+
exit
5040
fi
5141
else
5242
echo "We can not find a current alias."
43+
exit
5344
fi
5445
else
55-
echo "We cannot find a current ID."
46+
echo "We cannot find a current ID. Maybe "
47+
exit
5648
fi

0 commit comments

Comments
 (0)