-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
69 lines (57 loc) · 2.08 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
name: NewsAppLayout
variables:
name: NpmFeed
value: 0995c973-a0a3-41c9-acbf-fca1ecf95883/d11ab0f1-e9d8-4188-b43a-7fdc976862de
trigger:
- master
jobs:
- job: Default
pool:
vmImage: ubuntu-22.04
steps:
- task: NodeTool@0
inputs:
versionSpec: "20.x"
displayName: "Install Node.js"
- task: npmAuthenticate@0
inputs:
workingFile: .npmrc
- script: npm install -g @angular/cli
displayName: "Install Angular CLI"
- script: npm install
displayName: "NPM Install"
- script: npm run lint
displayName: "Check Linting"
- script: npm run build
displayName: "Build"
- script: npm run format
displayName: "Check Formatting with Prettier"
- task: Npm@1
displayName: Lint
inputs:
command: custom
customCommand: run lint
verbose: true
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'PullRequest'))
- task: CmdLine@2
displayName: Copy bundle files
inputs:
script: |
set -ex
mkdir -pv $(Build.ArtifactStagingDirectory)/WebApps/webapps.newsApp
cp -r $(Build.SourcesDirectory)/dist/news-app/* $(Build.ArtifactStagingDirectory)/WebApps/webapps.newsApp
cp $(Build.SourcesDirectory)/bundle-description.json $(Build.ArtifactStagingDirectory)/WebApps
cp -r $(Build.SourcesDirectory)/thumbnail.svg $(Build.ArtifactStagingDirectory)/WebApps
- task: ArchiveFiles@2
displayName: Package files
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/WebApps"
includeRootFolder: true
archiveType: "zip"
archiveFile: "$(Build.ArtifactStagingDirectory)/NewsApp-$(Build.BuildNumber).zip"
replaceExistingArchive: true
- task: PublishPipelineArtifact@1
displayName: Publish bundle
inputs:
path: "$(Build.ArtifactStagingDirectory)/NewsApp-$(Build.BuildNumber).zip"
artifactName: "layouts"