Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .kokoro/release.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ before_action {
keystore_config_id: 75669
keyname: "functions-framework-java-release-bot-sonatype-password"
}
keystore_resource {
keystore_config_id: 75669
keyname: "functions-framework-release-sonatype-central-portal-username"
}
keystore_resource {
keystore_config_id: 75669
keyname: "functions-framework-release-sonatype-central-portal-password"
}
keystore_resource {
keystore_config_id: 70247
keyname: "maven-gpg-pubkeyring"
Expand Down
27 changes: 2 additions & 25 deletions .kokoro/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,6 @@ setup_environment_secrets() {
mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GNUPGHOME/pubring.gpg
mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GNUPGHOME/secring.gpg
gpg -k

echo "KOKORO_GFILE_DIR: ${KOKORO_GFILE_DIR}"
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
echo "Creating folder for secrets: ${SECRET_LOCATION} (if not exists)"
mkdir -p "${SECRET_LOCATION}"
echo "Content of ${SECRET_LOCATION}:"
ls -alt "${SECRET_LOCATION}"
echo "------"

export SECRET_MANAGER_PROJECT_ID="serverless-runtimes"
export CENTRAL_REPO_USER="sonatype-central-repo-user"
export CENTRAL_REPO_TOKEN="sonatype-central-repo-token"
SECRET_MANAGER_KEYS="${CENTRAL_REPO_USER} ${CENTRAL_REPO_TOKEN}"
echo "SECRET_MANAGER_PROJECT_ID: ${SECRET_MANAGER_PROJECT_ID}, SECRET_MANAGER_KEYS: ${SECRET_MANAGER_KEYS}"

for key in $(echo "${SECRET_MANAGER_KEYS}" | sed "s/,/ /g")
do
gcloud secrets versions access latest \
--project "${SECRET_MANAGER_PROJECT_ID}" \
--secret "${key}" \
--out-file "${SECRET_LOCATION}/${key}"
echo "Created ${SECRET_LOCATION}/${key}"
done
}

create_settings_xml_file() {
Expand All @@ -64,8 +41,8 @@ create_settings_xml_file() {
<servers>
<server>
<id>sonatype-central-portal</id>
<username>$(cat "${SECRET_LOCATION}/${CENTRAL_REPO_USER}")</username>
<password>$(cat "${SECRET_LOCATION}/${CENTRAL_REPO_TOKEN}")</password>
<username>$(cat "${KOKORO_KEYSTORE_DIR}/75699_functions-framework-release-sonatype-central-portal-username")</username>
<password>$(cat "${KOKORO_KEYSTORE_DIR}/75699_functions-framework-release-sonatype-central-portal-password")</password>
</server>
</server>
</servers>
Expand Down
Loading