File: release

package info (click to toggle)
cdist 7.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,992 kB
  • sloc: sh: 16,815; python: 9,199; makefile: 344; awk: 261
file content (50 lines) | stat: -rwxr-xr-x 1,280 bytes parent folder | download | duplicates (4)
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
49
50
#!/bin/sh -e

set -x

printf "Enter tag name: "
read tag
printf "Enter repository authentication token: "
read token

git tag -d "${tag}" || :

git tag "${tag}" -m "Release ${tag}"
git push origin "${tag}"

echo 'foo' > foo
echo 'foo signature' > foo.asc

archivename="foo"

project="poljakowski%2Fmy-cdist-testing"
sed_cmd='s/^.*"markdown":"\([^"]*\)".*$/\1/'

# upload archive
response_archive=$(curl -f -X POST \
     -H "PRIVATE-TOKEN: ${token}" \
     -F "file=@${archivename}" \
     "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \
     | sed "${sed_cmd}") || exit 1

# upload archive signature
response_archive_sig=$(curl -f -X POST \
     -H "PRIVATE-TOKEN: ${token}" \
     -F "file=@${archivename}.asc" \
    "https://code.ungleich.ch/api/v4/projects/${project}/uploads" \
     | sed "${sed_cmd}") || exit 1

# make release
curl -f -X POST \
     -H "PRIVATE-TOKEN: ${token}" \
     -F "description=Release ${tag}<br/>${response_archive}<br/>${response_archive_sig}" \
    "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}/release" \
    || exit 1

# get tag
curl -f -X GET \
     -H "PRIVATE-TOKEN: ${token}" \
    "https://code.ungleich.ch/api/v4/projects/${project}/repository/tags/${tag}" \
    || exit 1

rm -f foo foo.asc