Repository navigation
Expand file tree
/
Copy pathcodefresh.yml
More file actions
57 lines (50 loc) · 1.87 KB
/
Copy pathcodefresh.yml
File metadata and controls
57 lines (50 loc) · 1.87 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
version: "1.0"
steps:
main_clone:
type: git-clone
git: rosetta-models
repo: "${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}"
revision: "${{CF_REVISION}}"
IsTriggeredByGitHubRelease:
image: alpine
commands:
- if [[ '${{CF_RELEASE_TAG}}' == *'CF_RELEASE_TAG'* ]]; then cf_export IS_RELEASE=false; else cf_export IS_RELEASE=true; fi
ReleaseNameForTag:
image: alpine/git
when:
condition:
all:
releaseNameNotDefined: "${{IS_RELEASE}} == true"
commands:
- cf_export RELEASE_NAME=${{CF_RELEASE_TAG}}
MvnSettings:
image: alpine
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"
ReleaseNameForBranch:
image: alpine/git
when:
condition:
all:
releaseNameNotDefined: "${{IS_RELEASE}} == false"
commands:
- cf_export RELEASE_NAME=${{GLOBAL_RELEASE_VERSION}}.${{CF_BRANCH_TAG_NORMALIZED}}-SNAPSHOT
# Exports GCP_ACCESS_TOKEN, which the Artifact Registry servers in settings.xml
# use as their Basic auth password, by workload identity federation rather than
# a service account key. Step definition lives in the REGnosys/scripts repo, at
# codefresh/step-types/gcp-oidc-auth.yml.
#
# Last of the setup steps on purpose: the token lasts an hour from here, and
# everything that spends it is below.
Authenticate:
title: Federate into GCP
type: regnosysops/gcp-oidc-auth:1.1.0
arguments:
WIF_PROVIDER: ${{GCP_WIF_PROVIDER_CODEFRESH_AUDIENCE}}
SERVICE_ACCOUNT: ${{GCP_CODEFRESH_SERVICE_ACCOUNT}}
Build:
image: maven:3.9.11-eclipse-temurin-21-alpine
working_directory: ./
commands:
- mvn ${{MVN_CLI_OPT}} versions:set -DnewVersion=${{RELEASE_NAME}}
- NORMALISE_SAMPLE_VERSION=true mvn ${{MVN_CLI_OPT}} clean deploy