Sha256: 94d0df7072933e429363dd1bdd10476824ef4f7dcf419b235dd8dc212ae33d91

Contents?: true

Size: 928 Bytes

Versions: 18

Compression:

Stored size: 928 Bytes

Contents

#! /bin/bash

DEST=<%= @upload_url %>
RH_USERNAME=<%= @rh_username %>

if [ -z "$FILES" ]
then
        FILES=./*.tar.gz
fi

if [ -n "$CER_PATH" ]
then
        AUTH_KEY="--cert"
        AUTH_VAL="$CER_PATH"
else
        if [ -z "$RH_USERNAME" ]
        then
                IFS= read -rp "Enter username: " RH_USERNAME
        fi

        if [ -z "$RH_PASSWORD" ]
        then
                IFS= read -rsp "Enter password: " RH_PASSWORD
        fi

        AUTH_KEY="-u"
        AUTH_VAL="\"$RH_USERNAME\":\"$RH_PASSWORD\""
fi

# /tmp/a b/x.pem
# curl --cert /tmp/a\ b/x.pem

SCRIPT_DIR=$(realpath "$(dirname "${BASH_SOURCE:-0}")")
DONE_DIR="$SCRIPT_DIR/done/"
mkdir -p $DONE_DIR

for f in $FILES
do
  curl -k -vvv -# --fail -F "file=@$f;type=application/vnd.redhat.qpc.tar+tgz" $DEST "$AUTH_KEY" "$AUTH_VAL"
  if [ $? -eq 0 ]; then
    mv $f $DONE_DIR
    echo "Done: $f"
  fi
done
echo "Uploaded files moved to done/ folder"

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
foreman_rh_cloud-2.0.18.1 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-3.0.18.1 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.18 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-3.0.18 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.17 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-3.0.17 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.16 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-3.0.16 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.15 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-3.0.15 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-3.0.14 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.14 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.13.1 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.13 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.12 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.11 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.10 lib/foreman_inventory_upload/scripts/uploader.sh.erb
foreman_rh_cloud-2.0.9 lib/foreman_inventory_upload/scripts/uploader.sh.erb