Skip to content

Commit b58bc5c

Browse files
mydiemhowbreza
authored andcommitted
ci: refactor web deploy pipeline (microsoft#702)
* move deploy functionality to release * replace az storage command with az copy ADO task
1 parent b0cd040 commit b58bc5c

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ insert_final_newline = true
1313
trim_trailing_whitespace = true
1414
indent_style = space
1515
indent_size = 4
16+
17+
[*.yml]
18+
indent_size = 2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
trigger:
2+
branches:
3+
include:
4+
- dev*
5+
- v2
6+
pr: none # disable CI build for PR
7+
8+
pool:
9+
vmImage: 'Ubuntu-16.04'
10+
11+
steps:
12+
- task: NodeTool@0
13+
displayName: 'Use Node 10.x'
14+
inputs:
15+
versionSpec: 10.x
16+
17+
- task: Npm@1
18+
displayName: 'npm ci'
19+
inputs:
20+
command: custom
21+
workingDir: .
22+
verbose: false
23+
customCommand: ci
24+
25+
- task: Bash@3
26+
displayName: 'Create artifact'
27+
inputs:
28+
targetType: filePath
29+
filePath: './scripts/generate-web-artifact.sh'
30+
31+
- task: PublishBuildArtifacts@1
32+
displayName: 'Publish Artifact: build'
33+
inputs:
34+
PathtoPublish: ./build
35+
ArtifactName: build

scripts/generate-web-artifact.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# NOTE: this script should be ran from the root of the repository; the CWD should reflect this
5+
VERSION=$(node -pe "require('./package.json').version")
6+
COMMIT_SHA=$(git rev-parse --short HEAD)
7+
8+
echo "cwd=$(pwd)"
9+
echo "version=${VERSION}"
10+
echo "commit=${COMMIT_SHA}"
11+
12+
# use by web pack
13+
export REACT_APP_VERSION=${VERSION}
14+
export REACT_APP_COMMIT_SHA=${COMMIT_SHA}
15+
16+
# npm install will be in a standalone task
17+
npm run release-web

0 commit comments

Comments
 (0)