generated from DTS-STN/next-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
trigger: | ||
- develop | ||
|
||
pr: none | ||
|
||
variables: | ||
azureContainerRegistry.repository: 'oas/eligibility-estimator' | ||
azureContainerRegistry.name: 'DTSShared-December/2023' | ||
azureContainerRegistry.domain: 'dtsshared.azurecr.io' | ||
app.environment: development | ||
app.buildDate: $[ format('{0:yyyy}-{0:MM}-{0:dd}', pipeline.startTime) ] | ||
app.domain: 'https://app-eligibilityestimator-dev.azurewebsites.net/' | ||
app.logLevel: 'info' | ||
image.tag: 'oas/$(Build.SourceVersion)' | ||
System.Debug: false | ||
|
||
stages: | ||
- stage: Cache | ||
displayName: Pull latest image for caching | ||
jobs: | ||
- job: | ||
displayName: Pull latest image | ||
steps: | ||
- task: Docker@2 | ||
inputs: | ||
containerRegistry: '$(azureContainerRegistry.name)' | ||
repository: '$(azureContainerRegistry.repository)' | ||
command: 'login' | ||
|
||
- script: 'docker pull $(azureContainerRegistry.domain)/$(azureContainerRegistry.repository):latest' | ||
displayName: Pull latest for layer caching | ||
continueOnError: true | ||
|
||
- stage: Build | ||
displayName: Build and Push to ACR | ||
jobs: | ||
- job: Build | ||
displayName: Build and Push Container | ||
steps: | ||
- task: AzureKeyVault@2 | ||
inputs: | ||
azureSubscription: 'id-eligibilityestimator-dev' | ||
KeyVaultName: 'kv-oas-ee-dev' | ||
SecretsFilter: 'DEV-ADOBE-ANALYTICS-URL, NEXT-AUTH-PASSWORD, NEXT-AUTH-USERCODE' | ||
RunAsPreJob: false | ||
|
||
- task: Docker@2 | ||
inputs: | ||
containerRegistry: '$(azureContainerRegistry.name)' | ||
repository: '$(azureContainerRegistry.repository)' | ||
command: 'build' | ||
Dockerfile: './Dockerfile' | ||
tags: | | ||
$(image.tag) | ||
latest | ||
release-candidate | ||
arguments: | | ||
--pull | ||
--cache-from $(azureContainerRegistry.domain)/$(azureContainerRegistry.repository):latest | ||
--build-arg home=/app | ||
--build-arg NEXT_BUILD_DATE=$(app.buildDate) | ||
--build-arg NEXTAUTH_URL=$(app.domain) | ||
--build-arg NEXT_AUTH_USERNAME=$(NEXT_AUTH_USERCODE) | ||
--build-arg NEXT_AUTH_PASSWORD=$(NEXT_AUTH_PASSWORD) | ||
--build-arg NEXTAUTH_SECRET=$(NEXT_AUTH_SECRET) | ||
--build-arg ADOBE_ANALYTICS_URL=$(DEV-ADOBE-ANALYTICS-URL) | ||
--build-arg APP_ENV=$(app.environment) | ||
--build-arg LOGGING_LEVEL=$(app.logLevel) | ||
- task: Docker@2 | ||
inputs: | ||
containerRegistry: '$(azureContainerRegistry.name)' | ||
repository: '$(azureContainerRegistry.repository)' | ||
command: 'push' | ||
tags: | | ||
$(image.tag) | ||
latest | ||
release-candidate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
trigger: | ||
- main | ||
|
||
pr: none | ||
|
||
variables: | ||
azureContainerRegistry.repository: 'oas/eligibility-estimator' | ||
azureContainerRegistry.name: 'DTSShared-December/2023' | ||
azureContainerRegistry.domain: 'dtsshared.azurecr.io' | ||
app.environment: production | ||
app.buildDate: $[ format('{0:yyyy}-{0:MM}-{0:dd}', pipeline.startTime) ] | ||
image.tag: 'oas/$(Build.SourceVersion)' | ||
|
||
stages: | ||
- stage: Cache | ||
displayName: Pull latest image for caching | ||
jobs: | ||
- job: | ||
displayName: Pull latest image | ||
steps: | ||
- task: Docker@2 | ||
inputs: | ||
containerRegistry: '$(azureContainerRegistry.name)' | ||
repository: '$(azureContainerRegistry.repository)' | ||
command: 'login' | ||
|
||
- script: 'docker pull $(azureContainerRegistry.domain)/$(azureContainerRegistry.repository):latest' | ||
displayName: Pull latest for layer caching | ||
continueOnError: true | ||
- stage: Build | ||
displayName: Build and Push to ACR | ||
jobs: | ||
- job: Build | ||
displayName: Build and Push Container | ||
steps: | ||
- task: AzureKeyVault@2 | ||
inputs: | ||
azureSubscription: 'id-eligibilityestimator-prod' | ||
KeyVaultName: 'kv-oas-ee-prod' | ||
SecretsFilter: 'PROD-ADOBE-ANALYTICS-URL' | ||
RunAsPreJob: false | ||
|
||
- script: 'docker pull $(azureContainerRegistry.domain)/$(azureContainerRegistry.repository):latest' | ||
displayName: Pull latest for layer caching | ||
continueOnError: true | ||
|
||
- task: Docker@2 | ||
inputs: | ||
containerRegistry: '$(azureContainerRegistry.name)' | ||
repository: '$(azureContainerRegistry.repository)' | ||
command: 'build' | ||
Dockerfile: './Dockerfile' | ||
tags: | | ||
$(image.tag) | ||
latest | ||
production-release | ||
arguments: | | ||
--pull | ||
--cache-from $(azureContainerRegistry.domain)/$(azureContainerRegistry.repository):latest | ||
--build-arg home=/app | ||
--build-arg NEXT_BUILD_DATE=$(app.buildDate) | ||
--build-arg ADOBE_ANALYTICS_URL=$(DEV-ADOBE-ANALYTICS-URL) | ||
--build-arg APP_ENV=$(app.environment) | ||
--build-arg LOGGING_LEVEL=$(app.logLevel) | ||
- task: Docker@2 | ||
inputs: | ||
containerRegistry: '$(azureContainerRegistry.name)' | ||
repository: '$(azureContainerRegistry.repository)' | ||
command: 'push' | ||
tags: | | ||
$(image.tag) | ||
latest | ||
release-candidate |