-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
35 lines (33 loc) · 883 Bytes
/
deploy.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
#!/usr/bin/env bash
file_deploy () {
if [ ! -z "$TRAVIS_TAG" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
rm -rf dist
npm run build
find dist -type f -exec curl -u $USER:$PASS $HOST -T {} \;
else
echo "This will not deploy!"
fi
}
os_deploy() {
npm run build
cd dist
git clone https://github.com/my-librarian/server-core.git
cd server-core
lastRelease=$(git describe --tags --abbrev=0)
git checkout ${lastRelease}
echo env=openshift > lib/deploy.ini
mkdir -p api
mv handlers api/
mv lib api/
mv index.php api/
mv .htaccess api/
cd ..
mv server-core/api api
rm -rf server-core
git init
echo "api-version=$lastRelease, ui-version=$TRAVIS_TAG" > version.txt
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
git add --all
git commit -am "Deploy version $TRAVIS_TAG"
}