2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2019 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 ##############################################################################
11 echo "---> packagecloud-push.sh"
14 if [ ! -f ~/.packagecloud ]; then
15 echo "INFO: .packagecloud file not found"
20 vers=("$DEBIAN_DISTRIBUTION_VERSIONS")
21 echo "Debian distribution versions:" "${vers[@]}"
22 debs=$(find . -type f -iname '*.deb')
23 # modern bash syntax is helpful
24 for (( i = 0; i < ${#vers[@]}; i++ )); do
26 echo "Pushing $deb $PACKAGECLOUD_ACCOUNT/$PACKAGECLOUD_REPO/${vers[i]}"
27 package_cloud push "$PACKAGECLOUD_ACCOUNT"/"$PACKAGECLOUD_REPO"/"${vers[i]}" "$deb"
32 vers=("$RPM_DISTRIBUTION_VERSIONS")
33 echo "RPM distribution versions:" "${vers[@]}"
34 rpms=$(find . -type f -iregex '.*/.*\.\(s\)?rpm')
35 # modern bash syntax is helpful
36 for (( i = 0; i < ${#vers[@]}; i++ )); do
38 echo "Pushing $rpm $PACKAGECLOUD_ACCOUNT/$PACKAGECLOUD_REPO/${vers[i]}"
39 package_cloud push "$PACKAGECLOUD_ACCOUNT"/"$PACKAGECLOUD_REPO"/"${vers[i]}" "$rpm"