forked from AxaFrance/oidc-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
91 lines (77 loc) · 3.46 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
# Node.js with React
# Build a Node.js project that uses React.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: 'Install Node.js'
- task: jessehouwing.jessehouwing-vsts-variable-tasks.vsts-variable-transform.VariableTransformTask@1
displayName: 'Transform value $(Build.SourceBranch) and assign to variable: SmartBrancheName'
inputs:
value: '$(Build.SourceBranch)'
variableName: SmartBranchName
searchReplace: true
searchValue: refs/heads/
trim: true
slice: false
substring: false
casing: false
pad: false
- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: SonarCloud
organization: axaguildev
scannerMode: CLI
configMode: manual
cliProjectKey: 'AxaGuilDEv_react-oidc'
cliProjectName: 'react-oidc'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
sonar.exclusions=**/*.stories.js,**/*.spec.js,**/*.spec.ts, **/*.spec.tsx, **/index.ts, **/index.js,scripts/**,coverage/**,**/node_modules/**,**/dist/**,**/__mocks__/**,examples/**,jest.config.js,packages/vanilla/**
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.sourceEncoding=UTF-8
sonar.verbose=true
sonar.host.url=https://sonarcloud.io
sonar.cfamily.build-wrapper-output.bypass=true
condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], 'False'))
- script: npm install
displayName: 'npm install and bootstrap'
- script: npm test -- --coverage
displayName: 'npm test'
- script: npm run lint
displayName: 'npm lint'
- script: npm run build:example:redux
displayName: 'build demos redux'
- script: npm run build:example:context
displayName: 'build demos context'
- script: npm run build:example:vanilla
displayName: 'build demos vanilla'
- script: |
git config --global user.email "[email protected]"
git config --global user.name "Build-CI"
git reset --hard
git remote set-url origin https://$(Github.Token)@github.com/AxaGuilDEv/react-oidc.git
git checkout $(SmartBranchName)
node ./scripts/npm.js $(NPM_TOKEN)
cp .npmrc $HOME/.npmrc
git status
displayName: 'configuration'
condition: and(succeeded(), ne(variables['Npm.Publish.Version'], 'none'))
- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1
displayName: 'Run Code Analysis'
condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], 'False'))
- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], 'False'))
- script: |
npm run publish -- $(Npm.Publish.Version) --yes --concurrency 1 --force-publish
node ./scripts/publish-changelog.js $(Github.Token)
node ./scripts/twitter.js $(Twitter.consumer_key) $(Twitter.consumer_secret) $(Twitter.access_token) $(Twitter.access_token_secret)
displayName: 'lerna publish'
condition: and(succeeded(), ne(variables['Npm.Publish.Version'], 'none'))