forked from REGnosys/rosetta-code-generators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codefresh.yml
46 lines (43 loc) · 1.67 KB
/
codefresh.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
version: "1.0"
steps:
TagReleaseName:
title: Setup RELEASE_NAME variable with tag
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
image: alpine/git
when:
condition:
all:
releaseNameNotDefined: "${{TAG_REPO}} == false"
commands:
- cf_export RELEASE_NAME=${{GLOBAL_RELEASE_VERSION}}.${{CF_BRANCH_TAG_NORMALIZED}}
Build:
title: Maven build
fail_fast: true
image: regnosys-docker-registry.jfrog.io/regnosys/mvn-docker-build:java-11
working_directory: ./
commands:
- rm -rf /codefresh/volume/.m2/com/regnosys
- mvn -s /settings.xml versions:set -DnewVersion=${{RELEASE_NAME}}
- mvn -s /settings.xml versions:update-property -Dproperty=regnosys.common.version -DnewVersion=[${{RELEASE_NAME}}] -DallowSnapshots=true -DallowDowngrade=true
- mvn -U -s /settings.xml -Pregnosys clean deploy
TagRepo:
title: Tag git repo with release name
image: alpine/git
when:
condition:
all:
buildPassed: steps.BuildRelease.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/REGnosys/${{CF_REPO_NAME}}.git "+refs/tags/*:refs/tags/*"
- git tag ${{RELEASE_NAME}}
- git push https://${{REGNOSYS_OPS}}:${{REGNOSYS_OPS_TOKEN}}@github.com/REGnosys/${{CF_REPO_NAME}}.git ${{RELEASE_NAME}}