ansible-module/upload.sh

16 Zeilen
517 B
Bash

#!/bin/bash
user=$(yq -r .namespace galaxy.yml)
package=$(yq -r .name galaxy.yml)
version=$(yq -r .version galaxy.yml)
printf "Namespace: %s\nPackage: %s\nVersion: %s\n" $user $package $version
upload(){
name=$(basename "$1")
printf "uploading: %s as %s\n" "$1" "$name"
curl -u sebastian --upload-file "$1" "https://gitea.sebastian-tobie.de/api/packages/ansible/generic/${package}/${version}/$name"
}
for file in dist/sebastian* ; do
upload "$file"
done
rm -f dist/sebastian*
hatch publish -r ansible