6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 19fce618

AuthorNKL<nikolaj.king@gmail.com>
Date2024-08-16 15:02:04 +0200
cleaned up pipelines

Changed files

azure/azure-pipelines.yml         |  56 ++++++++++---
 azure/templates/build-android.yml | 162 +++++++++++++++++---------------------
 azure/templates/build-ios.yml     |   6 +-
 3 files changed, 122 insertions(+), 102 deletions(-)

Diff

diff --git a/azure/azure-pipelines.yml b/azure/azure-pipelines.yml
index a70ee59a..7c68397c 100644
--- a/azure/azure-pipelines.yml
+++ b/azure/azure-pipelines.yml
@@ -17,14 +17,52 @@ pool:
vmImage: 'macOS-14'
stages:
-- stage: CI
+- stage: CI Android
+ pool:
+ vmImage: 'ubuntu-latest'
jobs:
- - job: SetVariables
+ - job:
steps:
- script: |
echo "##vso[task.setvariable variable=environment]develop"
echo "##vso[task.setvariable variable=stageName]developStage"
- echo "##vso[task.setvariable variable=flavor]releasetest"
+ echo "##vso[task.setvariable variable=flavor]develop"
+ displayName: 'Set default variables for develop'
+ - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/test') }}:
+ - script: |
+ echo "##vso[task.setvariable variable=environment]test"
+ echo "##vso[task.setvariable variable=stageName]testStage"
+ echo "##vso[task.setvariable variable=flavor]releasetest"
+ displayName: 'Set variables for test'
+ - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/stage') }}:
+ - script: |
+ echo "##vso[task.setvariable variable=environment]stage"
+ echo "##vso[task.setvariable variable=stageName]stageStage"
+ echo "##vso[task.setvariable variable=flavor]releasestage"
+ displayName: 'Set variables for stage'
+ - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/prod') }}:
+ - script: |
+ echo "##vso[task.setvariable variable=environment]prod"
+ echo "##vso[task.setvariable variable=stageName]prodStage"
+ echo "##vso[task.setvariable variable=flavor]releaseprod"
+ displayName: 'Set variables for prod'
+ - template: /azure/templates/build-android.yml
+ parameters:
+ stageName: ${{ variables.stageName }}
+ environment: ${{ variables.environment }}
+ flavor: ${{ variables.flavor }}
+
+
+- stage: CI iOS
+ pool:
+ vmImage: 'macOS-14'
+ jobs:
+ - job:
+ steps:
+ - script: |
+ echo "##vso[task.setvariable variable=environment]develop"
+ echo "##vso[task.setvariable variable=stageName]developStage"
+ echo "##vso[task.setvariable variable=flavor]develop"
displayName: 'Set default variables for develop'
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/test') }}:
- script: |
@@ -44,11 +82,6 @@ stages:
echo "##vso[task.setvariable variable=stageName]prodStage"
echo "##vso[task.setvariable variable=flavor]releaseprod"
displayName: 'Set variables for prod'
-#- template: /azure/templates/build-android.yml
-# parameters:
-# stageName: ${{ variables.stageName }}
-# environment: ${{ variables.environment }}
-# flavor: ${{ variables.flavor }}
- script: echo "name is $(variables.flavor)"
- template: templates/build-ios.yml
@@ -58,8 +91,11 @@ stages:
flavor: ${{ variables.flavor }}
cppwd: ${{ variables.cppwd }}
-- stage:
- condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/test'), eq(variables['Build.SourceBranch'], 'refs/heads/stage'), eq(variables['Build.SourceBranch'], 'refs/heads/prod')))
+- stage: Deploy Android
+ pool:
+ vmImage: 'ubuntu-latest'
+ dependsOn: CI Android
+ condition: and(succeeded('CI Android'), or(eq(variables['Build.SourceBranch'], 'refs/heads/test'), eq(variables['Build.SourceBranch'], 'refs/heads/stage'), eq(variables['Build.SourceBranch'], 'refs/heads/prod')))
jobs:
- deployment:
environment: 'dev'
diff --git a/azure/templates/build-android.yml b/azure/templates/build-android.yml
index ae956e95..573a1736 100644
--- a/azure/templates/build-android.yml
+++ b/azure/templates/build-android.yml
@@ -6,89 +6,75 @@ parameters:
- name: flavor
type: string
-stages:
- - stage: ${{ parameters.stageName }}
- pool:
- vmImage: "ubuntu-latest"
- dependsOn: []
- displayName: ${{ parameters.stageName }}
- jobs:
- - job: AndroidJob
- displayName: Android
- steps:
- # replace "key.properties" with your secure file name
- - task: DownloadSecureFile@1
- name: keyprop
- displayName: Download key properties file
- inputs:
- secureFile: "key.properties"
+steps:
+- task: DownloadSecureFile@1
+ name: keyprop
+ displayName: Download key properties file
+ inputs:
+ secureFile: "key.properties"
+
+- task: DownloadSecureFile@1
+ name: localprop
+ displayName: Download local properties file
+ inputs:
+ secureFile: "local.properties"
- # replace "local.properties" with your secure file name
- - task: DownloadSecureFile@1
- name: localprop
- displayName: Download local properties file
- inputs:
- secureFile: "local.properties"
+- task: DownloadSecureFile@1
+ name: comwell_keystore
+ displayName: Download signing key
+ inputs:
+ secureFile: "comwell_keystore.jks"
- # replace "key.jks" with your secure file name
- - task: DownloadSecureFile@1
- name: comwell_keystore
- displayName: Download signing key
- inputs:
- secureFile: "comwell_keystore.jks"
+- task: Bash@3
+ displayName: Copy config files
+ inputs:
+ targetType: "inline"
+ script: |
+ cp $(localprop.secureFilePath) $(Build.SourcesDirectory)/comwell_key_app/android/local.properties
+ cp $(keyprop.secureFilePath) $(Build.SourcesDirectory)/comwell_key_app/android/key.properties
+ cp $(comwell_keystore.secureFilePath) $(Build.SourcesDirectory)/comwell_key_app/android/app/comwell_keystore.jks
- # adjust paths and file names here
- - task: Bash@3
- displayName: Copy config files
- inputs:
- targetType: "inline"
- script: |
- cp $(localprop.secureFilePath) $(Build.SourcesDirectory)/comwell_key_app/android/local.properties
- cp $(keyprop.secureFilePath) $(Build.SourcesDirectory)/comwell_key_app/android/key.properties
- cp $(comwell_keystore.secureFilePath) $(Build.SourcesDirectory)/comwell_key_app/android/app/comwell_keystore.jks
+ echo "local.properties copied to $(Build.SourcesDirectory)/comwell_key_app/android/local.properties"
+ echo "key.properties copied to $(Build.SourcesDirectory)/comwell_key_app/android/key.properties"
+ echo "comwell_keystore.jks copied to $(Build.SourcesDirectory)/comwell_key_app/android/app/comwell_keystore.jks"
- echo "local.properties copied to $(Build.SourcesDirectory)/comwell_key_app/android/local.properties"
- echo "key.properties copied to $(Build.SourcesDirectory)/comwell_key_app/android/key.properties"
- echo "comwell_keystore.jks copied to $(Build.SourcesDirectory)/comwell_key_app/android/app/comwell_keystore.jks"
+# Download secure file from azure library
+- task: DownloadSecureFile@1
+ inputs:
+ secureFile: ".env"
- # Download secure file from azure library
- - task: DownloadSecureFile@1
- inputs:
- secureFile: ".env"
+# Copy the .env file
+- task: CopyFiles@2
+ inputs:
+ sourceFolder: "$(Agent.TempDirectory)"
+ contents: "**/*.env"
+ targetFolder: "$(Build.SourcesDirectory)/comwell_key_app"
+ cleanTargetFolder: false
- # Copy the .env file
- - task: CopyFiles@2
- inputs:
- sourceFolder: "$(Agent.TempDirectory)"
- contents: "**/*.env"
- targetFolder: "$(Build.SourcesDirectory)/comwell_key_app"
- cleanTargetFolder: false
+- task: FlutterInstall@0
+ displayName: "Install Flutter SDK"
+ inputs:
+ mode: "auto"
+ channel: "stable"
+ version: "latest"
- - task: FlutterInstall@0
- displayName: "Install Flutter SDK"
- inputs:
- mode: "auto"
- channel: "stable"
- version: "latest"
-
- - task: FlutterCommand@0
- displayName: "Run Flutter diagnostics"
- inputs:
- projectDirectory: "."
- arguments: "doctor -v"
-
- - task: ShellScript@2
- inputs:
- scriptPath: "$(Build.SourcesDirectory)/mobilekeys_sdk_plugin/pigeon.sh"
+- task: FlutterCommand@0
+ displayName: "Run Flutter diagnostics"
+ inputs:
+ projectDirectory: "."
+ arguments: "doctor -v"
+- task: ShellScript@2
+ inputs:
+ scriptPath: "$(Build.SourcesDirectory)/mobilekeys_sdk_plugin/pigeon.sh"
- - task: FlutterBuild@0
- displayName: "Build application"
- inputs:
- buildNumber: "$(Build.BuildId)"
- target: "aab"
- extraArgs: "-t lib/main.dart"
- buildFlavour: ${{ parameters.flavor }}
- projectDirectory: "$(Build.SourcesDirectory)/comwell_key_app"
+- task: FlutterBuild@0
+ displayName: "Build application"
+ inputs:
+ buildNumber: "$(Build.BuildId)"
+ target: "aab"
+ extraArgs: "-t lib/main.dart"
+ buildFlavour: ${{ parameters.flavor }}
+ projectDirectory: "$(Build.SourcesDirectory)/comwell_key_app"
#- task: FlutterTest@0
# displayName: "Run unit tests"
@@ -96,18 +82,18 @@ stages:
# generateCodeCoverageReport: true
#projectDirectory: '$(Build.SourcesDirectory)'
- - task: CopyFiles@2
- displayName: "Copy app to staging directory"
- inputs:
- sourceFolder: "$(Agent.BuildDirectory)"
- contents: "**/bundle/**"
- targetFolder: "$(Build.StagingDirectory)"
- flattenFolders: true
+- task: CopyFiles@2
+ displayName: "Copy app to staging directory"
+ inputs:
+ sourceFolder: "$(Agent.BuildDirectory)"
+ contents: "**/bundle/**"
+ targetFolder: "$(Build.StagingDirectory)"
+ flattenFolders: true
- - task: PublishBuildArtifacts@1
- displayName: "Publish AAB file"
- inputs:
- PathtoPublish: "$(Build.ArtifactStagingDirectory)"
- ArtifactName: "AAB"
- publishLocation: "Container"
+- task: PublishBuildArtifacts@1
+ isplayName: "Publish AAB file"
+ inputs:
+ PathtoPublish: "$(Build.ArtifactStagingDirectory)"
+ ArtifactName: "AAB"
+ publishLocation: "Container"
\ No newline at end of file
diff --git a/azure/templates/build-ios.yml b/azure/templates/build-ios.yml
index 45a517ea..3b213e8c 100644
--- a/azure/templates/build-ios.yml
+++ b/azure/templates/build-ios.yml
@@ -3,7 +3,7 @@ parameters:
type: string
- name: stageName
type: string
- - name : cppwd
+ - name: cppwd
type: string
- name: flavor
type: string
@@ -22,7 +22,6 @@ steps: # Download secure file from azure library
targetFolder: '$(Build.SourcesDirectory)/comwell_key_app'
cleanTargetFolder: false
- # replace "iosKey" and "yourPwd" with your secure file name and password
- task: InstallAppleCertificate@2
displayName: Install certificate
inputs:
@@ -30,7 +29,6 @@ steps: # Download secure file from azure library
certPwd: ''
keychain: 'temp'
- # replace "ios_Profile.mobileprovision" with your secure file name
- task: InstallAppleProvisioningProfile@1
displayName: Install provisioning file
inputs:
@@ -54,7 +52,7 @@ steps: # Download secure file from azure library
inputs:
scriptPath: "$(Build.SourcesDirectory)/mobilekeys_sdk_plugin/pigeon.sh"
- # adjust path to the *.plist file
+ #fix the buildflavor when adding more envs
- task: FlutterBuild@0
displayName: "Build application"
inputs: