3 # Copyright (C) The Arvados Authors. All rights reserved.
5 # SPDX-License-Identifier: AGPL-3.0
13 if [[ `id -u -n` != "jenkinsapt" ]]; then
14 echo "This script must be run as the `jenkinsapt` user"
18 if [[ -z "$DISTRO" ]]; then
19 echo "Syntax: $0 <distro>"
23 # Check that a FileSystemPublishEndpoint has been added in ~jenkinsapt/.aptly.conf
25 TMP=`cat ~jenkinsapt/.aptly.conf | jq .FileSystemPublishEndpoints.$DISTRO |grep rootDir`
27 if [[ "$TMP" == "" ]]; then
28 echo "Please edit ~jenkinsapt/.aptly.conf and add a FileSystemPublishEndpoint for $DISTRO first"
34 # Double check if this repository is already defined
36 EXISTING=`aptly repo list 2>&1 |grep $DISTRO`
39 if [[ "$EXISTING" != "" ]]; then
40 echo "This release exists already, judging by the output of 'aptly repo list'"
47 echo "WARNING! Please use the human name for the distribution release, e.g. bullseye for Debian 11, or focal for Ubuntu 20.04"
50 read -r -p "Create the repositories for $DISTRO with aptly, are you sure? (y/n) " response
63 aptly repo create --comment "Development builds" --distribution "$DISTRO-dev" $DISTRO-dev
64 aptly repo edit -architectures="amd64" $DISTRO-dev
65 aptly repo show $DISTRO-dev
68 aptly repo create --comment "Testing builds" --distribution "$DISTRO-testing" $DISTRO-testing
69 aptly repo edit -architectures="amd64" $DISTRO-testing
70 aptly repo show $DISTRO-testing
73 aptly repo create --comment "Release builds" --distribution "$DISTRO" $DISTRO
74 aptly repo edit -architectures="amd64" $DISTRO
75 aptly repo show $DISTRO
78 aptly repo create --comment "Attic" --distribution "$DISTRO-attic" $DISTRO-attic
79 aptly repo edit -architectures="amd64" $DISTRO-attic
80 aptly repo show $DISTRO-attic
84 aptly publish repo -architectures "amd64, arm64" $DISTRO-dev filesystem:$DISTRO:.
85 aptly publish show $DISTRO-dev filesystem:$DISTRO:.
88 aptly publish repo -architectures "amd64, arm64" $DISTRO-testing filesystem:$DISTRO:.
89 aptly publish show $DISTRO-testing filesystem:$DISTRO:.
92 aptly publish repo -architectures "amd64, arm64" $DISTRO filesystem:$DISTRO:.
93 aptly publish show $DISTRO filesystem:$DISTRO:.
96 aptly publish repo -architectures "amd64, arm64" $DISTRO-attic filesystem:$DISTRO:.
97 aptly publish show $DISTRO-attic filesystem:$DISTRO:.
99 # Show all the published repos
100 aptly publish list |grep $DISTRO