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
45 changes: 31 additions & 14 deletions .kokoro/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
# Stop execution when any command fails.
set -e

# update the Maven version to 3.6.3
# update the Maven version to 3.9.11
pushd /usr/local
wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.tar.gz
tar -xvzf apache-maven-3.6.3-bin.tar.gz apache-maven-3.6.3
wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.tar.gz
tar -xvzf apache-maven-3.9.11-bin.tar.gz apache-maven-3.9.11
rm -f /usr/local/apache-maven
ln -s /usr/local/apache-maven-3.6.3 /usr/local/apache-maven
rm apache-maven-3.6.3-bin.tar.gz
ln -s /usr/local/apache-maven-3.9.11 /usr/local/apache-maven
rm apache-maven-3.9.11-bin.tar.gz
popd


# Get secrets from keystore and set and environment variables.
setup_environment_secrets() {
export GPG_TTY=$(tty)
export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f1 -d':')
export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f2 -d':')
export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase)

# Add the key ring files to $GNUPGHOME to verify the GPG credentials.
Expand All @@ -26,6 +24,29 @@ 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 @@ -42,14 +63,10 @@ create_settings_xml_file() {
</profiles>
<servers>
<server>
<id>sonatype-nexus-staging</id>
<username>${SONATYPE_USERNAME}</username>
<password>${SONATYPE_PASSWORD}</password>
<id>sonatype-central-portal</id>
<username>$(cat "${SECRET_LOCATION}/${CENTRAL_REPO_USER}")</username>
<password>$(cat "${SECRET_LOCATION}/${CENTRAL_REPO_TOKEN}")</password>
</server>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${SONATYPE_USERNAME}</username>
<password>${SONATYPE_PASSWORD}</password>
</server>
</servers>
</settings>" > $1
Expand Down
25 changes: 19 additions & 6 deletions function-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
<tag>HEAD</tag>
</scm>

<developers>
<developer>
<name>Andras Kerekes</name>
<email>akerekes@google.com</email>
<organization>Google LLC</organization>
<organizationUrl>http://www.google.com</organizationUrl>
</developer>
<developer>
<name>Di Xu</name>
<email>dixuswe@google.com</email>
<organization>Google LLC</organization>
<organizationUrl>http://www.google.com</organizationUrl>
</developer>
</developers>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
Expand Down Expand Up @@ -159,14 +174,12 @@
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.7.0</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.9.0</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-snapshots</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<publishingServerId>sonatype-central-portal</publishingServerId>
</configuration>
</plugin>
</plugins>
Expand Down
Loading