-
Notifications
You must be signed in to change notification settings - Fork 160
/
Copy pathpipelines.release.yml
100 lines (87 loc) · 4.27 KB
/
pipelines.release.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
pipelines:
- name: release_build_info
configuration:
runtime:
type: image
image:
auto:
language: java
versions:
- "8"
environmentVariables:
readOnly:
NEXT_VERSION: 2.0.0
NEXT_DEVELOPMENT_VERSION: 2.0.x-SNAPSHOT
NEXT_GRADLE_VERSION: 4.0.0
NEXT_GRADLE_DEVELOPMENT_VERSION: 4.0.x-SNAPSHOT
SKIP_AUDIT_CHECK: "false"
steps:
- name: Release
type: Bash
configuration:
inputResources:
- name: biReleaseGit
integrations:
- name: il_automation
- name: ecosys_entplus_deployer
- name: mvn_central
execution:
onExecute:
- cd $res_biReleaseGit_resourcePath
# Set env
- export CI=true
- export JFROG_BUILD_STATUS=PASS
- export JFROG_CLI_BUILD_NAME=ecosystem-build-info-release
- export JFROG_CLI_BUILD_NUMBER=$run_number
- export JFROG_CLI_BUILD_PROJECT=ecosys
# Configure git
- git checkout master
- git remote set-url origin https://[email protected]/jfrog/build-info.git
# Make sure versions provided
- echo "Checking variables"
- test -n "$NEXT_VERSION" -a "$NEXT_VERSION" != "2.0.0"
- test -n "$NEXT_GRADLE_VERSION" -a "$NEXT_GRADLE_VERSION" != "4.0.0"
- test -n "$NEXT_DEVELOPMENT_VERSION" -a "$NEXT_DEVELOPMENT_VERSION" != "2.0.x-SNAPSHOT"
- test -n "$NEXT_GRADLE_DEVELOPMENT_VERSION" -a "$NEXT_GRADLE_DEVELOPMENT_VERSION" != "4.0.x-SNAPSHOT"
# Configure JFrog CLI
- curl -fL https://install-cli.jfrog.io | sh
- jf c rm --quiet
- jf c add internal --url=$int_ecosys_entplus_deployer_url --user=$int_ecosys_entplus_deployer_user --password=$int_ecosys_entplus_deployer_apikey
- jf gradlec --use-wrapper --uses-plugin --repo-resolve ecosys-maven-remote --repo-deploy ecosys-oss-release-local
# Run audit
- |
if [[ $SKIP_AUDIT_CHECK == "true" ]]; then
echo "Skipping audit check"
else
echo "Running audit check"
jf audit --fail=false
fi
# Update version
- sed -i -e "/build-info-version=/ s/=.*/=$NEXT_VERSION/" -e "/build-info-extractor-gradle-version=/ s/=.*/=$NEXT_GRADLE_VERSION/" gradle.properties
- git commit -am "[artifactory-release] Release version ${NEXT_VERSION} [skipRun]" --allow-empty
- git tag build-info-extractor-${NEXT_VERSION}
- git tag build-info-gradle-extractor-${NEXT_GRADLE_VERSION}
- git push
- git push --tags
# Run install and publish
- >
ORG_GRADLE_PROJECT_signingKey=$(echo $int_mvn_central_signingKey | base64 -d)
ORG_GRADLE_PROJECT_signingPassword=$int_mvn_central_signingPassword
jf gradle clean aP -x test -Psign
- jf rt bag && jf rt bce
- jf rt bp
# Distribute release bundle
- jf ds rbc ecosystem-build-info $NEXT_VERSION --spec=./release/specs/prod-rbc-filespec.json --spec-vars="version=$NEXT_VERSION;gradleVersion=$NEXT_GRADLE_VERSION" --sign
- jf ds rbd ecosystem-build-info $NEXT_VERSION --site="releases.jfrog.io" --sync
# Publish to Maven Central
- >
ORG_GRADLE_PROJECT_sonatypeUsername=$int_mvn_central_user
ORG_GRADLE_PROJECT_sonatypePassword=$int_mvn_central_password
ORG_GRADLE_PROJECT_signingKey=$(echo $int_mvn_central_signingKey | base64 -d)
ORG_GRADLE_PROJECT_signingPassword=$int_mvn_central_signingPassword
./gradlew clean build publishToSonatype closeAndReleaseSonatypeStagingRepository -x test -Psign
# Update next development version
- sed -i -e "/build-info-version=/ s/=.*/=$NEXT_DEVELOPMENT_VERSION/" -e "/build-info-extractor-gradle-version=/ s/=.*/=$NEXT_GRADLE_DEVELOPMENT_VERSION/" gradle.properties
- git commit -am "[artifactory-release] Next development version [skipRun]"
# Push changes
- git push