44
.drone.yml
44
.drone.yml
@@ -33,24 +33,32 @@ steps:
|
||||
- ./gradlew bundleRelease
|
||||
|
||||
- name: deploy latest build
|
||||
image: busybox
|
||||
volumes:
|
||||
- name: deploy
|
||||
path: /tmp/deploy
|
||||
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:
|
||||
- mkdir -p /tmp/deploy/lastBuild
|
||||
- cp ./app/build/outputs/apk/release/app-release.apk /tmp/deploy/lastBuild/app-release_latest.apk
|
||||
- cp ./app/build/outputs/bundle/release/app-release.aab /tmp/deploy/lastBuild/app-release_latest.aab
|
||||
- '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: busybox
|
||||
volumes:
|
||||
- name: deploy
|
||||
path: /tmp/deploy
|
||||
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:
|
||||
- mkdir -p /tmp/deploy/tagged/$DRONE_TAG
|
||||
- cp ./app/build/outputs/apk/release/app-release.apk /tmp/deploy/tagged/$DRONE_TAG/app-release$DRONE_TAG.apk
|
||||
- cp ./app/build/outputs/bundle/release/app-release.aab /tmp/deploy/tagged/$DRONE_TAG/app-release_$DRONE_TAG.aab
|
||||
- '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.aab" -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
|
||||
@@ -63,10 +71,4 @@ steps:
|
||||
when:
|
||||
status:
|
||||
- failure
|
||||
- success
|
||||
|
||||
|
||||
volumes:
|
||||
- name: deploy
|
||||
host:
|
||||
path: /mnt/seafile-sync-cli/TichuCounter
|
||||
- success
|
||||
Reference in New Issue
Block a user