forked from jlorich/azure-pipelines-extension-vault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-extension-build.yml
49 lines (38 loc) · 1.44 KB
/
azure-pipelines-extension-build.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
parameters:
publisher:
tasks:
jobs:
- job: Build
displayName: Build and Test
pool:
vmImage: 'Ubuntu-16.04'
steps:
# Use GitVersion to determine the appropriate Semantic Version Number
- task: GitVersion@5
inputs:
runtime: 'core'
# Set the BuildNumber
- script: |
echo "##vso[build.updatebuildnumber]$(GitVersion.MajorMinorPatch)"
displayName: 'Set Bulid Number'
# Build and test each listed task
- ${{ each taskName in parameters.tasks }}:
- template: azure-pipelines-task-build.yml
parameters:
taskName: ${{ taskName }}
# Package the extension manifest
- script: |
# Display command output and fail immediately on any errors
set -e -x
# Update the extension version
sed -i -E 's/"version":\s"[0-9/.]+"/"version": "$(GitVersion.MajorMinorPatch)"/g' vss-extension.json
# Update the publisher
sed -i -E 's/"publisher":\s"[a-zA-Z0-9_-]+"/"publisher": "${{ parameters.publisher }}"/g' vss-extension.json
# Copy the extension manifest to the output directory
cp ./vss-extension.json $(Build.StagingDirectory)/
# Copy in any Image Assets
rsync -avr --ignore-errors ./images $(Build.StagingDirectory)
displayName: Package the extension manifest and metadata
# Publish the finished extension to a pipeline artifact
- publish: $(Build.StagingDirectory)
artifact: extension