-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmake-partialverse
More file actions
executable file
·57 lines (41 loc) · 1.26 KB
/
make-partialverse
File metadata and controls
executable file
·57 lines (41 loc) · 1.26 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
#!/bin/bash
export PS4='+($(basename $0):${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
set -e
set -x
aptly() {
./bin/aptly -config=aptly.conf $@
}
echo "--- Cleaning existing repository"
rm -rf rootdir
TMP_PACKAGES_FILE="/tmp/Packages.$$"
import-latest() {
PACKAGE_NAME=$1
PACKAGE_PATH=$(egrep "^Filename: .*/${PACKAGE_NAME}_[^/]+.deb" ${TMP_PACKAGES_FILE} | cut -d' ' -f 2)
PACKAGE_FILE=$(basename ${PACKAGE_PATH})
echo $PACKAGE_FILE
wget ${REPOSITORY}/${PACKAGE_PATH}
aptly repo add ${REPO_NAME} ${PACKAGE_FILE}
rm -rf ${PACKAGE_FILE}
}
for remote in remotes/*; do
. $remote
echo "--- Creating a new repository ${REPO_NAME}"
aptly repo create ${REPO_NAME}
curl "${REPOSITORY}/dists/${COMPONENT}/binary-${ARCH_NAME}/Packages.bz2" | bunzip2 > $TMP_PACKAGES_FILE
packages
rm -rf $TMP_PACKAGES_FILE
aptly repo show -with-packages ${REPO_NAME}
aptly publish repo -distribution="${REPO_NAME}" ${REPO_NAME}
done
echo "--- Uploading resulting repository data"
ls -lah rootdir/public
if [ ! -z $PARTIALVERSE_PUSH_S3_BUCKET ]; then
s3cmd sync \
--no-progress \
--follow-symlinks \
--recursive \
--acl-public \
rootdir/public/ ${PARTIALVERSE_PUSH_S3_BUCKET}
else
echo "PARTIALVERSE_PUSH_S3_BUCKET not configured, skipping"
fi