-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreleaseScript
More file actions
executable file
·112 lines (81 loc) · 3.05 KB
/
releaseScript
File metadata and controls
executable file
·112 lines (81 loc) · 3.05 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# releaseScript
#
# Copyright 2016-2017 Malcolm Reid Jr.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This is a script to streamline making a release
# (1) Make $HOME/Desktop directory with proper format (yyyy-mm-dd-swamp_eclipse_plugin)
# (2) rm -f README.html
# (3) run asciidoc README.adoc
# (4) move README.html to the new directory
# (5) run /p/swamp/bin/asciidoctor -pdf README.adoc
# (6) move README.pdf to new directory
# (7) cd to eclipseplugin/doc
# (8) copy SWAMP_hosts.json to new directory
# (9) copy .marker_preferences to new directory
# (10) add to RELEASE_NOTES.txt
# (11) copy update-site into the Desktop dir
# (12) zip it
# (13) Create an archive and put it in the Desktop dir
: ${1?"Usage: $0 versionNumber"}
ARCHIVE_NAME="swamp_eclipse_plugin"
START_DIR=$PWD
SEPARATOR_LINE="---------------------------------------------"
TIMESTAMP=$(date +%Y-%m-%d)
VERSION=$1
echo "Version: "$VERSION
dir_name=$HOME/Desktop/
dir_name+=$TIMESTAMP
dir_name+="-"$ARCHIVE_NAME
rm -f $dir_name
mkdir $dir_name
echo "Created "$dir_name
rm -f README.html
#asciidoc README.adoc
asciidoctor-pdf -o README.html README.adoc
echo "Generated README.html"
mv README.html $dir_name
cp -r eclipseplugin/doc/images $dir_name
echo "Moved README.html to "$dir_name
#/p/swamp/bin/asciidoctor -r asciidoctor-pdf -b pdf README.adoc
asciidoctor-pdf -b pdf README.adoc
echo "Generated README.pdf"
mv README.pdf $dir_name
echo "Moved README.pdf to "$dir_name
cd eclipseplugin/doc
cp SWAMP_hosts.json $dir_name
echo "Moved SWAMP_hosts.json to "$dir_name
cp .marker_preferences $dir_name
echo "Moved .marker_preferences to "$dir_name
echo "RELEASE_NOTES.txt" > tmpfile
echo $SEPARATOR_LINE >> tmpfile
echo $TIMESTAMP >> tmpfile
echo "Version: "$VERSION >> tmpfile
echo $SEPARATOR_LINE >> tmpfile
cat RELEASE_NOTES.txt >> tmpfile
mv tmpfile $dir_name"/RELEASE_NOTES.txt"
echo "Formatted release_notes and moved RELEASE_NOTES.txt to "$dir_name
cp -r $START_DIR/swamp-eclipse-update-site/ $dir_name/update-site
rm -rf $dir_name/update-site/.git
zip -r $dir_name{.zip,}
echo "Created archive for GitHub releases and Google Drive"
#cp -r $HOME/public/html-s/swamp-eclipse swamp-eclipse-plugin-$VERSION
cp -r $START_DIR/swamp-eclipse-update-site swamp-eclipse-plugin-$VERSION
$START_DIR/signJars swamp-eclipse-plugin-$VERSION
echo rm -rf swamp-eclipse-plugin-$VERSION/.git
rm -rf swamp-eclipse-plugin-$VERSION/.git
tar -cvzf $START_DIR/swamp-eclipse-plugin-${VERSION}.tar swamp-eclipse-plugin-$VERSION
rm -rf swamp-eclipse-plugin-$VERSION
echo "Created archive for update site"
cd $START_DIR