mirror of
https://github.com/FOGProject/fos.git
synced 2026-04-28 08:09:12 -05:00
Activate curl call to create a github release and check JSON response
This commit is contained in:
20
release.sh
20
release.sh
@@ -1,17 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /var/lib/buildkite-agent/github-upload.sh
|
||||
[[ -z ${GITHUB_USER} || -z ${GITHUB_TOKEN} ]] && echo "Missing Github information, can't proceed" && exit 1
|
||||
[[ -z ${GITHUB_USER} || -z ${GITHUB_TOKEN} ]] && echo "Missing Github information, can't proceed." && exit 1
|
||||
|
||||
command -v jqa
|
||||
[[ $? -eq 0 ]] || echo "Package jq not installed, can't proceed" && exit 1
|
||||
command -v curl
|
||||
[[ $? -eq 0 ]] || echo "Package curl not installed, can't proceed." && exit 1
|
||||
command -v jq
|
||||
[[ $? -eq 0 ]] || echo "Package jq not installed, can't proceed." && exit 1
|
||||
|
||||
GITHUB_TAG=$(date +%Y%m%d)
|
||||
GITHUB_NAME="Latest from $(date +%d.%m.%Y)"
|
||||
|
||||
echo "Today is ${today}"
|
||||
curl -X POST -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/releases -d "{ \"tag_name\":\"${GITHUB_TAG}\", \"name\":\"${GITHUB_NAME}\" }" > create_release_response.json
|
||||
|
||||
#buildkite-agent artifact download dist/* .
|
||||
#cd dist/
|
||||
GITHUB_RELEASE_ID=$(cat create_release_response.json | jq -r .id)
|
||||
|
||||
#curl -X POST -u ${GITHUB_USER}:${GITHUB_TOKEN} -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/FOGProject/fos/releases -d "{ \"tag_name\":\"${GITHUB_TAG}\", \"name\":\"${GITHUB_NAME}\" }"
|
||||
[[ -z ${GITHUB_RELEASE_ID} ]] && echo "ID not found in response, something went wrong when trying to create a release on Github." && cat create_release_response.json && exit 1
|
||||
|
||||
buildkite-agent artifact download dist/* .
|
||||
cd dist/
|
||||
|
||||
ls -alR
|
||||
|
||||
Reference in New Issue
Block a user