forked from TouK/nussknacker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathciBuildOnMaster.sh
executable file
·36 lines (30 loc) · 1.17 KB
/
ciBuildOnMaster.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
#!/usr/bin/env bash
nexusPassword=$1
nexusUrl=$2
githubToken=$3
set -e
currentHashCommit=`git rev-parse HEAD`
formattedDate=`date '+%Y-%m-%d-%H-%M'`
currentVersion=`cat version.sbt | grep "version in ThisBuild :=" | grep -Po '\K([^"]*)(?=-SNAPSHOT)'`
version=${formattedDate}-${currentHashCommit}-${currentVersion}
if [ -z "$nexusPassword" ]; then
echo "nexusPassword missing"; exit -1
fi
if [ -z "$nexusUrl" ]; then
echo "nexusUrl missing"; exit -1
fi
cd ui/client && npm ci && cd -
echo publishing nussknacker version: $version
./sbtwrapper clean test management/it:test engineStandalone/it:test ui/slow:test
./sbtwrapper -DnexusPassword=${nexusPassword} -DnexusUrl=${nexusUrl} ";set version in ThisBuild := \"$version\";set isSnapshot in ThisBuild := false" publish
if [[ ! -z $githubToken ]]; then
# push to github mirror
git remote | grep github || git remote add github "https://$githubToken:x-oauth-basic@github.com/touk/nussknacker"
git fetch github
git push github HEAD:master
# build & publish github doc
[ -f node_modules/.bin/gitbook ] || npm install gitbook-cli
PATH="$PATH:$(readlink -f node_modules/.bin)"
cd docs
./publishToGithub.sh $githubToken
fi