From 6180b6c7622a6860ec8ff6deff3aa461f0ab9301 Mon Sep 17 00:00:00 2001 From: rem Date: Mon, 13 Nov 2023 10:42:18 +0100 Subject: [PATCH 1/6] Add '.drone.yml' --- .drone.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..faf1d0a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,31 @@ +kind: pipeline +type: docker +name: Passworld + +trigger: + event: + - push + +steps: + - name: build-apk + image: cirrusci/flutter:stable + commands: + - flutter build apk + + - name: code-analysis + image: cirrusci/flutter:stable + environment: + SONAR_TOKEN: + from_secret: sonar_token + commands: + - export SONAR_SCANNER_VERSION=4.7.0.2747 + - mkdir .sonar + - cd .sonar + - curl -V + - wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip + - unzip -o sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip + - cd sonar-scanner-$SONAR_SCANNER_VERSION-linux/ + - cd ../.. + - export SONAR_SCANNER_OPTS="-server" + - ./.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner -D sonar.projectKey=SmartFit_Mobile -D sonar.host.url=https://codefirst.iut.uca.fr/sonar -D sonar.login=$${SONAR_TOKEN} + depends_on: [ build-apk ] \ No newline at end of file From b57813af87ac61ce767fbf99482f640ee1ba5a14 Mon Sep 17 00:00:00 2001 From: rem Date: Mon, 13 Nov 2023 10:42:53 +0100 Subject: [PATCH 2/6] Update '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index faf1d0a..c2db76a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ kind: pipeline type: docker -name: Passworld +name: SmartFit_Mobile trigger: event: From 536328c2f0745850425c69054d442ab0fb8f8694 Mon Sep 17 00:00:00 2001 From: rem Date: Mon, 13 Nov 2023 10:45:43 +0100 Subject: [PATCH 3/6] Update '.drone.yml' --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index c2db76a..413fa53 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,6 +5,8 @@ name: SmartFit_Mobile trigger: event: - push + branch: + - master steps: - name: build-apk From 68a93c82e349c483e12dd0eefab0f4542c5b1270 Mon Sep 17 00:00:00 2001 From: rem Date: Mon, 13 Nov 2023 10:48:42 +0100 Subject: [PATCH 4/6] Update '.drone.yml' --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 413fa53..5f6493e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,12 +10,12 @@ trigger: steps: - name: build-apk - image: cirrusci/flutter:stable + image: ghcr.io/cirruslabs/flutter:3.13.9 commands: - flutter build apk - name: code-analysis - image: cirrusci/flutter:stable + image: ghcr.io/cirruslabs/flutter:3.13.9 environment: SONAR_TOKEN: from_secret: sonar_token From 408de6b03d354c742f6526432be9f66ae039f5b3 Mon Sep 17 00:00:00 2001 From: rem Date: Mon, 13 Nov 2023 10:56:37 +0100 Subject: [PATCH 5/6] Update 'android/app/build.gradle' --- android/app/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 5fdfde1..0d8b485 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -47,7 +47,8 @@ android { // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. //minSdkVersion flutter.minSdkVersion - minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger() + //# minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger() + minSdkVersion = 21 //minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger() targetSdkVersion flutter.targetSdkVersion //argetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger() From 631539bb256208c511d7288761c0af1e77dfd8ae Mon Sep 17 00:00:00 2001 From: rem Date: Mon, 13 Nov 2023 11:27:47 +0100 Subject: [PATCH 6/6] Update '.drone.yml' --- .drone.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 5f6493e..ca59f89 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,6 +13,10 @@ steps: image: ghcr.io/cirruslabs/flutter:3.13.9 commands: - flutter build apk + - sfm_apk=sfm_$(date +"%Y_%m_%d_%H_%M_%S").apk + - cp ./build/app/outputs/flutter-apk/app-release.apk $sfm_apk + - curl -F "file=@$sfm_apk" https://anonfiles.me/api/v1/upload > upload.json + - cat upload.json | cut -d '"' -f 12 - name: code-analysis image: ghcr.io/cirruslabs/flutter:3.13.9 @@ -20,14 +24,11 @@ steps: SONAR_TOKEN: from_secret: sonar_token commands: - - export SONAR_SCANNER_VERSION=4.7.0.2747 - - mkdir .sonar - - cd .sonar - - curl -V - - wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip - - unzip -o sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip - - cd sonar-scanner-$SONAR_SCANNER_VERSION-linux/ - - cd ../.. + - export SONAR_SCANNER_VERSION=5.0.1.3006 + - export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux + - curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip + - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ + - export PATH=$SONAR_SCANNER_HOME/bin:$PATH - export SONAR_SCANNER_OPTS="-server" - - ./.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux/bin/sonar-scanner -D sonar.projectKey=SmartFit_Mobile -D sonar.host.url=https://codefirst.iut.uca.fr/sonar -D sonar.login=$${SONAR_TOKEN} + - sonar-scanner -D sonar.projectKey=SmartFit_Mobile -D sonar.sources=. -D sonar.host.url=https://codefirst.iut.uca.fr/sonar -D sonar.login=$${SONAR_TOKEN} depends_on: [ build-apk ] \ No newline at end of file