Skip to content

Commit

Permalink
regenerate common templates
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 committed Mar 30, 2020
1 parent 9f6eb94 commit 1bf7fb0
Show file tree
Hide file tree
Showing 35 changed files with 150 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Thanks for stopping by to let us know something could be better!

Please run down the following list and make sure you've tried the usual "quick fixes":

- Search the issues already opened: https://github.com/googleapis//issues
- Search the issues already opened: https://github.com/googleapis/java-shared-dependencies/issues
- Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform

If you are still having issues, please include as much information as possible:
Expand Down
8 changes: 7 additions & 1 deletion java-shared-dependencies/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
Fixes #<issue_number_goes_here> (it's a good idea to open an issue first for context and/or discussion)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/java-shared-dependencies/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️
2 changes: 2 additions & 0 deletions java-shared-dependencies/.github/trusted-contribution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trustedContributors:
- renovate-bot
15 changes: 15 additions & 0 deletions java-shared-dependencies/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Maven
target/

# Eclipse
.classpath
.project
.settings

# Intellij
*.iml
.idea/

# python utilities
*.pyc
__pycache__
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/build.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
:: See documentation in type-shell-output.bat

"C:\Program Files\Git\bin\bash.exe" github//.kokoro/build.sh
"C:\Program Files\Git\bin\bash.exe" github/java-shared-dependencies/.kokoro/build.sh
19 changes: 12 additions & 7 deletions java-shared-dependencies/.kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@ scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# include common functions
source ${scriptDir}/common.sh

# Print out Java version
java -version
echo ${JOB_TYPE}

mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C

# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it
if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then
Expand Down
4 changes: 2 additions & 2 deletions java-shared-dependencies/.kokoro/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# All builds use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "java-shared-dependencies/.kokoro/trampoline.sh"

# Tell the trampoline which build file to use.
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/build.sh"
value: "github/java-shared-dependencies/.kokoro/build.sh"
}
44 changes: 44 additions & 0 deletions java-shared-dependencies/.kokoro/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# set -eo pipefail

function retry_with_backoff {
attempts_left=$1
sleep_seconds=$2
shift 2
command=$@

echo "${command}"
${command}
exit_code=$?

if [[ $exit_code == 0 ]]
then
return 0
fi

# failure
if [[ ${attempts_left} > 0 ]]
then
echo "failure (${exit_code}), sleeping ${sleep_seconds}..."
sleep ${sleep_seconds}
new_attempts=$((${attempts_left} - 1))
new_sleep=$((${sleep_seconds} * 2))
retry_with_backoff ${new_attempts} ${new_sleep} ${command}
fi

return $exit_code
}
4 changes: 2 additions & 2 deletions java-shared-dependencies/.kokoro/continuous/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "java-shared-dependencies/.kokoro/trampoline.sh"

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/build.sh"
value: "github/java-shared-dependencies/.kokoro/build.sh"
}

env_vars: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ env_vars: {

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/dependencies.sh"
value: "github/java-shared-dependencies/.kokoro/dependencies.sh"
}
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/continuous/java8-osx.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Format: //devtools/kokoro/config/proto/build.proto

build_file: "/.kokoro/build.sh"
build_file: "java-shared-dependencies/.kokoro/build.sh"
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/continuous/java8-win.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Format: //devtools/kokoro/config/proto/build.proto

build_file: "/.kokoro/build.bat"
build_file: "java-shared-dependencies/.kokoro/build.bat"
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "java-shared-dependencies/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -21,7 +21,7 @@ env_vars: {

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/continuous/propose_release.sh"
value: "github/java-shared-dependencies/.kokoro/continuous/propose_release.sh"
}

# tokens used by release-please to keep an up-to-date release PR.
Expand Down
15 changes: 11 additions & 4 deletions java-shared-dependencies/.kokoro/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@

set -eo pipefail

cd github//
## Get the directory of the build script
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# include common functions
source ${scriptDir}/common.sh

# Print out Java
java -version
Expand All @@ -24,8 +30,9 @@ echo $JOB_TYPE
export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"

# this should run maven enforcer
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true

mvn -B dependency:analyze -DfailOnWarning=true
22 changes: 15 additions & 7 deletions java-shared-dependencies/.kokoro/linkage-monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,26 @@ set -eo pipefail
# Display commands being run.
set -x

