forked from tuanpembual/pabrik-cc
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrelease-image
executable file
·131 lines (106 loc) · 2.87 KB
/
release-image
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/bash
if [ -n "$DEBUG" ];then
set -x
fi
set -e
export INTERNALCALL=1
if [ -d /usr/share/pabrik-cc ]; then
export CC_DIR=/usr/share/pabrik-cc
elif [ -d `pwd`/pabrik-cc ];then
export CC_DIR=./pabrik-cc
fi
if [ -z $CC_DIR ];then
echo "Broken setup, CC_DIR is not found"
exit 1
fi
while getopts ":d:r:p:t:" opt; do
case $opt in
d)
echo "Using Source Directory $OPTARG" >&2
export CURRENT_DIR=$OPTARG
;;
r)
echo "Using Release Tag $OPTARG" >&2
export RELEASE_TAG=$OPTARG
;;
p)
echo "Using Publish Directory $OPTARG" >&2
export PUBLISH=$OPTARG
;;
t)
echo "Using Temporary Directory $OPTARG" >&2
export TMP=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
. gpg-sign.conf
if [ -z "$TMP" ]; then
export TMP=/home/cdimage/pabrik-cc/tmp/release-image
echo "Using Temporary Directory $TMP" >&1
fi
if [ -z "$CURRENT_DIR" -o -z "$RELEASE_TAG" -o -z "$PUBLISH" ];then
echo "Usage: $0 -d DAILY_BUILD_DIR -r RELEASE_TAG -p PUBLISH_DIR"
exit 1
fi
if [ ! -d "$CURRENT_DIR" ]; then
echo "CURRENT DIR not found"
exit 1
fi
if [ -f $CURRENT_DIR/build.conf ];then
source $CURRENT_DIR/build.conf
else
echo "build.conf does not exist. Can't continue"
exit 1
fi
DISTRO=$DIST
export DISK_ID=`basename $CURRENT_DIR`
mkdir -p $PUBLISH
for ARCH in $ARCHS
do
export CDVOLUME=$CDVOLUME
export ARCH=$ARCH
export ISO_ORIGINAL="$DIST-$VARIANT-$ARCH.iso"
export DISK_ORIGINAL="$CURRENT_DIR/$ISO_ORIGINAL"
export DISK_MOUNTED=$DISK_ID-mounted
export DISK_BUILD=$DISK_ID-disk-$ARCH
export DISK=$TMP/$DISK_BUILD
export DIST=$DIST
export MAX_SIZE=$MAX_SIZE
export VARIANT=$VARIANT
echo "Processing ARCH $ARCH"
$CC_DIR/copy-image
export DIST="$DIST $RELEASE_TAG"
$CC_DIR/disk-info
export DIST=$DISTRO
$CC_DIR/genisoimage
export ISO_NEW="BlankOn-$RELEASE_TAG-$VARIANT-$ARCH.iso"
mv $TMP/$ISO_ORIGINAL $PUBLISH/$ISO_NEW
OLD_LIST="$DIST-$VARIANT-$ARCH.list"
NEW_LIST="BlankOn-$RELEASE_TAG-$VARIANT-$ARCH.list"
cp $CURRENT_DIR/$OLD_LIST $PUBLISH/$NEW_LIST
pushd $PUBLISH
md5sum $ISO_NEW > $ISO_NEW.md5
sha1sum $ISO_NEW > $ISO_NEW.sha1
sha256sum $ISO_NEW > $ISO_NEW.sha256
zsyncmake $ISO_NEW
popd
$CC_DIR/sign-release -f "$PUBLISH/$ISO_NEW.md5" -p "$PUBLISH"
$CC_DIR/sign-release -f "$PUBLISH/$ISO_NEW.sha1" -p "$PUBLISH"
$CC_DIR/sign-release -f "$PUBLISH/$ISO_NEW.sha256" -p "$PUBLISH"
# $CC_DIR/make-torrent $PUBLISH $ISO_NEW
rm -rf $DISK
echo "ARCH $ARCH's ISO done"
done
cp $CURRENT_DIR/build.conf $PUBLISH/
rm -rf $TMP
pushd $PUBLISH
btlaunchmanycurses . &
popd