Skip to content

Commit

Permalink
Port pipeline update to 0.23.x (#3213)
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisman authored Aug 15, 2020
1 parent a45a0b4 commit 0ee022d
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 63 deletions.
1 change: 1 addition & 0 deletions tools/pipelines/build-build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ extends:
taskBuildDocs: false
taskLint: false
taskTest: false
taskAuth: false
2 changes: 2 additions & 0 deletions tools/pipelines/build-build-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ extends:
taskBuildDocs: false
taskLint: false
taskTest: false
taskAuth: false
buildNumberInPatch: true
12 changes: 10 additions & 2 deletions tools/pipelines/build-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,21 @@ extends:
cgSubDirectory: packages
checkoutSubmodules: true
preCG:
- task: UseNode@1
displayName: Use Node 12.x
inputs:
version: 12.x
- task: npmAuthenticate@0
displayName: 'npm Authenticate root .npmrc'
inputs:
workingFile: .npmrc
customEndpoint: Offnet Packages
- task: Npm@1
displayName: npm ci
inputs:
command: 'custom'
customCommand: 'ci --ignore-scripts'
customRegistry: 'useFeed'
customFeed: '0a22f611-6a4a-4416-a1bb-53ed7284aa21/f56654ac-3b25-4f5c-bd34-2c1b79e8cfa6'
customRegistry: 'useNpmrc'

- task: Bash@3
displayName: 'Generate Mono repo package json'
Expand Down
1 change: 1 addition & 0 deletions tools/pipelines/build-eslint-config-fluid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ extends:
taskBuildDocs: false
taskLint: false
taskTest: false
taskAuth: false
2 changes: 2 additions & 0 deletions tools/pipelines/build-generator-fluid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ extends:
taskLint: false
taskTest: test
namespace: false
extraAuth: app/templates
buildNumberInPatch: true
2 changes: 2 additions & 0 deletions tools/pipelines/build-test-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ extends:
taskBuildDocs: false
taskLint: false
taskTest: false
taskAuth: false
buildNumberInPatch: true
1 change: 1 addition & 0 deletions tools/pipelines/build-tinylicious.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ extends:
taskLint: true
taskTest: false
namespace: false
buildNumberInPatch: true
18 changes: 16 additions & 2 deletions tools/pipelines/repo-policy-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,28 @@ pr:
pool:
vmImage: 'ubuntu-latest'

variables:
- name: skipComponentGovernanceDetection
value: true

steps:
- task: UseNode@1
displayName: Use Node 12.x
inputs:
version: 12.x

- task: npmAuthenticate@0
displayName: 'npm Authenticate root .npmrc'
inputs:
workingFile: .npmrc
customEndpoint: Offnet Packages

- task: Npm@1
displayName: npm ci
inputs:
command: 'custom'
customCommand: 'ci --ignore-scripts'
customRegistry: 'useFeed'
customFeed: '0a22f611-6a4a-4416-a1bb-53ed7284aa21/f56654ac-3b25-4f5c-bd34-2c1b79e8cfa6'
customRegistry: 'useNpmrc'

- task: Npm@1
displayName: Policy Check
Expand Down
70 changes: 47 additions & 23 deletions tools/pipelines/server-routerlicious.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,49 +35,71 @@ pr:
- server/routerlicious/kubernetes/routerlicious

variables:
skipComponentGovernanceDetection: true
pushImage: ${{
- name: skipComponentGovernanceDetection
value: true
- name: pushImage
value: ${{
and(
ne(variables['Build.Reason'], 'PullRequest'),
eq(variables['Build.SourceBranch'], 'refs/heads/master')
ne(variables['Build.Reason'], 'PullRequest'),
eq(variables['Build.SourceBranch'], 'refs/heads/master')
)}}
registry: prague.azurecr.io
containerName: prague-server
baseContainerName: $(containerName)-base
baseContainerTag: $(baseContainerName):$(Build.BuildId)
fullRunnerContainerTag: $(registry)/$(containerName):$(Build.BuildId)
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
testConfig: :full
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
testConfig: :ci
- group: container-registry-info
- name: containerName
value: fluid-server
- name: baseContainerName
value: $(containerName)-base
- name: baseContainerTag
value: $(baseContainerName):$(Build.BuildNumber)
- name: fullRunnerContainerTag
value: $(containerRegistryUrl)/$(containerName):$(Build.BuildNumber)
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- name: testConfig
value: :full
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- name: testConfig
value: :ci

stages:
- stage: build
displayName: Build Stage
jobs:
- job: build
displayName: Build - Server
pool: Default
pool: Main
steps:
# Checkout
- checkout: self
clean: true
lfs: false
submodules: false

- task: Bash@3
displayName: Strip MIT License
inputs:
targetType: 'inline'
workingDirectory: server/routerlicious
script: |
sed -i '/^.*Licensed under the MIT License.$/d' `find -type f | grep -v '^\.\/\.'`
perl -i -0pe 's/,\n.*"license": "MIT"//g' `find | grep package.json`
git status
# Component detection (not pull request)
- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- task: UseNode@1
displayName: Use Node 12.x
inputs:
version: 12.x
- task: npmAuthenticate@0
displayName: 'npm Authenticate root .npmrc'
inputs:
workingFile: .npmrc
customEndpoint: Offnet Packages
- task: Npm@1
displayName: npm ci
inputs:
command: 'custom'
customCommand: 'ci --ignore-scripts'
customRegistry: 'useFeed'
customFeed: '0a22f611-6a4a-4416-a1bb-53ed7284aa21/f56654ac-3b25-4f5c-bd34-2c1b79e8cfa6'
customRegistry: 'useNpmrc'
- bash: |
# Generate the package/package lock for the lerna project so we would scan it.
node node_modules/@fluidframework/build-tools/dist/genMonoRepoPackageJson/genMonoRepoPackageJson.js
Expand All @@ -104,6 +126,7 @@ stages:
displayName: npm Authenticate
inputs:
workingFile: server/routerlicious/.npmrc
customEndpoint: Offnet Packages

# Build
- task: Docker@2
Expand All @@ -113,9 +136,9 @@ stages:
command: build
dockerFile: server/routerlicious/Dockerfile
buildContext: server/routerlicious
arguments: --target base --build-arg VERSION_BUILDNUMBER=$(Build.BuildId) --build-arg VERSION_BUILDBRANCH=$(Build.SourceBranch)
arguments: --target base --build-arg VERSION_BUILDNUMBER=$(Build.BuildNumber) --build-arg VERSION_BUILDBRANCH=$(Build.SourceBranch)
tags: |
$(Build.BuildId)
$(Build.BuildNumber)
# Pack
- task: Docker@0
Expand Down Expand Up @@ -180,23 +203,23 @@ stages:
- task: Docker@2
displayName: 'Docker Build - Runner'
inputs:
containerRegistry: Fluid Azure Container Registry
containerRegistry: $(containerRegistryConnection)
repository: $(containerName)
command: build
dockerFile: server/routerlicious/Dockerfile
buildContext: server/routerlicious
arguments: '--target runner --build-arg VERSION_BUILDNUMBER=$(Build.BuildId) --build-arg VERSION_BUILDBRANCH=$(Build.SourceBranch)'
arguments: '--target runner --build-arg VERSION_BUILDNUMBER=$(Build.BuildNumber) --build-arg VERSION_BUILDBRANCH=$(Build.SourceBranch)'
tags: |
$(Build.BuildId)
$(Build.BuildNumber)
- task: Docker@2
displayName: 'Docker Push - Runner'
inputs:
containerRegistry: Fluid Azure Container Registry
containerRegistry: $(containerRegistryConnection)
repository: $(containerName)
command: push
tags: |
$(Build.BuildId)
$(Build.BuildNumber)
# Cleanup
- task: Docker@0
Expand Down Expand Up @@ -235,6 +258,7 @@ stages:
feeds:
- name: https://offnet.pkgs.visualstudio.com/officenet/_packaging/fluid/npm/registry/
environment: fluid-feed
customEndPoint: Offnet Packages
internal: false
# only publish release bits
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
Expand Down
41 changes: 21 additions & 20 deletions tools/pipelines/templates/build-docker-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ parameters:
trigger: none

variables:
skipComponentGovernanceDetection: true
pushImage: ${{
and(
ne(variables['Build.Reason'], 'PullRequest'),
eq(variables['Build.SourceBranch'], 'refs/heads/master')
)}}
generateNotice: ${{ ne(variables['Build.Reason'], 'PullRequest') }}
registry: prague.azurecr.io
baseContainerTag: ${{ parameters.containerName }}:$(Build.BuildId)
${{ if eq(variables.pushImage, false) }}:
containerRegistry:
containerTag: $(baseContainerTag)
${{ if eq(variables.pushImage, true) }}:
containerRegistry: Fluid Azure Container Registry
containerTag: $(registry)/$(baseContainerTag)
- name: skipComponentGovernanceDetection
value: true
- name: pushImage
value: ${{ ne(variables['Build.Reason'], 'PullRequest') }}
- name: generateNotice
value: ${{ ne(variables['Build.Reason'], 'PullRequest') }}
- group: container-registry-info
- name: baseContainerTag
value: ${{ parameters.containerName }}:$(Build.BuildNumber)
- ${{ if eq(variables.pushImage, false) }}:
- name: containerTag
value: $(baseContainerTag)
- ${{ if eq(variables.pushImage, true) }}:
- name: containerTag
value: $(containerRegistryUrl)/$(baseContainerTag)

jobs:
- job: build
displayName: Build Container - ${{ parameters.containerName }}
pool: Shared
pool: Lite
steps:
# Setup
- checkout: self
Expand Down Expand Up @@ -75,18 +75,19 @@ jobs:
displayName: 'npm Authenticate ${{ parameters.buildDirectory }}/.npmrc'
inputs:
workingFile: ${{ parameters.buildDirectory }}/.npmrc
customEndpoint: Offnet Packages

# Build
- task: Docker@2
displayName: Docker Build
inputs:
containerRegistry: $(containerRegistry)
containerRegistry: $(containerRegistryConnection)
repository: ${{ parameters.containerName }}
command: build
dockerFile: ${{ parameters.buildDirectory }}/Dockerfile
buildContext: ${{ parameters.buildDirectory }}
tags: |
$(Build.BuildId)
$(Build.BuildNumber)
# Lint
- ${{ if eq(parameters.lint, true) }}:
Expand Down Expand Up @@ -125,11 +126,11 @@ jobs:
- task: Docker@2
displayName: Docker Push
inputs:
containerRegistry: $(containerRegistry)
containerRegistry: $(containerRegistryConnection)
repository: ${{ parameters.containerName }}
command: push
tags: |
$(Build.BuildId)
$(Build.BuildNumber)
# Cleanup
- task: Docker@0
Expand Down
10 changes: 7 additions & 3 deletions tools/pipelines/templates/build-docs-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,23 @@ steps:
OverWrite: false
flattenFolders: true
CleanTargetFolder: true


- task: UseNode@1
displayName: Use Node 12.x
inputs:
version: 12.x
- task: npmAuthenticate@0
displayName: 'npm Authenticate root .npmrc'
inputs:
workingFile: .npmrc
customEndpoint: Offnet Packages

- task: Npm@1
displayName: npm ci
inputs:
command: 'custom'
customCommand: 'ci --ignore-scripts'
customRegistry: 'useFeed'
customFeed: '0a22f611-6a4a-4416-a1bb-53ed7284aa21/f56654ac-3b25-4f5c-bd34-2c1b79e8cfa6'
customRegistry: 'useNpmrc'

# Build the docs site
- task: Docker@2
Expand Down
Loading

0 comments on commit 0ee022d

Please sign in to comment.