2021-05-04 18:58:36 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-06-05 07:56:24 +00:00
|
|
|
if [[ "$SECRETS_DEPLOY_DRY_RUN" == 1 ]]; then
|
|
|
|
echo 'dry-run finished'
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2021-05-04 18:58:36 +00:00
|
|
|
# shellcheck disable=SC1090,SC1091
|
2021-05-05 12:59:28 +00:00
|
|
|
source "$SECRETS_PROJECT_ROOT/utils/build-utils.sh"
|
2021-05-04 18:58:36 +00:00
|
|
|
|
|
|
|
# Artifactory location:
|
2022-06-05 07:56:24 +00:00
|
|
|
readonly BASE_API_URL='https://gitsecret.jfrog.io/artifactory'
|
2021-05-04 18:58:36 +00:00
|
|
|
|
|
|
|
# This folder should contain just one `.rpm` file:
|
2022-06-05 08:24:44 +00:00
|
|
|
RPM_FILE_LOCATION="$(locate_release 'rpm')"
|
|
|
|
RPM_FILE_NAME="$(basename "$RPM_FILE_LOCATION")"
|
2021-05-04 18:58:36 +00:00
|
|
|
|
|
|
|
|
2022-06-05 07:56:24 +00:00
|
|
|
curl -sS \
|
|
|
|
-u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
|
2021-05-04 18:58:36 +00:00
|
|
|
-XPUT "$BASE_API_URL/git-secret-rpm/rpm/$RPM_FILE_NAME" \
|
|
|
|
-T "$RPM_FILE_LOCATION"
|
|
|
|
|
|
|
|
# Now, we need to trigger metadata reindex:
|
2022-06-05 07:56:24 +00:00
|
|
|
curl -sS \
|
|
|
|
-u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
|
2021-05-04 18:58:36 +00:00
|
|
|
-XPOST "$BASE_API_URL/api/yum/git-secret-rpm?async=1"
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Done: released $RPM_FILE_NAME"
|