forked from jflamy/owlcms4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
176 lines (170 loc) · 7.37 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
trigger:
- none
parameters:
- name: Revision
type: string
default: 38.4.1
- name: SkipTests
type: string
default: 'false'
variables:
# overrides pom.xml; must be unique if BuildGoal is set to deploy.
- name: Revision
value: ${{ parameters.Revision }}
# if BuildGoal = 'deploy', the uberjars will be published on the maven repository. 'package' does not deploy
# to maven repository, so Revision can be kept for several runs when debugging the installers.
- name: BuildGoal
value: deploy
# ReleaseRepoCredentials contains github users and tokens
- group: ReleaseRepoCredentials
- template: src/main/azure-pipelines/variables-releaseRepoCredentials.yml
- name: MavenCacheFolder
value: $(Pipeline.Workspace)/.m2/repository
- name: MavenOpts
value: -Dmaven.repo.local=$(MavenCacheFolder) -Drevision=$(Revision)
jobs:
# build owlcms uberjar, zip and installer
- template: src/main/azure-pipelines/job-buildUberJar.yml
parameters:
jobName: BuildOwlcmsUberJar
moduleName: owlcms
artifactName: OwlcmsZip
skipTests: ${{ parameters.skipTests }}
- template: src/main/azure-pipelines/job-createInstaller.yml
parameters:
jobName: CreateOwlcmsInstaller
dependsOn: BuildOwlcmsUberJar
moduleName: owlcms
artifactName: OwlcmsSetup
# - template: src/main/azure-pipelines/job-herokuRelease.yml
# parameters:
# jobName: ReleaseOwlcmsHeroku
# dependsOn: BuildOwlcmsUberJar
# moduleName: owlcms
# build publicresults uberjar, zip and installer
- template: src/main/azure-pipelines/job-buildUberJar.yml
parameters:
jobName: BuildPublicResultsUberJar
moduleName: publicresults
artifactName: PublicResultsZip
- template: src/main/azure-pipelines/job-createInstaller.yml
parameters:
jobName: CreatePublicResultsInstaller
dependsOn: BuildPublicResultsUberJar
moduleName: publicresults
artifactName: PublicResultsSetup
# - template: src/main/azure-pipelines/job-herokuRelease.yml
# parameters:
# jobName: ReleasePublicResultsHeroku
# dependsOn:
# - BuildPublicResultsUberJar
# - BuildOwlcmsUberJar
# moduleName: publicresults
# release the installers to github repositories
- job: ReleaseInstallers
dependsOn:
- CreateOwlcmsInstaller
- CreatePublicResultsInstaller
pool:
vmImage: ubuntu-latest
steps:
- download: current
artifact: OwlcmsZip
- download: current
artifact: OwlcmsSetup
- download: current
artifact: PublicResultsZip
- download: current
artifact: PublicResultsSetup
- template: src/main/azure-pipelines/steps-prepare-maven.yml
- task: [email protected]
displayName: Build and Push Docker Images
inputs:
mavenPomFile: owlcms-docker/pom.xml
mavenOptions: -Xmx3072m $(MavenOpts)
javaHomeOption: JDKVersion
jdkVersionOption: '1.11'
jdkArchitectureOption: x64
publishJUnitResults: false
goals: deploy $(MavenOpts)
env:
DOCKER_REG: $(DOCKER_REG)
DOCKER_USER: $(DOCKER_USER)
DOCKER_TOKEN: $(DOCKER_TOKEN)
DOCKER_TAG: $(DOCKER_TAG)
- task: [email protected]
displayName: Pre-process Release Notes
inputs:
mavenPomFile: pom.xml
mavenOptions: -Xmx3072m $(MavenOpts)
javaHomeOption: JDKVersion
jdkVersionOption: '1.11'
jdkArchitectureOption: x64
publishJUnitResults: false
goals: package $(MavenOpts) --non-recursive -Dmaven.test.skip=true
env:
# used by maven for substitutions in release notes and URLs
REPO_OWNER: $(RELEASE_USER)
H_REPO_NAME: owlcms-heroku$(RELEASE_SUFFIX)
P_REPO_NAME: publicresults-heroku$(RELEASE_SUFFIX)
O_REPO_NAME: owlcms4$(RELEASE_SUFFIX)
- script: |
# push changes back to origin and tag
# library group ReleaseRepoCredentials contains github users and tokens
git config user.email "$(Build.RequestedForEmail)"
git config user.name "$(Build.RequestedFor)"
git checkout $(Build.SourceBranchName)
git add -A && git commit -m "$(Revision) [skip ci]" --allow-empty
git tag $(Revision) -f -a -m "$(Revision)"
git push https://$(repoToken)@github.com/$(repoUser)/owlcms4.git $(Build.SourceBranchName) --force
git push https://$(repoToken)@github.com/$(repoUser)/owlcms4.git $(Revision) --force
displayName: tag origin
- script: |
# publish sources and docs to prerelease repo
# library group ReleaseRepoCredentials contains github users and tokens
git push https://$(releaseToken)@github.com/$(releaseUser)/owlcms4$(RELEASE_SUFFIX).git $(Build.SourceBranchName):master --force
condition: or(eq(variables['Build.SourceBranchName'], 'develop'), eq(variables['Build.SourceBranchName'], 'v23_38_1b03'))
displayName: sync prerelease repo
- script: |
# publish sources and docs to release repo
# library group ReleaseRepoCredentials contains github users and tokens
git push https://$(releaseToken)@github.com/$(releaseUser)/owlcms4.git $(Build.SourceBranchName):master --force
condition: or(eq(variables['Build.SourceBranchName'], 'master'),eq(variables['Build.SourceBranchName'], 'v23'))
displayName: sync release repo
# all releases are marked as "isPreRelease: false" else we cannot have a generic link to the latest prerelease.
# the repo and name determines the maturity status.
- task: GitHubRelease@0
displayName: Release on Github
inputs:
${{ if eq(variables['Build.SourceBranchName'], 'develop') }}:
gitHubConnection: github.com_jflamy-dev
repositoryName: $(RELEASE_USER)/owlcms4$(RELEASE_SUFFIX)
isPreRelease: false
${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
gitHubConnection: github.com_jflamy-dev
repositoryName: $(RELEASE_USER)/owlcms4$(RELEASE_SUFFIX)
isPreRelease: false
${{ if eq(variables['Build.SourceBranchName'], 'v23') }}:
gitHubConnection: github.com_jflamy-dev
repositoryName: $(RELEASE_USER)/owlcms4$(RELEASE_SUFFIX)
isPreRelease: false
${{ if eq(variables['Build.SourceBranchName'], 'v23_38_1b03') }}:
gitHubConnection: github.com_jflamy-dev
repositoryName: $(RELEASE_USER)/owlcms4$(RELEASE_SUFFIX)
isPreRelease: false
action: "create" # Options: create, edit, delete
target: master # all our releases are on the master branch of the release repos.
tagSource: "manual"
title: $(Revision)
tag: $(Revision)
releaseNotesSource: "file"
releaseNotesFile: $(Build.SourcesDirectory)/ReleaseNotes.md # Optional
assets: |
$(Pipeline.Workspace)/OwlcmsZip/*
$(Pipeline.Workspace)/PublicResultsZip/*
$(Pipeline.Workspace)/OwlcmsSetup/*
$(Pipeline.Workspace)/PublicResultsSetup/*
$(Agent.BuildDirectory)/s/owlcms-docker/target/k8s.zip
$(Agent.BuildDirectory)/s/owlcms-docker/target/k8s/k3s_setup.yaml
assetUploadMode: "delete" # Optional. Options: delete, replace
addChangeLog: false # Optional