-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.sh
62 lines (48 loc) · 983 Bytes
/
app.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
if [ "$TRAVIS_BRANCH" = "uat" ]
then
CF_SPACE="uat"
fi
if [ "$TRAVIS_BRANCH" = "nft" ]
then
CF_SPACE="nft"
fi
if [ "$TRAVIS_BRANCH" = "testing" ]
then
CF_SPACE="test"
fi
if [ "$TRAVIS_BRANCH" = "pre-production" ]
then
CF_SPACE="preprod"
fi
if [ "$TRAVIS_BRANCH" = "sandbox" ]
then
CF_SPACE="sand"
fi
if [ "$TRAVIS_BRANCH" = "production" ]
then
CF_SPACE="prod"
fi
if [ "$TRAVIS_BRANCH" = "development" ]
then
CF_SPACE="dev"
fi
echo "$CF_SPACE"
sed "s/CF_SPACE/$CF_SPACE/g" manifest-template.yml > manifest.yml
CF_USER=$username
CF_PASS=$password
CF_ORG=$organisation
CF_API_ENDPOINT=$api
CF_ENV=$TRAVIS_BRANCH
# login and target space
cf login -u "$CF_USER" -p "$CF_PASS" -o "$CF_ORG" -a "$CF_API_ENDPOINT" -s "$CF_ENV"
cf target -o "$CF_ORG" -s "$CF_ENV"
ls -l
mkdir deploy
cp -rf dist ./deploy/
cp -rf Staticfile ./deploy/
cp -rf nginx.conf ./deploy/
cp -rf manifest.yml ./deploy/
cp -rf mime.types ./deploy/
cd deploy
cf push