now using ohfp package method with curl
This commit is contained in:
parent
b3b007f171
commit
5fd44e22af
1 changed files with 27 additions and 7 deletions
|
|
@ -213,13 +213,28 @@ def artifacts():
|
||||||
|
|
||||||
|
|
||||||
# Utility function to upload() function.
|
# Utility function to upload() function.
|
||||||
def do_upload(filename,token):
|
def do_upload1(filename,token):
|
||||||
exec('curl --request POST --header \"PRIVATE-TOKEN: {}\" --form \"file=@{}\" \"https://gitlab.com/api/v4/projects/13852981/uploads\" > tmp.json'.format(token,filename), False)
|
exec('curl --request POST --header \"PRIVATE-TOKEN: {}\" --form \"file=@{}\" \"https://gitlab.com/api/v4/projects/13852981/uploads\" > tmp.json'.format(token,filename), False)
|
||||||
exec('echo $(cat tmp.json | jq .alt | cut -c 2- | sed \'s/.$//\') \'--->\' https://gitlab.com$(cat tmp.json | jq .full_path | cut -c 2- | sed \'s/.$//\') ')
|
exec('echo $(cat tmp.json | jq .alt | cut -c 2- | sed \'s/.$//\') \'--->\' https://gitlab.com$(cat tmp.json | jq .full_path | cut -c 2- | sed \'s/.$//\') ')
|
||||||
exec('cat tmp.json')
|
exec('cat tmp.json')
|
||||||
exec('echo "" && rm -f tmp.json')
|
exec('echo "" && rm -f tmp.json')
|
||||||
|
|
||||||
|
|
||||||
|
# Utility function to upload() function.
|
||||||
|
#
|
||||||
|
#curl --request PUT \
|
||||||
|
# --upload-file whatever.tar.bz2 \
|
||||||
|
# --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" \
|
||||||
|
# https://gitlab.com/api/v4/projects/${PROJECT_ID}/packages/generic/librewolf/latest/whatever.tar.bz2
|
||||||
|
#
|
||||||
|
def do_upload2(filename,token):
|
||||||
|
project_id='13852981'
|
||||||
|
exec('curl --request PUT --upload-file "{}" --header "PRIVATE-TOKEN: {}" "https://gitlab.com/api/v4/projects/{}/packages/generic/librewolf/latest/{}" > tmp.json'.format(filename, token, project_id, filename), False)
|
||||||
|
exec('echo $(cat tmp.json | jq .alt | cut -c 2- | sed \'s/.$//\') \'--->\' https://gitlab.com$(cat tmp.json | jq .full_path | cut -c 2- | sed \'s/.$//\') ')
|
||||||
|
exec('cat tmp.json')
|
||||||
|
exec('echo "" && rm -f tmp.json')
|
||||||
|
|
||||||
|
|
||||||
def upload(token):
|
def upload(token):
|
||||||
|
|
||||||
with open('version','r') as file1:
|
with open('version','r') as file1:
|
||||||
|
|
@ -246,18 +261,23 @@ def upload(token):
|
||||||
else:
|
else:
|
||||||
exec('sha256sum {} {} > sha256sums.txt'.format(setup_filename,pazip_filename))
|
exec('sha256sum {} {} > sha256sums.txt'.format(setup_filename,pazip_filename))
|
||||||
|
|
||||||
|
#
|
||||||
# create signatures
|
# create signatures
|
||||||
|
#
|
||||||
|
|
||||||
exec('gpg --yes --detach-sign {}'.format(setup_filename))
|
exec('gpg --yes --detach-sign {}'.format(setup_filename))
|
||||||
exec('echo "Press Control-D to continue (is this still needed?)..." ; cat > /dev/null')
|
exec('echo "Press Control-D to continue (is this still needed?)..." ; cat > /dev/null')
|
||||||
exec('gpg --yes --detach-sign {}'.format(pazip_filename))
|
exec('gpg --yes --detach-sign {}'.format(pazip_filename))
|
||||||
|
|
||||||
|
#
|
||||||
# upload everything
|
# upload everything
|
||||||
exec('rm -f upload.txt')
|
#
|
||||||
do_upload(setup_filename,token)
|
|
||||||
do_upload(pazip_filename,token)
|
do_upload1('{}.sig'.format(setup_filename),token)
|
||||||
do_upload('{}.sig'.format(setup_filename),token)
|
do_upload1('{}.sig'.format(pazip_filename),token)
|
||||||
do_upload('{}.sig'.format(pazip_filename),token)
|
do_upload1('sha256sums.txt',token)
|
||||||
do_upload('sha256sums.txt',token)
|
do_upload2(setup_filename,token)
|
||||||
|
do_upload2(pazip_filename,token)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue