-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcodefresh.yml
More file actions
131 lines (121 loc) · 3.99 KB
/
Copy pathcodefresh.yml
File metadata and controls
131 lines (121 loc) · 3.99 KB
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
version: "1.0"
stages:
- setup
- build
- finalise
steps:
main_clone:
title: Cloning main repository...
stage: 'setup'
type: git-clone
git: github
repo: "${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}"
revision: "${{CF_REVISION}}"
SetProperties:
title: Setup build
stage: 'setup'
image: alpine/git
commands:
- cf_export GPG_IMPORT_COMMAND="cat <(echo -e '${{GPG_PRIVATE_KEY}}') | gpg --batch --import" --mask
MvnSettings:
stage: 'setup'
title: Setup Maven settings
image: alpine/git
commands:
- cf_export MVN_CLI_OPT="-Dmaven.repo.local=\"${{CF_VOLUME_PATH}}/${{CF_REPO_NAME}}_m2/repository\" -s ${{CF_VOLUME_PATH}}/${{CF_REPO_NAME}}/settings.xml"
TagReleaseName:
title: Setup RELEASE_NAME variable with tag
stage: 'setup'
image: alpine/git
when:
condition:
all:
releaseNameNotDefined: "${{TAG_REPO}} == true"
commands:
- cf_export RELEASE_NAME=${{TAG_NAME}}
BranchReleaseName:
title: Setup RELEASE_NAME variable with branch name
stage: 'setup'
image: alpine/git
when:
condition:
all:
releaseNameNotDefined: "${{TAG_REPO}} == false"
commands:
- cf_export RELEASE_NAME=${{GLOBAL_RELEASE_VERSION}}.${{CF_BRANCH_TAG_NORMALIZED}}-SNAPSHOT
ReleaseProperties:
title: Setup release build
stage: 'setup'
image: alpine/git
when:
condition:
all:
releaseNameNotDefined: "${{TAG_REPO}} == true"
commands:
- cf_export MVN_SET_VERSION="${{MVN_CLI_OPT}} versions:set-property -DnewVersion=${{RELEASE_NAME}}"
BranchProperties:
title: Setup branch build
stage: 'setup'
image: alpine/git
when:
condition:
all:
releaseNameNotDefined: "${{TAG_REPO}} == false"
commands:
- cf_export MVN_SET_VERSION="${{MVN_CLI_OPT}} versions:update-property -DnewVersion=[${{RELEASE_NAME}}] -DallowSnapshots=true -DallowDowngrade=true"
BuildTesting:
title: Maven build rune-testing
stage: 'build'
fail_fast: false
image: maven:3.9.16-eclipse-temurin-21-alpine
working_directory: ./
commands:
- rm -rf /codefresh/volume/.m2/com/regnosys
- bash -c "${{GPG_IMPORT_COMMAND}}"
- mvn ${{MVN_CLI_OPT}} versions:set -DnewVersion=${{RELEASE_NAME}}
- mvn ${{MVN_SET_VERSION}} -Dproperty=rune.common.version
- export CI_DEPLOY_USERNAME="${{CI_DEPLOY_USERNAME_FINOS}}"
- export CI_DEPLOY_PASSWORD="${{CI_DEPLOY_PASSWORD_FINOS}}"
- export GPG_KEYNAME="${{GPG_KEYNAME}}"
- export GPG_PASSPHRASE="${{GPG_PASSPHRASE}}"
- mvn -U -B ${{MVN_CLI_OPT}} clean install org.sonatype.central:central-publishing-maven-plugin:0.7.0:publish -P release
FailPipeline:
title: Fail pipeline if the Maven build failed
stage: 'finalise'
image: codefresh/cli
when:
steps:
- name: BuildTesting
on:
- failure
commands:
- exit 1
TagRepo:
title: Tag git repo with release name
stage: 'finalise'
image: alpine/git
when:
condition:
all:
buildTestingPassed: steps.BuildTesting.result == 'success'
isRelease: "${{TAG_REPO}}"
commands:
- echo This is a release build, tag repos with release name [${{RELEASE_NAME}}]
- git fetch --prune https://${{REGNOSYS_OPS}}:${{REGNOSYS_OPS_TOKEN}}@github.com/finos/${{CF_REPO_NAME}}.git "+refs/tags/*:refs/tags/*"
- git tag ${{RELEASE_NAME}}
- git push https://${{REGNOSYS_OPS}}:${{REGNOSYS_OPS_TOKEN}}@github.com/finos/${{CF_REPO_NAME}}.git ${{RELEASE_NAME}}
StartNextBuild:
title: Build rosetta-components if on main
stage: 'finalise'
image: codefresh/cli
when:
branch:
only:
- main
condition:
all:
buildPassed: steps.BuildTesting.result == 'success'
variableDefined: "${{TAG_REPO}} == false"
skipNextBuild: "${{SKIP_NEXT_BUILD}} == false"
commands:
- codefresh run BUNDLE/rosetta-components --branch main --detach