-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·42 lines (41 loc) · 883 Bytes
/
deploy.sh
File metadata and controls
executable file
·42 lines (41 loc) · 883 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
#!/bin/bash
if [ -n "$CI_BUILD_REF_NAME" ]
then
if [ "$CI_BUILD_REF_NAME" == "dev" ]
then
export DIR=/apitests/dev
echo "dev branch deploing to" $DIR
rm -r $DIR/*
touch $DIR/.lock
cp -r -f ./* $DIR
rm -f $DIR/.lock
exit
fi
if [ "$CI_BUILD_REF_NAME" == "master" ]
then
export DIR=/apitests/master
echo "master branch deploing to" $DIR
rm -r $DIR/*
touch $DIR/.lock
cp -r -f ./* $DIR
rm -f $DIR/.lock
exit
fi
if [ "$CI_BUILD_REF_NAME" == "release" ]
then
export DIR=/apitests/release
echo "release branch deploing to" $DIR
rm -r $DIR/*
touch $DIR/.lock
cp -r -f ./* $DIR
rm -f $DIR/.lock
exit
fi
if [ "$CI_BUILD_REF_NAME" != "release" ] && [ "$CI_BUILD_REF_NAME" != "master" ] && [ "$CI_BUILD_REF_NAME" != "dev" ]
then
echo "unknown branch was pushed" $CI_BUILD_REF_NAME
exit
fi
else
echo -e "CI_BUILD_REF_NAME not set\n"
fi