Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 73 additions & 15 deletions build/gen-mvn-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ set -o nounset
set -o pipefail

IFS=$'\n\t'
SCRIPT_FOLDER="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
SCRIPT_NAME="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

LOCAL_CONFIG="${HOME}/.cbi/config"
Expand Down Expand Up @@ -83,6 +82,7 @@ gen_server() {
local serverId="${1}"
local server="${2}"
local username_pass password_pass passphrase_pass
httpHeaders="$(jq -r '.httpHeaders' <<< "${server}")"
username_pass="$(jq -r '.username.pass' <<< "${server}")"
password_pass="$(jq -r '.password.pass' <<< "${server}")"
passphrase_pass="$(jq -r '.passphrase.pass' <<< "${server}")"
Expand All @@ -93,20 +93,34 @@ gen_server() {
username="$(pass "${username_pass}")"
password="$(pass "${password_pass}")"

local server_password server_username nexusProUrl
nexusProUrl="$(jq -r '.nexusProUrl | select (.!=null)' <<< "${server}")"
if [[ -n "${nexusProUrl}" ]]; then
>&2 echo -e "${SCRIPT_NAME}\tINFO: Server '${serverId}' will use Nexus Pro token for credentials"
>&2 echo -e "${SCRIPT_NAME}\tINFO: Nexus Pro URL: '${nexusProUrl}'"
# this server has a nexus Pro URL set, get a token to authenticate instead of using the account username/password
local token
token="$("${SCRIPT_FOLDER}/nexus-pro-token.sh" get_or_create "${nexusProUrl}" "${username}" "${password}")"
server_username="$(jq -r '.nameCode' <<< "${token}")"
server_password=$(mvn --encrypt-password "$(jq -r '.passCode' <<< "${token}")" -Dsettings.security="${SETTINGS_SECURITY_XML}")
if [[ "${httpHeaders}" == "true" ]]; then
>&2 echo -e "${SCRIPT_NAME}\tINFO: - using httpHeaders for authentication"

bearer=$(printf "${username}:${password}" | base64)
cat <<EOF
<server>
<id>${serverId}</id>
<configuration>
<httpHeaders>
<property>
<name>Authorization</name>
<value>Bearer ${bearer}</value>
</property>
</httpHeaders>
</configuration>
</server>
<server>
<id>central.staging</id>
<username>${username}</username>
<password>${bearer}</password>
</server>
EOF

else
server_username="${username}"
server_password=$(mvn --encrypt-password "$(printf "%s" "${password}")" -Dsettings.security="${SETTINGS_SECURITY_XML}")
fi
>&2 echo -e "${SCRIPT_NAME}\tINFO: - using username/password for authentication"
local server_password server_username
server_username="${username}"
server_password=$(mvn --encrypt-password "$(printf "%s" "${password}")" -Dsettings.security="${SETTINGS_SECURITY_XML}")

cat <<EOF
<server>
Expand All @@ -115,6 +129,9 @@ gen_server() {
<password>${server_password}</password>
</server>
EOF
fi


elif [[ -f "${PASSWORD_STORE_DIR}/${passphrase_pass}.gpg" ]]; then
>&2 echo -e "${SCRIPT_NAME}\tINFO: Generating server entry '${serverId}'"
local passphrase server_passphrase
Expand Down Expand Up @@ -144,6 +161,34 @@ gen_mirror() {
EOF
}

gen_profile() {
local profileId="${1}"
local config="${2}"
echo " <profile>"
echo " <id>${profileId}</id>"

local repositoryId
for repositoryId in $(jq -r '.repositories | keys | .[]' <<< "${config}"); do
echo " <repositories>"
gen_repository "${repositoryId}" "$(jq -c '.repositories["'"${repositoryId}"'"]' <<< "${config}")";
echo " </repositories>"
done

echo " </profile>"
}

gen_repository() {
local repositoryId="${1}"
local repository="${2}"
cat <<EOF
<repository>
<id>${repositoryId}</id>
<name>$(jq -r '.name' <<< "${repository}")</name>
<url>$(jq -r '.url' <<< "${repository}")</url>
</repository>
EOF
}

gen_servers() {
local settingsFilename="${1}"
local config="${2}"
Expand All @@ -170,6 +215,19 @@ gen_mirrors() {
echo " </mirrors>"
}

gen_profiles() {
local settingsFilename="${1}"
local config="${2}"
echo " <profiles>"

local profileId
for profileId in $(jq -r '.maven.files["'"${settingsFilename}"'"] | .profiles | keys | .[]' "${config}"); do
gen_profile "${profileId}" "$(jq -c '.maven.files["'"${settingsFilename}"'"].profiles["'"${profileId}"'"]' "${config}")";
done

echo " </profiles>"
}

gen_settings() {
local settingsFilename="${1}"
local config="${2}"
Expand All @@ -179,7 +237,7 @@ gen_settings() {
echo " <interactiveMode>$(jq '.maven.interactiveMode' "${config}")</interactiveMode>"
gen_servers "${settingsFilename}" "${config}"
gen_mirrors "${settingsFilename}" "${config}"

gen_profiles "${settingsFilename}" "${config}"
echo "</settings>"
}

Expand Down
33 changes: 24 additions & 9 deletions instances/ee4j.openmq/target/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,27 @@
"settings.xml": {
"color": "always",
"mirrors": {
"central.testing": {
"mirrorOf": "central.testing",
"name": "Sonatype Central Testing Mirror",
"url": "https://central.sonatype.com/api/v1/publisher/deployments/download"
},
"eclipse.maven.central.mirror": {
"mirrorOf": "central",
"name": "Eclipse Central Proxy",
"url": "https://repo.eclipse.org/content/repositories/maven_central/"
}
},
"profiles": {
"central.testing": {
"repositories": {
"central.testing": {
"name": "Central Testing repository",
"url": "https://central.sonatype.com/api/v1/publisher/deployments/download"
}
}
}
},
"servers": {
"central": {
"password": {
Expand All @@ -561,18 +576,18 @@
"pass": "bots/ee4j.openmq/central.sonatype.org/token-username"
}
},
"gpg.passphrase": {
"passphrase": {
"pass": "bots/ee4j.openmq/gpg/passphrase"
}
},
"ossrh": {
"nexusProUrl": "https://jakarta.oss.sonatype.org",
"central.testing": {
"httpHeaders": true,
"password": {
"pass": "bots/ee4j.openmq/oss.sonatype.org/password"
"pass": "bots/ee4j.openmq/central.sonatype.org/token-password"
},
"username": {
"pass": "bots/ee4j.openmq/oss.sonatype.org/username"
"pass": "bots/ee4j.openmq/central.sonatype.org/token-username"
}
},
"gpg.passphrase": {
"passphrase": {
"pass": "bots/ee4j.openmq/gpg/passphrase"
}
},
"repo.eclipse.org": {
Expand Down
113 changes: 57 additions & 56 deletions instances/ee4j.openmq/target/jenkins/plugins.log
Original file line number Diff line number Diff line change
@@ -1,134 +1,135 @@
Resulting plugin list:
analysis-model-api 13.5.0
ant 513.vde9e7b_a_0da_0f
analysis-model-api 13.8.0-902.v26f80296f743
ant 518.v8d8dc7945eca_
antisamy-markup-formatter 173.v680e3a_b_69ff3
apache-httpcomponents-client-4-api 4.5.14-269.vfa_2321039a_83
apache-httpcomponents-client-5-api 5.5-150.veb_76e719855b_
asm-api 9.8-135.vb_2239d08ee90
authentication-tokens 1.131.v7199556c3004
authentication-tokens 1.144.v5ff4a_5ec5c33
authorize-project 2.0.0
bootstrap5-api 5.3.3-2
bouncycastle-api 2.30.1.80-261.v00c0e2618ec3
branch-api 2.1226.ve1e7e0b_4b_95f
bouncycastle-api 2.30.1.81-264.v95c79c0e772c
branch-api 2.1229.ve86b_d02b_5e56
build-timeout 1.38
caffeine-api 3.2.0-166.v72a_6d74b_870f
caffeine-api 3.2.2-178.v353b_8428ed56
checks-api 370.vb_61a_c57328f3
cloudbees-disk-usage-simple 241.v0ea_d9a_a_96ee8
cloudbees-folder 6.1026.ve06dfa_cf31c3
command-launcher 123.v37cfdc92ef67
commons-lang3-api 3.17.0-87.v5cf526e63b_8b_
commons-text-api 1.13.1-176.v74d88f22034b_
commons-lang3-api 3.18.0-98.v3a_674c06072d
commons-text-api 1.14.0-194.v804a_dc3a_1b_d8
config-file-provider 988.v0461fcc2b_9d1
configuration-as-code 1963.v24e046127a_3f
credentials 1415.v831096eb_5534
credentials-binding 687.v619cb_15e923f
data-tables-api 2.2.2-1
coverage 2.2912.v3dea_6a_4a_73f7
credentials 1419.v2337d1ceceef
credentials-binding 702.vfe613e537e88
data-tables-api 2.3.3-1383.va_5607a_a_3f3c2
disk-usage 1.3
display-url-api 2.209.v582ed814ff2f
durable-task 587.v84b_877235b_45
echarts-api 5.6.0-4
display-url-api 2.217.va_6b_de84cc74b_
durable-task 595.ve87b_f1318d67
echarts-api 6.0.0-1146.v5c8f3b_8f0573
eddsa-api 0.3.0.1-19.vc432d923e5ee
email-ext 1911.v19b_8e86f9815
email-ext 1925.v1598902b_58dd
extended-read-permission 61.vf24570ff3b_e9
external-monitor-job 223.vb_fddcf42c9b_3
extra-columns 1.27
font-awesome-api 6.7.2-1
forensics-api 3.1.0
font-awesome-api 7.0.0-851.vd1feb_218a_a_63
forensics-api 3.1754.v2a_6613b_77002
ghprb 1.42.2
git 5.7.0
git-client 6.2.0
git-parameter 439.vb_0e46ca_14534
git-parameter 444.vca_b_84d3703c2
github 1.43.0
github-api 1.321-488.v9b_c0da_9533f8
github-branch-source 1824.v046257273408
github-scm-trait-notification-context 45.v8ef831829589
gitlab-api 5.6.0-100.v83f8f4b_f1129
gitlab-branch-source 718.v40b_5f0e67cd3
gitlab-branch-source 723.v090f23d3cc49
gitlab-plugin 1.9.8
gson-api 2.13.1-139.v4569c2ef303f
handy-uri-templates-2-api 2.1.8-36.v85e4cb_234a_13
hashicorp-vault-plugin 371.v884a_4dd60fb_6
instance-identity 203.v15e81a_1b_7a_38
ionicons-api 88.va_4187cb_eddf1
jackson2-api 2.19.0-404.vb_b_0fd2fea_e10
jackson2-api 2.19.2-408.v18248a_324cfe
jacoco 3.3.7
jakarta-activation-api 2.1.3-2
jakarta-mail-api 2.1.3-2
jakarta-mail-api 2.1.3-3
javadoc 327.vdfe586651ee0
javax-activation-api 1.2.0-8
jaxb 2.3.9-133.vb_ec76a_73f706
jdk-tool 83.v417146707a_3d
jersey2-api 2.47-165.ve7809a_3e87e0
jjwt-api 0.11.5-120.v0268cf544b_89
jobConfigHistory 1330.vcb_8320ea_cdb_e
jobConfigHistory 1352.va_201a_8389340
joda-time-api 2.14.0-127.v7d9da_295a_d51
jquery3-api 3.7.1-3
jquery3-api 3.7.1-594.vb_3864f326cf0
jsch 0.2.16-95.v3eecb_55fa_b_78
json-api 20250517-153.vc8a_a_d87c0ce3
json-api 20250517-173.v596efb_962a_31
json-path-api 2.9.0-148.v22a_7ffe323ce
jsoup 1.21.1-52.v96e4041b_60fd
junit 1335.v6b_a_a_e18534e1
kubernetes 4356.vfa_556c21f086
kubernetes-client-api 6.14.0-255.v44e4b_386fb_a_e
kubernetes-credentials 195.v0c273a_cfb_4f4
kubernetes 4358.vcfd9c5a_0a_f51
kubernetes-client-api 7.3.1-256.v788a_0b_787114
kubernetes-credentials 203.v85b_9836a_f44b_
ldap 780.vcb_33c9a_e4332
mailer 489.vd4b_25144138f
matrix-auth 3.2.6
matrix-auth 3.2.8
matrix-project 849.v0cd64ed7e531
maven-plugin 3.26
maven-plugin 3.27
metrics 4.2.32-476.v5042e1c1edd7
mina-sshd-api-common 2.15.0-161.vb_200831a_c15b_
mina-sshd-api-core 2.15.0-161.vb_200831a_c15b_
mina-sshd-api-common 2.16.0-167.va_269f38cc024
mina-sshd-api-core 2.16.0-167.va_269f38cc024
okhttp-api 4.11.0-189.v976fa_d3379d6
oss-symbols-api 356.v2da_d59a_3742b_
oss-symbols-api 388.v1e168e8f0d76
pam-auth 1.12
parameterized-trigger 859.vb_e3907a_07a_16
parameterized-trigger 873.v8b_e37dd8418f
pipeline-build-step 571.v08a_fffd4b_0ce
pipeline-graph-analysis 241.vc3d48fb_b_2582
pipeline-graph-view 584.v32e797f976a_2
pipeline-graph-view 628.va_6f6a_1d12848
pipeline-groovy-lib 752.vdddedf804e72
pipeline-input-step 527.vd61b_1d3c5078
pipeline-maven 1541.vc01544b_d27e8
pipeline-maven-api 1541.vc01544b_d27e8
pipeline-input-step 534.v352f0a_e98918
pipeline-maven 1554.v292f3d3479e6
pipeline-maven-api 1554.v292f3d3479e6
pipeline-milestone-step 138.v78ca_76831a_43
pipeline-model-api 2.2255.v56a_15e805f12
pipeline-model-definition 2.2255.v56a_15e805f12
pipeline-model-extensions 2.2255.v56a_15e805f12
pipeline-model-api 2.2265.v140e610fe9d5
pipeline-model-definition 2.2265.v140e610fe9d5
pipeline-model-extensions 2.2265.v140e610fe9d5
pipeline-rest-api 2.38
pipeline-stage-step 322.vecffa_99f371c
pipeline-stage-tags-metadata 2.2255.v56a_15e805f12
pipeline-stage-tags-metadata 2.2265.v140e610fe9d5
pipeline-stage-view 2.38
plain-credentials 199.v9f8e1f741799
plugin-util-api 6.1.0
prism-api 1.30.0-1
plugin-util-api 6.1167.v022176c7e0ca_
prism-api 1.30.0-609.vf0a_df102d9a_f
prometheus 819.v50953a_c560dd
promoted-builds 992.va_00888f21b_74
rebuild 338.va_0a_b_50e29397
resource-disposer 0.25
scm-api 704.v3ce5c542825a_
script-security 1373.vb_b_4a_a_c26fa_00
scm-api 707.v749f968369d4
script-security 1378.vf25626395f49
simple-theme-plugin 211.v5424a_5510e47
snakeyaml-api 2.3-125.v4d77857a_b_402
sonar 2.18
ssh-agent 386.v36cc0c7582f0
ssh-credentials 359.v2191c4cf635f
ssh-slaves 3.1031.v72c6b_883b_869
structs 350.v3b_30f09f2363
timestamper 1.29
ssh-credentials 361.vb_f6760818e8c
ssh-slaves 3.1071.v0d059c7b_c555
structs 353.v261ea_40a_80fb_
timestamper 1.30
token-macro 444.v52de7e9c573d
trilead-api 2.209.v0e69b_c43c245
variant 70.va_d9f17f859e0
warnings-ng 12.7.0
warnings-ng 12.9783.ve1cb_9f060738
workflow-aggregator 608.v67378e9d3db_1
workflow-api 1373.v7b_813f10efa_b_
workflow-basic-steps 1079.vce64b_a_929c5a_
workflow-cps 4150.ve20ca_b_a_a_2815
workflow-durable-task-step 1431.v16e66c8a_58b_f
workflow-cps 4183.v94b_6fd39da_c1
workflow-durable-task-step 1452.v0ee719c104a_7
workflow-job 1540.v295eccc9778f
workflow-multibranch 806.vb_b_688f609ee9
workflow-multibranch 811.vcd33d074c2a_0
workflow-scm-step 437.v05a_f66b_e5ef8
workflow-step-api 700.v6e45cb_a_5a_a_21
workflow-support 968.v8f17397e87b_8
ws-cleanup 0.48
workflow-step-api 706.v518c5dcb_24c0
workflow-support 976.vb_d9493c2eb_09
ws-cleanup 0.49
xvnc 1.28

Loading