final sytax fix
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
f20df46d00
commit
44256d7b10
75
.drone.yml
75
.drone.yml
@ -81,6 +81,18 @@ volumes:
|
||||
kind: pipeline
|
||||
name: upload
|
||||
|
||||
environment:
|
||||
B2_ACCOUNT:
|
||||
from_secret: b2_account
|
||||
B2_BUCKET_ID:
|
||||
from_secret: b2_bucketId
|
||||
B2_TOKEN:
|
||||
from_secret: b2_token
|
||||
B2_KEY_ID:
|
||||
from_secret: b2_keyId
|
||||
B2_KEY:
|
||||
from_secret: b2_key
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
@ -90,49 +102,38 @@ clone:
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- master
|
||||
- dev
|
||||
- master
|
||||
- dev
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
- push
|
||||
- tag
|
||||
status:
|
||||
- success
|
||||
- failure
|
||||
- success
|
||||
- failure
|
||||
|
||||
depends_on:
|
||||
- test-set-default
|
||||
- test-set-default
|
||||
|
||||
steps:
|
||||
- name: backblaze-b2
|
||||
pull: always
|
||||
image: immawanderer/archlinux-rf:latest
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /run/cache
|
||||
commands:
|
||||
- ls -la /run/cache
|
||||
- export FILE_TO_UPLOAD=$(ls /run/cache | head -1)
|
||||
- export MIME_TYPE=text/plain
|
||||
- export SHA1_OF_FILE=$(openssl dgst -sha1 $FILE_TO_UPLOAD | awk '{print $2;}')
|
||||
- export apiUrl=$(curl -s 'https://api.backblazeb2.com/b2api/v2/b2_authorize_account' -u '$B2_KEY_ID:$B2_KEY' | \
|
||||
python -c import sys, json; print (json.load(sys.stdin)['apiUrl']))
|
||||
- export UPLOAD_URL=$(curl -s -H '["Authorization":$B2_TOKEN]' -d '{"bucketId":"$B2_BUCKET_ID"}' $apiUrl/b2api/v2/b2_get_upload_url)
|
||||
- curl -H 'Authorization:$B2_TOKEN' -H 'X-Bz-File-Name:$FILE_TO_UPLOAD' -H 'Content-Type:$MIME_TYPE' -H 'X-Bz-Content-Sha1:$SHA1_OF_FILE' -H 'X-Bz-Info-Author:${DRONE_COMMIT_AUTHOR}' --data-binary "@$FILE_TO_UPLOAD" $UPLOAD_URL
|
||||
- export FILE_TO_UPLOAD=$(ls /run/cache | tail -1)
|
||||
- export MIME_TYPE=application/zstd
|
||||
- export SHA1_OF_FILE=$(openssl dgst -sha1 $FILE_TO_UPLOAD | awk '{print $2;}')
|
||||
- curl -H "Authorization:$B2_TOKEN" -H "X-Bz-File-Name:$FILE_TO_UPLOAD" -H "Content-Type:$MIME_TYPE" -H "X-Bz-Content-Sha1:$SHA1_OF_FILE" -H "X-Bz-Info-Author:${DRONE_COMMIT_AUTHOR}" --data-binary "@$FILE_TO_UPLOAD" $UPLOAD_URL
|
||||
environment:
|
||||
B2_ACCOUNT:
|
||||
from_secret: b2_account
|
||||
B2_BUCKET_ID:
|
||||
from_secret: b2_bucketId
|
||||
B2_TOKEN:
|
||||
from_secret: b2_token
|
||||
B2_KEY_ID:
|
||||
from_secret: b2_keyId
|
||||
B2_KEY:
|
||||
from_secret: b2_key
|
||||
- name: backblaze-b2
|
||||
pull: always
|
||||
image: immawanderer/archlinux-rf:latest
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /run/cache
|
||||
commands:
|
||||
- ls -la /run/cache
|
||||
- export FILE_TO_UPLOAD=$(ls /run/cache | head -1)
|
||||
- export MIME_TYPE=text/plain
|
||||
- export SHA1_OF_FILE=$(openssl dgst -sha1 $FILE_TO_UPLOAD | awk '{print $2;}')
|
||||
- export apiUrl=$(curl -s 'https://api.backblazeb2.com/b2api/v2/b2_authorize_account' -u '$B2_KEY_ID:$B2_KEY' | python -c "import sys, json; print (json.load(sys.stdin)['apiUrl'])")
|
||||
- export UPLOAD_URL=$(curl -s -H '["Authorization":$B2_TOKEN]' -d '{"bucketId":"$B2_BUCKET_ID"}' $apiUrl/b2api/v2/b2_get_upload_url)
|
||||
- curl -H 'Authorization:$B2_TOKEN' -H 'X-Bz-File-Name:$FILE_TO_UPLOAD' -H 'Content-Type:$MIME_TYPE' -H 'X-Bz-Content-Sha1:$SHA1_OF_FILE' -H 'X-Bz-Info-Author:${DRONE_COMMIT_AUTHOR}' --data-binary "@$FILE_TO_UPLOAD" $UPLOAD_URL
|
||||
- export FILE_TO_UPLOAD=$(ls /run/cache | tail -1)
|
||||
- export MIME_TYPE=application/zstd
|
||||
- export SHA1_OF_FILE=$(openssl dgst -sha1 $FILE_TO_UPLOAD | awk '{print $2;}')
|
||||
- curl -H "Authorization:$B2_TOKEN" -H "X-Bz-File-Name:$FILE_TO_UPLOAD" -H "Content-Type:$MIME_TYPE" -H "X-Bz-Content-Sha1:$SHA1_OF_FILE" -H "X-Bz-Info-Author:${DRONE_COMMIT_AUTHOR}" --data-binary "@$FILE_TO_UPLOAD" $UPLOAD_URL
|
||||
- cd
|
||||
|
||||
volumes:
|
||||
- name: cache
|
||||
|
Loading…
Reference in New Issue
Block a user