Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Deploygate app distribution in the template for internal distribution [feature branch] #416

Open
wants to merge 7 commits into
base: feature/deploygate-distribution
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .azure-pipelines-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ trigger: # Start a new run as soon as a "canaries/build/(...)" branch is created
branches:
include:
- canaries/build/*

variables:
- template: build/variables.yml

Expand All @@ -23,22 +23,18 @@ stages:
removeHyperlinksFromReleaseNotes: true
BannerVersionNameText: "CANARY"

- stage: AppCenter_TestFlight_Canary
- stage: Deploygate_TestFlight_Canary
condition: and(succeeded(), eq(variables['IsCanary'], 'true'))
dependsOn: Build_Canary

jobs:
- template: build/stage-release-appcenter.yml
- template: build/stage-release-deploygate.yml
parameters:
applicationEnvironment: Staging
deploymentEnvironment: AppCenter
appCenterWindowsSlug: $(AppCenterWindowsSlug_Canary)
appCenteriOSSlug: $(AppCenteriOSSlug_Canary)
appCenterAndroidSlug: $(AppCenterAndroidSlug_Canary)
deploymentEnvironment: Deploygate
androidKeyStoreFile: $(InternalKeystore)
androidVariableGroup: 'ApplicationTemplate.Distribution.Internal.Android'
appCenterServiceConnectionName: $(AppCenterCanaryServiceConnection)
appCenterDistributionGroup: $(AppCenterCanaryDistributionGroup)
iosVariableGroup: 'ApplicationTemplate.Distribution.Internal.iOS'

- template: build/stage-release-appstore.yml
parameters:
Expand Down
24 changes: 8 additions & 16 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,17 @@ stages:
iosVariableGroup: 'ApplicationTemplate.Distribution.Internal.iOS'
BannerVersionNameText: "STAGING"

- stage: AppCenter_TestFlight_Staging
- stage: Deploygate_TestFlight_Staging
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))
dependsOn: Build_Staging
jobs:
- template: build/stage-release-appcenter.yml
- template: build/stage-release-deploygate.yml
parameters:
applicationEnvironment: Staging
deploymentEnvironment: AppCenter
appCenterWindowsSlug: $(AppCenterWindowsSlug)
appCenteriOSSlug: $(AppCenteriOSSlug)
appCenterAndroidSlug: $(AppCenterAndroidSlug)
deploymentEnvironment: Deploygate
androidKeyStoreFile: $(InternalKeystore)
androidVariableGroup: 'ApplicationTemplate.Distribution.Internal.Android'
appCenterServiceConnectionName: $(AppCenterServiceConnection)
appCenterDistributionGroup: $(AppCenterDistributionGroup)
iosVariableGroup: 'ApplicationTemplate.Distribution.Internal.iOS'

- template: build/stage-release-appstore.yml
parameters:
Expand All @@ -110,21 +106,17 @@ stages:
iosCertificateFile: $(AppStoreCertificate)
iosVariableGroup: 'ApplicationTemplate.Distribution.AppStore'

- stage: AppCenter_Production
- stage: Deploygate_Production
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))
dependsOn: Build_Production
jobs:
- template: build/stage-release-appcenter.yml
- template: build/stage-release-deploygate.yml
parameters:
applicationEnvironment: Production
deploymentEnvironment: 'AppCenter Prod'
appCenterWindowsSlug: $(AppCenterWindowsSlug_Production)
appCenteriOSSlug: $(AppCenteriOSSlug_Production)
appCenterAndroidSlug: $(AppCenterAndroidSlug_Production)
deploymentEnvironment: 'Deploygate Prod'
androidKeyStoreFile: $(GooglePlayKeystore)
androidVariableGroup: 'ApplicationTemplate.Distribution.GooglePlay'
appCenterServiceConnectionName: $(AppCenterServiceConnection)
appCenterDistributionGroup: $(AppCenterDistributionGroup)
iosVariableGroup: 'ApplicationTemplate.Distribution.AppStore'

- stage: AppStore
condition: and(succeeded(), eq(variables['IsLightBuild'], 'false'))
Expand Down
14 changes: 14 additions & 0 deletions build/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
default_platform(:ios)

platform :ios do
desc "Upload Application to Deploygate"
lane :upload_deploygate do
deploygate(
api_token: ENV['deploygateApiToken'],
user: ENV['deploygateUsername'],
ipa: ENV['ipaFile'],
apk: ENV['apkFile'],
message: ENV['releasesNotes']
)
end
end
3 changes: 3 additions & 0 deletions build/fastlane/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane", "~> 2.225"
110 changes: 0 additions & 110 deletions build/stage-release-appcenter.yml

This file was deleted.

2 changes: 1 addition & 1 deletion build/stage-release-appstore.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
applicationEnvironment: '' # e.g. "Staging", "Production"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "AppCenter"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "Deploygate"

jobs:
- deployment: AppStore_iOS_${{ parameters.deploymentEnvironment}}
Expand Down
145 changes: 145 additions & 0 deletions build/stage-release-deploygate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
parameters:
applicationEnvironment: '' # e.g. "Staging", "Production"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "Deploygate"
androidKeyStoreFile: ''
androidVariableGroup: ''
iosVariableGroup: ''

jobs:
- deployment: Deploygate_Android
pool:
vmImage: $(macOSHostedAgentImage)
variables:
- name: artifactName
value: $(AndroidArtifactName)_${{ parameters.applicationEnvironment }}
- name: releaseNotesArtifactName
value: ReleaseNotes_${{ parameters.applicationEnvironment }}
- group: ${{ parameters.androidVariableGroup }}
environment: ${{ parameters.deploymentEnvironment }}
strategy:
runOnce:
deploy:
steps:
- checkout: self

- download: current
displayName: "Download Artifact"
artifact: $(artifactName)

- download: current
displayName: "Download Release Notes"
artifact: $(releaseNotesArtifactName)

- script: |
fileContent=$(cat $(Pipeline.Workspace)/$(releaseNotesArtifactName)/ReleaseNotes-Excerpt.md)
modifiedContent=$(echo "$fileContent" | tr '\n' ' ')
echo "##vso[task.setvariable variable=releaseNotes]$modifiedContent"
displayName: Read Release Notes

- script: |
gem install bundler
bundle install --path ~/.gem
bundle update --bundler
displayName: Run Bundle install
workingDirectory: '$(Build.SourcesDirectory)/build/fastlane'
condition: succeeded()

- script: |
bundle exec fastlane upload_deploygate --verbose
displayName: Deploy Android to Deploygate
workingDirectory: '$(Build.SourcesDirectory)/build/fastlane'
condition: succeeded()
env:
deploygateApiToken: $(DeploygateApiToken)
deploygateUsername: $(DeploygateUsername)
releasesNotes: "$(releaseNotes)"
apkFile: '$(Pipeline.Workspace)/$(artifactName)/$(ApplicationIdentifier)-Signed.apk'

- task: DeleteFiles@1
displayName: "Remove Downloaded Artifacts (Build)"
condition: always()
inputs:
SourceFolder: $(Pipeline.Workspace)/$(artifactName)
RemoveSourceFolder: true
Contents: '**'

- task: DeleteFiles@1
displayName: "Remove Downloaded Artifacts (Release Notes)"
condition: always()
inputs:
SourceFolder: $(Pipeline.Workspace)/$(releaseNotesArtifactName)
RemoveSourceFolder: true
Contents: '**'

- task: PostBuildCleanup@3
displayName: 'Post-Build cleanup : Cleanup files to keep build server clean!'
condition: always()

- deployment: Deploygate_iOS
pool:
vmImage: $(macOSHostedAgentImage)
variables:
- name: artifactName
value: $(iOSArtifactName)_${{ parameters.applicationEnvironment }}
- name: releaseNotesArtifactName
value: ReleaseNotes_${{ parameters.applicationEnvironment }}
- group: ${{ parameters.iosVariableGroup }}
environment: ${{ parameters.deploymentEnvironment }}
strategy:
runOnce:
deploy:
steps:
- checkout: self

- download: current
displayName: "Download Artifact"
artifact: $(artifactName)

- download: current
displayName: "Download Release Notes"
artifact: $(releaseNotesArtifactName)

- script: |
fileContent=$(cat $(Pipeline.Workspace)/$(releaseNotesArtifactName)/ReleaseNotes-Excerpt.md)
modifiedContent=$(echo "$fileContent" | tr '\n' ' ')
echo "##vso[task.setvariable variable=releaseNotes]$modifiedContent"
displayName: Read Release Notes

- script: |
gem install bundler
bundle install --path ~/.gem
bundle update --bundler
displayName: Run Bundle install
workingDirectory: '$(Build.SourcesDirectory)/build/fastlane'
condition: succeeded()

- script: |
bundle exec fastlane upload_deploygate --verbose
displayName: Deploy iOS to Deploygate
workingDirectory: '$(Build.SourcesDirectory)/build/fastlane'
condition: succeeded()
env:
deploygateApiToken: $(DeploygateApiToken)
deploygateUsername: $(DeploygateUsername)
releasesNotes: "$(releaseNotes)"
ipaFile: '$(Pipeline.Workspace)/$(artifactName)/$(SolutionName).Mobile.ipa'

- task: DeleteFiles@1
displayName: "Remove Downloaded Artifacts (Build)"
condition: always()
inputs:
SourceFolder: $(Pipeline.Workspace)/$(artifactName)
RemoveSourceFolder: true
Contents: '**'

- task: DeleteFiles@1
displayName: "Remove Downloaded Artifacts (Release Notes)"
condition: always()
inputs:
SourceFolder: $(Pipeline.Workspace)/$(releaseNotesArtifactName)
RemoveSourceFolder: true
Contents: '**'

- task: PostBuildCleanup@3
displayName: 'Post-Build cleanup : Cleanup files to keep build server clean!'
condition: always()
2 changes: 1 addition & 1 deletion build/stage-release-googleplay.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
applicationEnvironment: '' # e.g. "Staging", "Production"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "AppCenter"
deploymentEnvironment: '' # e.g. "GooglePlay", "AppStore", "Deploygate"

jobs:
- deployment: GooglePlay_Android
Expand Down
Loading
Loading