Use seafile api to upload files directly
Some checks failed
continuous-integration/drone/push Build encountered an error
Some checks failed
continuous-integration/drone/push Build encountered an error
This commit is contained in:
38
.drone.yml
38
.drone.yml
@@ -33,24 +33,30 @@ steps:
|
|||||||
- ./gradlew bundleRelease
|
- ./gradlew bundleRelease
|
||||||
|
|
||||||
- name: deploy latest build
|
- name: deploy latest build
|
||||||
image: busybox
|
image: busybox
|
||||||
volumes:
|
environment:
|
||||||
- name: deploy
|
SEAFILE_API_KEY:
|
||||||
path: /tmp/deploy
|
from_secret: SeafileApiKey
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p /tmp/deploy/lastBuild
|
- APK_FILE="app/build/outputs/apk/release/app-release.apk"
|
||||||
- cp ./app/build/outputs/apk/release/app-release.apk /tmp/deploy/lastBuild/app-release_latest.apk
|
- BUNDLE_FILE="app/build/outputs/bundle/release/app-release.aab"
|
||||||
- cp ./app/build/outputs/bundle/release/app-release.aab /tmp/deploy/lastBuild/app-release_latest.aab
|
- UPLOADLINK=$(curl -H "Authorization: Token $SEAFILE_API_KEY" https://seafile.zobrist.me/api2/repos/daffda8b-5840-4a65-b6d0-73b991facfb6/upload-link/)
|
||||||
|
- 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"
|
||||||
|
|
||||||
- name: deploy tagged build
|
- name: deploy tagged build
|
||||||
image: busybox
|
image: busybox
|
||||||
volumes:
|
environment:
|
||||||
- name: deploy
|
SEAFILE_API_KEY:
|
||||||
path: /tmp/deploy
|
from_secret: SeafileApiKey
|
||||||
commands:
|
commands:
|
||||||
- mkdir -p /tmp/deploy/tagged/$DRONE_TAG
|
- APK_FILE="app/build/outputs/apk/release/app-release$DRONE_TAG.apk"
|
||||||
- cp ./app/build/outputs/apk/release/app-release.apk /tmp/deploy/tagged/$DRONE_TAG/app-release$DRONE_TAG.apk
|
- BUNDLE_FILE="app/build/outputs/bundle/release/app-release$DRONE_TAG.aab"
|
||||||
- cp ./app/build/outputs/bundle/release/app-release.aab /tmp/deploy/tagged/$DRONE_TAG/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/)
|
||||||
|
- 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"
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
@@ -64,9 +70,3 @@ steps:
|
|||||||
status:
|
status:
|
||||||
- failure
|
- failure
|
||||||
- success
|
- success
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: deploy
|
|
||||||
host:
|
|
||||||
path: /mnt/seafile-sync-cli/TichuCounter
|
|
||||||
Reference in New Issue
Block a user