cd github//
## Get the directory of the build script
scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}"))
## cd to the parent directory, i.e. the root of the git repo
cd ${scriptDir}/..

# include common functions
source ${scriptDir}/common.sh

# Print out Java version
java -version
echo ${JOB_TYPE}

mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true
# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true

# Kokoro job cloud-opensource-java/ubuntu/linkage-monitor-gcs creates this JAR
JAR=linkage-monitor-latest-all-deps.jar
Expand Down
4 changes: 2 additions & 2 deletions java-shared-dependencies/.kokoro/nightly/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "java-shared-dependencies/.kokoro/trampoline.sh"

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/build.sh"
value: "github/java-shared-dependencies/.kokoro/build.sh"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/nightly/dependencies.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ env_vars: {

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/dependencies.sh"
value: "github/java-shared-dependencies/.kokoro/dependencies.sh"
}
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/nightly/java8-osx.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Format: //devtools/kokoro/config/proto/build.proto

build_file: "/.kokoro/build.sh"
build_file: "java-shared-dependencies/.kokoro/build.sh"
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/nightly/java8-win.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Format: //devtools/kokoro/config/proto/build.proto

build_file: "/.kokoro/build.bat"
build_file: "java-shared-dependencies/.kokoro/build.bat"
4 changes: 2 additions & 2 deletions java-shared-dependencies/.kokoro/presubmit/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "java-shared-dependencies/.kokoro/trampoline.sh"

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/build.sh"
value: "github/java-shared-dependencies/.kokoro/build.sh"
}

env_vars: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ env_vars: {

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/dependencies.sh"
value: "github/java-shared-dependencies/.kokoro/dependencies.sh"
}
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/presubmit/java8-osx.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Format: //devtools/kokoro/config/proto/build.proto

build_file: "/.kokoro/build.sh"
build_file: "java-shared-dependencies/.kokoro/build.sh"
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/presubmit/java8-win.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Format: //devtools/kokoro/config/proto/build.proto

build_file: "/.kokoro/build.bat"
build_file: "java-shared-dependencies/.kokoro/build.bat"
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ env_vars: {

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/linkage-monitor.sh"
value: "github/java-shared-dependencies/.kokoro/linkage-monitor.sh"
}
4 changes: 2 additions & 2 deletions java-shared-dependencies/.kokoro/release/bump_snapshot.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "java-shared-dependencies/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand All @@ -21,7 +21,7 @@ env_vars: {

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/release/bump_snapshot.sh"
value: "github/java-shared-dependencies/.kokoro/release/bump_snapshot.sh"
}

# tokens used by release-please to keep an up-to-date release PR.
Expand Down
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/release/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "/.kokoro/trampoline.sh"
build_file: "java-shared-dependencies/.kokoro/trampoline.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/release/drop.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/release/drop.sh"
value: "github/java-shared-dependencies/.kokoro/release/drop.sh"
}
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/release/promote.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/release/promote.sh"
value: "github/java-shared-dependencies/.kokoro/release/promote.sh"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env_vars: {

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/release/publish_javadoc.sh"
value: "github/java-shared-dependencies/.kokoro/release/publish_javadoc.sh"
}

before_action {
Expand Down
2 changes: 1 addition & 1 deletion java-shared-dependencies/.kokoro/release/snapshot.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/release/snapshot.sh"
value: "github/java-shared-dependencies/.kokoro/release/snapshot.sh"
}
6 changes: 3 additions & 3 deletions java-shared-dependencies/.kokoro/release/stage.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github//.kokoro/release/stage.sh"
value: "github/java-shared-dependencies/.kokoro/release/stage.sh"
}

# Need to save the properties file
action {
define_artifacts {
regex: "github//target/nexus-staging/staging/*.properties"
strip_prefix: "github/"
regex: "github/java-shared-dependencies/target/nexus-staging/staging/*.properties"
strip_prefix: "github/java-shared-dependencies"
}
}

Expand Down
1 change: 1 addition & 0 deletions java-shared-dependencies/.repo-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"release_level": "beta",
"language": "java",
"repo": "googleapis/java-shared-dependencies",
"repo_short": "java-shared-dependencies",
"distribution_name": "com.google.cloud:google-cloud-shared-dependencies"
}
Loading

0 comments on commit 1bf7fb0

Please sign in to comment.