forked from Graylog2/graylog2-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_release.sh
executable file
·47 lines (34 loc) · 908 Bytes
/
build_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
#!/bin/bash
BUILD_NUMBER=$1
BUILD_NAME=graylog2-server-$BUILD_NUMBER
BUILD_DIR=builds/$BUILD_NAME
BUILD_DATE=`date`
LOGFILE=`pwd`/logs/$BUILD_NAME
# Check if required version parameter is given
if [ -z $BUILD_NUMBER ]; then
echo "ERROR: Missing parameter. (build number)"
exit 1
fi
# Create directories
mkdir -p logs
mkdir -p builds
mkdir -p $BUILD_DIR
# Create logfile
touch $LOGFILE
date >> $LOGFILE
echo "BUILDING $BUILD_NAME"
# Add build date to release.
echo $BUILD_DATE > $BUILD_DIR/build_date
echo "Copying files ..."
# Copy files.
cp ../dist ../README ../COPYING $BUILD_DIR -r
# Copy example config file
cp ../misc/graylog2.conf $BUILD_DIR/graylog2.conf.example
# Copy control script
cp copy/bin $BUILD_DIR -r
cd builds/
# tar it
echo "Building Tarball ..."
tar cfz $BUILD_NAME.tar.gz $BUILD_NAME
rm -rf ./$BUILD_NAME
echo "DONE! Created Graylog2 release $BUILD_NAME on $BUILD_DATE"