-
Notifications
You must be signed in to change notification settings - Fork 2
/
release.sh
70 lines (46 loc) · 2.21 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
# verify prerequisites
git diff --exit-code > /dev/null
if [[ $? != 0 ]]; then
echo you have uncommitted changes
exit
fi
git diff --cached --exit-code > /dev/null
if [[ $? != 0 ]]; then
echo you have uncommitted changes
exit
fi
set -e
echo -n "prior version: "
read prior_version
echo -n "new version: "
read new_version
sed -i s/$prior_version/$new_version/g site/*.html
git diff
echo -n "Proceed? [y/N] "
read -n 1 proceed
echo
if [[ $proceed != "Y" && $proceed != "y" ]]; then
exit 1
fi
git add -u
git commit -m "Release version $new_version: update links"
if [[ $USE_MAVEN_JAVADOC ]]; then
(mkdir site/javadoc/agent-api/$new_version && cd site/javadoc/agent-api/$new_version && curl https://repo1.maven.org/maven2/org/glowroot/glowroot-agent-api/$new_version/glowroot-agent-api-$new_version-javadoc.jar | jar x)
(mkdir site/javadoc/agent-plugin-api/$new_version && cd site/javadoc/agent-plugin-api/$new_version && curl https://repo1.maven.org/maven2/org/glowroot/glowroot-agent-plugin-api/$new_version/glowroot-agent-plugin-api-$new_version-javadoc.jar | jar x)
else
(mkdir site/javadoc/agent-api/$new_version && cd site/javadoc/agent-api/$new_version && jar xf /c/git/glowroot/agent/api/target/glowroot-agent-api-$new_version-javadoc.jar)
(mkdir site/javadoc/agent-plugin-api/$new_version && cd site/javadoc/agent-plugin-api/$new_version && jar xf /c/git/glowroot/agent/plugin-api/target/glowroot-agent-plugin-api-$new_version-javadoc.jar)
fi
git add site/javadoc/agent-api/$new_version
git add site/javadoc/agent-plugin-api/$new_version
git commit -m "Release version $new_version: update javadocs"
git push
npm install
bower install
grunt
mkdir -p dist/latest
curl -L -o dist/latest/glowroot-latest-dist.zip https://github.com/glowroot/glowroot/releases/download/v$new_version/glowroot-$new_version-dist.zip
curl -L -o dist/latest/glowroot-central-latest-dist.zip https://github.com/glowroot/glowroot/releases/download/v$new_version/glowroot-central-$new_version-dist.zip
curl -L -o dist/latest/glowroot-central-latest-dist.war https://github.com/glowroot/glowroot/releases/download/v$new_version/glowroot-central-$new_version-dist.war
AWS_DEFAULT_REGION=us-east-1 aws.exe s3 sync dist s3://glowroot.org