2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2020 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
13 # The build minion has the ruby gem "package_cloud"
14 # The required credentials and API files have been provisioned
15 # The build directory has .deb/.rpm files
16 # Environment variables:
17 # BUILD_DIR is set and non-empty
18 # DEBIAN_DISTRIBUTION_VERSIONS has distro list like "debian/stretch"
19 # RPM_DISTRIBUTION_VERSIONS has distro list like "el/4 el/5"
20 # PACKAGECLOUD_ACCOUNT is set and non-empty
21 # PACKAGECLOUD_REPO is a value like "staging"
23 echo "---> packagecloud-push.sh"
26 # Pushes packages to PackageCloud
27 # $1 is a shell-style glob pattern for package files
28 # $2 is a space-separated list of distribution versions
30 echo "Expanding file pattern $1"
31 # shellcheck disable=SC2206
33 if [[ ! -f ${pkgs[0]} ]]; then
34 echo "WARN: no files matched pattern $1"
37 echo "Found package file(s):" "${pkgs[@]}"
38 echo "Processing distribution version(s): $2"
40 arg="${PACKAGECLOUD_ACCOUNT}/${PACKAGECLOUD_REPO}/${ver}"
41 for pkg in "${pkgs[@]}"; do
42 echo "Pushing $arg $pkg"
43 package_cloud push "$arg" "$pkg"
48 echo "Working in directory $BUILD_DIR"
50 push_packages "*.deb" "$DEBIAN_DISTRIBUTION_VERSIONS"
51 push_packages "*.rpm" "$RPM_DISTRIBUTION_VERSIONS"
53 echo "---> packagecloud-push.sh ends"