forked from koding/koding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_version.sh
More file actions
executable file
·46 lines (39 loc) · 1002 Bytes
/
create_version.sh
File metadata and controls
executable file
·46 lines (39 loc) · 1002 Bytes
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
#!/bin/bash
# this script checks the environment name acts according to it, will be only
# used in EB envs
#
# if latest, uses the latest-deployment tag's sha
# if production, uses the latest-deployment tag's sha
# else: just use the standart git rev
prods=(
koding-proxy-ap-s-e-1
koding-proxy-eu-west-1
koding-proxy-us-east-1
koding-proxy-us-west-2
koding-prod
)
for i in "${prods[@]}"; do
if [ "$EB_ENV_NAME" == "$i" ]; then
git checkout production-deployment
fi
done
if [ "$EB_ENV_NAME" == "koding-latest" ]; then
git checkout latest-deployment
fi
#
# "koding-proxy-ap-s-e-1"
# "koding-proxy-eu-west-1"
# "koding-proxy-us-east-1"
# "koding-proxy-us-west-2"
# "koding-prod"
#
# "koding-latest"
# "koding-sandbox"
#
# "koding-proxy-dev-us-e-1"
#
version=$(git rev-parse --short HEAD)
# output version file
echo $version >$WERCKER_ROOT/VERSION
# output archive name, that will be used for version archive name
echo $(date "+%Y-%m-%dT%H:%M:%S")_$version.zip >$WERCKER_ROOT/ARCHIVE_NAME