Add archiving script
This commit is contained in:
parent
440eb9cdf3
commit
e483f1a17c
1 changed files with 21 additions and 0 deletions
21
archive.sh
Executable file
21
archive.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=$(git describe --exact-match --tags HEAD || git rev-parse HEAD)
|
||||
archive=unl0kr-${version}.tar.gz
|
||||
|
||||
echo "Archiving repository with submodules..."
|
||||
git-archive-all ${archive}
|
||||
|
||||
echo "Uploading archive to GitLab..."
|
||||
response=$(curl --request POST \
|
||||
--header "PRIVATE-TOKEN: $1" \
|
||||
--form "file=@${archive}" \
|
||||
"https://gitlab.com/api/v4/projects/29322771/uploads")
|
||||
|
||||
path=$(echo "${response}" | jq -r .full_path)
|
||||
|
||||
echo "${response}"
|
||||
echo
|
||||
echo "https://gitlab.com/${path}"
|
||||
|
||||
rm -f "${archive}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue