-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathno.travis.yml
47 lines (47 loc) · 1.92 KB
/
no.travis.yml
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
sudo: required
language: node_js
node_js:
- '14'
services:
- docker
branches:
only:
- master
install:
- npm install
cache:
directories:
- node_modules
script:
- NODE_ENV=test npm run-script test-travis
after_success:
- |
if ([ "$TRAVIS_BRANCH" == "master" ] || [ ! -z "$TRAVIS_TAG" ]) && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
git remote set-url --push origin "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git"
git remote -v
git checkout -f -b version-branch
npm version patch -m "$(git log -1 --pretty=%B) .... bump version [skip ci]"
git push origin version-branch:master --follow-tags
docker login --username yehiyam --password ${DOCKER_HUB_PASS}
PRIVATE_REGISTRY=docker.io/hkube npm run build
curl -X POST -H 'accept:application/json' -H "authorization:token ${TRAVIS_API_TOKEN}" -H 'content-type:application/json' -H 'travis-api-version:3' -d "{\"request\":{\"branch\":\"master\",\"message\":\"triggered by ${TRAVIS_REPO_SLUG}\"}}" "https://api.travis-ci.com/repo/kube-HPC%2Frelease-manager/requests"
elif [ ! -z "$DOCKER_HUB_PASS" ]; then
echo "version skipped!"
echo "creating temp docker image"
docker login --username yehiyam --password ${DOCKER_HUB_PASS}
export DEPLOYMENT_ID=$(./scripts/createGithubDeployment.sh)
echo created deployment with id ${DEPLOYMENT_ID}
STATUS=in_progress ./scripts/updateDeploymentStatus.sh
echo TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
export PR_NAME="${TRAVIS_PULL_REQUEST_BRANCH,,}"
export PR_NAME="${PR_NAME//_/-}"
echo TAG=$PR_NAME
PRIVATE_REGISTRY=docker.io/hkube npm run build
./scripts/install.sh
./scripts/deploy-staging.sh
STATUS=success ./scripts/updateDeploymentStatus.sh
else
echo "version skipped!"
fi