forked from Notalib/readium-lcp-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-1.yml
51 lines (45 loc) · 1.84 KB
/
azure-pipelines-1.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
trigger:
- master
variables:
System.Debug: true
appName_dev: 'LSDLCDserver'
acrName_dev: 'lcslsdcontainer'
resourceGroup_prod: 'App-Merkur-Prod'
appName_prod: 'app-lcp-prod'
acrName_prod: 'lcslsdcontainer'
databaseUrl_prod: $(DATABASE_URL_PROD)
dockerComposeFile: 'ci/docker-compose.yaml' # Ensure this path is correct
containerRegistry: 'docker_lcp'
tag: 'latest'
stages:
- stage: BuildAndPush
displayName: Build and Push with Docker Compose
jobs:
- job: Build
displayName: Build and Push
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r .tag_name)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
displayName: 'Install Docker Compose'
# Log in to Azure Container Registry
- task: Docker@2
displayName: 'Login to ACR'
inputs:
command: 'login'
containerRegistry: $(containerRegistry)
# Build and Push using Docker Compose
- script: |
docker-compose -f $(System.DefaultWorkingDirectory)/$(dockerComposeFile) build
docker-compose -f $(System.DefaultWorkingDirectory)/$(dockerComposeFile) push
displayName: 'Build and Push Docker Compose Images'
- task: AzureWebAppContainer@1
displayName: 'Azure Web App on Container Deploy'
inputs:
azureSubscription: 'ACR-lcp-prod'
appName: $(appName_prod)
multicontainerConfigFile: $(System.DefaultWorkingDirectory)/$(dockerComposeFile)