File: deploy.sh

package info (click to toggle)
git-secret 0.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,724 kB
  • sloc: sh: 4,580; makefile: 162; xml: 31; python: 22
file content (48 lines) | stat: -rw-r--r-- 1,127 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env bash

set -e

if [[ "$SECRETS_DEPLOY_DRY_RUN" == 1 ]]; then
  echo 'dry-run finished'
  exit 0
fi

# shellcheck disable=SC1090,SC1091
source "$SECRETS_PROJECT_ROOT/utils/build-utils.sh"
# shellcheck disable=SC1090,SC1091
source "$SECRETS_PROJECT_ROOT/utils/apk/meta.sh"

readonly VERSION_NAME="git-secret-${SCRIPT_VERSION}.apk"

# Artifactory location:
readonly BASE_API_URL='https://gitsecret.jfrog.io/artifactory'


function upload_with_architecture {
  local arch="$1"
  local file_location
  file_location="$(locate_release 'apk' "$arch")"

  curl -sS \
    -u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
    --max-time 10 \
    --retry 3 \
    --retry-delay 5 \
    -XPUT "$BASE_API_URL/git-secret-apk/all/main/$arch/$VERSION_NAME" \
    -T "$file_location"
}

for architecture in "${ALPINE_ARCHITECTURES[@]}"; do
  upload_with_architecture "$architecture"
done

# Now, we need to trigger metadata reindex:
curl -sS \
  -u "$SECRETS_ARTIFACTORY_CREDENTIALS" \
  --max-time 5 \
  --retry 3 \
  --retry-delay 5 \
  -XPOST "$BASE_API_URL/api/alpine/git-secret-apk/reindex"

echo
echo 'Done: released alpine packages'