-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-ccoe.yml
59 lines (50 loc) · 1.85 KB
/
azure-pipelines-ccoe.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
52
53
54
55
56
57
58
59
# https://github.com/defra/biodiversity-net-gain-service
variables:
- name: TAG
value: ${{replace(variables['Build.SourceBranchName'], 'v', '')}}
trigger:
branches:
include:
- refs/tags/v*
pool:
name: Azure Pipelines
steps:
- task: NodeTool@0
env:
GOOGLE_TAGMANAGER_ID: ${GOOGLE_TAGMANAGER_ID}
inputs:
versionSpec: '18.x'
displayName: 'Install Node.js'
- script: |
echo ${TAG}
echo ${GOOGLE_TAGMANAGER_ID}
npm ci --ignore-scripts && npm run lerna:i
# TODO: there is currently a bug with lerna version that means npm packagelock v2 files
# are not updated correctly, and our CI build will need an npm I instead of npm ci as lock
# files don't match package files correctly.
displayName: 'npm install package dependencies'
- script: |
cd $(System.DefaultWorkingDirectory)/packages/azure-functions && \
zip -rq func.zip .
cp func.zip $(Build.ArtifactStagingDirectory)/azure-functions.zip
displayName: 'Create function artifact'
- script: |
docker compose -f docker/services.build.azure.yml build
docker save bng-portal/webapp:$(TAG) > web.tar
cp web.tar $(Build.ArtifactStagingDirectory)/webapp.tar
displayName: 'Build webapp image and output to tar'
- script: |
cd $(System.DefaultWorkingDirectory)/packages/database-version-control
zip -rq database-version-control.zip .
cp database-version-control.zip $(Build.ArtifactStagingDirectory)/database-version-control.zip
displayName: 'Create Database version control artifact'
- task: UniversalPackages@0
inputs:
command: 'publish'
publishDirectory: '$(Build.ArtifactStagingDirectory)'
feedsToUsePublish: 'internal'
vstsFeedPublish: 'b8802fc2-0825-411a-b9de-b129decae388'
vstsFeedPackagePublish: 'bng-portal'
versionOption: 'custom'
versionPublish: $(TAG)
packagePublishDescription: 'BNG application code artifacts'