buffybox/archive.sh

22 lines
518 B
Bash
Raw Normal View History

2023-02-25 20:35:27 +01:00
#!/bin/bash
version=$(git describe --exact-match --tags HEAD || git rev-parse HEAD)
archive=buffybox-${version}.tar.gz
2023-02-25 20:35:27 +01:00
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/52322952/uploads")
2023-02-25 20:35:27 +01:00
path=$(echo "${response}" | jq -r .full_path)
echo "${response}"
echo
2023-02-25 21:20:04 +01:00
echo "https://gitlab.com${path}"
2023-02-25 20:35:27 +01:00
rm -f "${archive}"