-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
97 lines (89 loc) · 3.2 KB
/
azure-pipelines.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build npm release
variables:
esy__ci_cache_version: v1 # this is available to all jobs in env as $ESY__CI_CACHE_VERSION or in azure config as $(esy__ci_cache_version)
trigger:
branches:
include:
- master
- releases/*
paths:
exclude:
- README.html
- notes/*
- "*.md"
- LICENSE
jobs:
- template: .ci/build-platform.yml
parameters:
platform: Linux
vmImage: ubuntu-latest
- template: .ci/build-platform.yml
parameters:
platform: macOS
vmImage: macOS-latest
# Need windows-2019 to do esy import/export-dependencies
# which assumes you have bsdtar (tar.exe) in your system
# otherwise it will end up using the esy-bash tar which doesn't
# understand drives like D:/ (thinks it's an scp path).
- template: .ci/build-platform.yml
parameters:
platform: Windows
vmImage: windows-2019
- job: Docker_Alpine_Build_Experimental
displayName: Docker Alpine Build (experimental)
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
submodules: true
- script: sudo apt install jq gzip
displayName: Install deps
- bash: |
ESY__PROJECT_NAME=$(jq -r .name package.json)
ESY__PROJECT_VERSION=$(jq -r .version package.json)
echo "##vso[task.setvariable variable=esy__project_name]$ESY__PROJECT_NAME"
echo "##vso[task.setvariable variable=esy__project_version]$ESY__PROJECT_VERSION"
- script: docker build . -f docker/DevImage.Dockerfile --network=host -t $(esy__project_name)-dev
displayName: "Build Docker (dev) image"
- script: docker container run -itd --network=host --name $(esy__project_name)-container $(esy__project_name)-dev
displayName: "Run Docker container"
- script: docker cp $(esy__project_name)-container:/app/_release $PWD/_container_release
displayName: "Copy _release from container"
- script: npm pack
workingDirectory: _container_release
displayName: "Npm pack'ing"
- task: PublishBuildArtifacts@1
displayName: "Publish Docker built artifact"
inputs:
PathtoPublish: "_container_release/$(esy__project_name)-$(esy__project_version).tgz"
ArtifactName: DockerBuiltNPM.tgz
- script: docker build . -f docker/ProdImage.Dockerfile --network=host -t $(esy__project_name)
displayName: "Build production Docker image"
- script: docker save $(esy__project_name) | gzip > $(esy__project_name)-docker-image.tar.gz
displayName: "Save Docker image as tarball"
- task: PublishBuildArtifacts@1
displayName: "Publish Docker production image"
inputs:
PathtoPublish: "$(esy__project_name)-docker-image.tar.gz"
ArtifactName: DockerBuiltNPM.tgz
# This job is kept here as we want to have the platform names in the same file
- job: Release
displayName: Release
dependsOn:
- Linux
- macOS
- Windows
pool:
vmImage: macOS-latest
demands: node.js
steps:
- template: .ci/cross-release.yml
schedules:
- cron: "0 */12 * * *"
displayName: CRON build - twice a day
branches:
include:
- master
- releases/*
exclude:
- releases/ancient/*