mirror of
https://github.com/nextcloud/android.git
synced 2024-11-22 05:05:31 +03:00
Run drone only if source file changed
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
9fa458e55b
commit
d9d9ad51ce
2 changed files with 12 additions and 4 deletions
12
.drone.yml
12
.drone.yml
|
@ -3,8 +3,9 @@ name: generic
|
|||
|
||||
steps:
|
||||
- name: generic
|
||||
image: nextcloudci/android:android-48
|
||||
image: nextcloudci/android:android-49
|
||||
commands:
|
||||
- scripts/checkIfRunDrone.sh || exit 0
|
||||
- ./gradlew assembleGeneric
|
||||
|
||||
- name: notify
|
||||
|
@ -42,7 +43,7 @@ name: gplay
|
|||
|
||||
steps:
|
||||
- name: gplay
|
||||
image: nextcloudci/android:android-48
|
||||
image: nextcloudci/android:android-49
|
||||
privileged: true
|
||||
environment:
|
||||
LOG_USERNAME:
|
||||
|
@ -55,6 +56,7 @@ steps:
|
|||
from_secret: GIT_TOKEN
|
||||
ORG_GRADLE_PROJECT_coverage: ''
|
||||
commands:
|
||||
- scripts/checkIfRunDrone.sh || exit 0
|
||||
- ./gradlew assembleGplay
|
||||
- emulator -avd android-27 -no-window -no-audio &
|
||||
- ./wait_for_emulator.sh
|
||||
|
@ -103,7 +105,7 @@ name: analysis
|
|||
|
||||
steps:
|
||||
- name: analysis
|
||||
image: nextcloudci/android:android-48
|
||||
image: nextcloudci/android:android-49
|
||||
environment:
|
||||
GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
|
@ -114,6 +116,7 @@ steps:
|
|||
LOG_PASSWORD:
|
||||
from_secret: LOG_PASSWORD
|
||||
commands:
|
||||
- scripts/checkIfRunDrone.sh || exit 0
|
||||
- export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
|
||||
- scripts/analysis/analysis-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST
|
||||
|
||||
|
@ -151,7 +154,7 @@ name: qa
|
|||
|
||||
steps:
|
||||
- name: qa
|
||||
image: nextcloudci/android:android-48
|
||||
image: nextcloudci/android:android-49
|
||||
privileged: true
|
||||
environment:
|
||||
LOG_USERNAME:
|
||||
|
@ -167,6 +170,7 @@ steps:
|
|||
KEY_PASS:
|
||||
from_secret: KEY_PASS
|
||||
commands:
|
||||
- scripts/checkIfRunDrone.sh || exit 0
|
||||
- sed -i "/qa/,/\}/ s/versionCode .*/versionCode $DRONE_BUILD_NUMBER/" build.gradle
|
||||
- sed -i "/qa/,/\}/ s/versionName .*/versionName \"$DRONE_BUILD_NUMBER\"/" build.gradle
|
||||
- ./gradlew assembleQaDebug
|
||||
|
|
4
scripts/checkIfRunDrone.sh
Executable file
4
scripts/checkIfRunDrone.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
|
||||
[ $(git diff --name-only origin/$BRANCH | grep -c "^src") -eq 0 ] && echo "No source files changed" && exit 1
|
Loading…
Reference in a new issue