blob: 24835260e9bec71a22868eb3eed236090977f0c0 [file] [log] [blame]
Richard Felkl26525492018-02-14 17:00:40 +01001#!/bin/bash
2DIR="$PWD"
3while getopts "d:" option
4do
5 case "${option}"
6 in
7 d|\?) DIR="${OPTARG}";;
8 esac
9done
10
11mkdir $DIR
12
13PAYLOAD_LINE=`awk '/^__PAYLOAD_BELOW__/ {print NR + 1; exit 0; }' $0`
14
15tail -n+$PAYLOAD_LINE $0 | tar xzv -C $DIR
16
17REPOS="$(ls -1 $DIR)"
18
19for REPO in $REPOS
20do
21 aptly repo add $REPO $DIR/$REPO
22 SNAPSHOT_NAME="$REPO-$(date +%Y%m%d-%H%M%S)"
23 aptly snapshot create $SNAPSHOT_NAME from repo $REPO
24done
25
26aptly_publish_update.sh -av
27
28exit 0
29
30__PAYLOAD_BELOW__