forked from hal/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·56 lines (49 loc) · 1.6 KB
/
release.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
#!/bin/bash
# Script to build, deploy and publish HAL to branch 'gh-pages'.
# Should be executed after a new version was tagged.
#
# Prerequisites
# - Clean git status (no uncommitted changes)
# - Docker is up and running
#
# What it does
# 1. Build and deploy w/ profiles docker, prod, release, theme-hal and yarn
# 2. Publish the compiled GWT app to branch 'gh-pages'
ROOT=$PWD
BRANCH=$(git symbolic-ref -q HEAD)
BRANCH=${BRANCH##refs/heads/}
BRANCH=${BRANCH:-HEAD}
# Prerequisites
if ! git diff --no-ext-diff --quiet --exit-code; then
echo "Cannot publish to gh-pages. You have uncommitted changes in the current branch."
exit -1
fi
if ! docker info > /dev/null 2>&1; then
echo "Docker not running. Please start docker before running this script."
exit -1
fi
# 1. Deploy using HAL theme to be included in docker and yarn
mvn clean deploy -P docker,prod,release,theme-hal,yarn
# 2. Publishing to gh-pages
rm -rf /tmp/console
cd /tmp/
git clone -b gh-pages --single-branch [email protected]:hal/console.git
cd console
rm -rf *.gif *.html *.ico *.js *.png *.txt css deferredjs fonts img js previews
cp -R ${ROOT}/app/target/hal-console-*/hal/ .
date > .build
git add --all
git commit -am "Update console"
git push -f origin gh-pages
cd ${ROOT}
# 3. Deploy again using WildFly theme to override 'hal-console-resources.jar'
# and to be picked up by WildFly
mvn deploy -P prod,release,theme-wildfly
echo
echo
echo "+-----------------------------+"
echo "| |"
echo "| HAL successfully released |"
echo "| |"
echo "+-----------------------------+"
echo