Extract variables to enviroment. Rename file after uplaod on tagged deploy
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
26
.drone.yml
26
.drone.yml
@@ -37,26 +37,28 @@ steps:
|
||||
environment:
|
||||
SEAFILE_API_KEY:
|
||||
from_secret: SeafileApiKey
|
||||
APK_FILE: app/build/outputs/apk/release/app-release.apk
|
||||
BUNDLE_FILE: app/build/outputs/bundle/release/app-release.aab
|
||||
SEAFILE_REPO: daffda8b-5840-4a65-b6d0-73b991facfb6
|
||||
commands:
|
||||
- APK_FILE="app/build/outputs/apk/release/app-release.apk"
|
||||
- BUNDLE_FILE="app/build/outputs/bundle/release/app-release.aab"
|
||||
- 'UPLOADLINK=$(curl -H "Authorization: Token $SEAFILE_API_KEY" https://seafile.zobrist.me/api2/repos/daffda8b-5840-4a65-b6d0-73b991facfb6/upload-link/ | tr -d “\"“)'
|
||||
- 'curl -H "Authorization: Token $SEAFILE_API_KEY" -F file=@$APK_FILE -F parent_dir=/ -F relative_path=latest/ -F replace=1 $UPLOADLINK'
|
||||
- 'curl -H "Authorization: Token $SEAFILE_API_KEY" -F file=@$BUNDLE_FILE -F parent_dir=/ -F relative_path=latest/ -F replace=1 $UPLOADLINK'
|
||||
- 'UPLOAD_URL=$(curl -H "Authorization: Token $SEAFILE_API_KEY" https://seafile.zobrist.me/api2/repos/$SEAFILE_REPO/upload-link/ | tr -d “\"“)'
|
||||
- 'curl -H "Authorization: Token $SEAFILE_API_KEY" -F file=@APK_FILE -F parent_dir=/ -F relative_path=latest/ -F replace=1 "$UPLOAD_URL"'
|
||||
- 'curl -H "Authorization: Token $SEAFILE_API_KEY" -F file=@BUNDLE_FILE -F parent_dir=/ -F relative_path=latest/ -F replace=1 "$UPLOAD_URL"'
|
||||
|
||||
- name: deploy tagged build
|
||||
image: curlimages/curl
|
||||
environment:
|
||||
SEAFILE_API_KEY:
|
||||
from_secret: SeafileApiKey
|
||||
APK_FILE: app/build/outputs/apk/release/app-release.apk
|
||||
BUNDLE_FILE: app/build/outputs/bundle/release/app-release.aab
|
||||
SEAFILE_REPO: daffda8b-5840-4a65-b6d0-73b991facfb6
|
||||
commands:
|
||||
- APK_FILE="app/build/outputs/apk/release/app-release$DRONE_TAG.apk"
|
||||
- BUNDLE_FILE="app/build/outputs/bundle/release/app-release$DRONE_TAG.aab"
|
||||
- mv app/build/outputs/apk/release/app-release.apk $APK_FILE
|
||||
- mv app/build/outputs/bundle/release/app-release.aab $BUNDLE_FILE
|
||||
- 'UPLOADLINK=$(curl -H "Authorization: Token $SEAFILE_API_KEY" https://seafile.zobrist.me/api2/repos/daffda8b-5840-4a65-b6d0-73b991facfb6/upload-link/ | tr -d “\"“)'
|
||||
- 'curl -H "Authorization: Token $SEAFILE_API_KEY" -F file=@$APK_FILE -F parent_dir=/ -F relative_path=tagged/$DRONE_TAG/ -F replace=1 $UPLOADLINK'
|
||||
- 'curl -H "Authorization: Token $SEAFILE_API_KEY" -F file=@$BUNDLE_FILE -F parent_dir=/ -F relative_path=tagged/$DRONE_TAG/ -F replace=1 $UPLOADLINK'
|
||||
- 'UPLOAD_URL=$(curl -H "Authorization: Token $SEAFILE_API_KEY" https://seafile.zobrist.me/api2/repos/SEAFILE_REPO/upload-link/ | tr -d “\"“)'
|
||||
- 'curl -H "Authorization: Token $SEAFILE_API_KEY" -F file=@APK_FILE -F parent_dir=/ -F relative_path=tagged/$DRONE_TAG/ -F replace=1 "$UPLOAD_URL"'
|
||||
- 'curl -H "Authorization: Token $SEAFILE_API_KEY" -F file=@BUNDLE_FILE -F parent_dir=/ -F relative_path=tagged/$DRONE_TAG/ -F replace=1 "$UPLOAD_URL"'
|
||||
- 'curl -d "operation=rename&newname=app-release$DRONE_TAG.apk" -H "Authorization: Token $SEAFILE_API_KEY" https://seafile.zobrist.me/api2/repos/$SEAFILE_REPO/file/?p=/tagged/$DRONE_TAG/app-release.apk'
|
||||
- 'curl -d "operation=rename&newname=app-release$DRONE_TAG.aan" -H "Authorization: Token $SEAFILE_API_KEY" https://seafile.zobrist.me/api2/repos/$SEAFILE_REPO/file/?p=/tagged/$DRONE_TAG/app-release.aab'
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
Reference in New Issue
Block a user