diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..03d43e53 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM tomcat:8.0.20-jre8 +COPY /target/SampleCode-* /usr/local/tomcat/webapps/demo.war diff --git a/README.md b/README.md index 91b398f6..944b16da 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ You can also run each sample directly from the command line. ``` > java -jar target/SampleCode.jar [CodeSampleName] ``` -e.g. +e.g.. ``` > java -jar target/SampleCode.jar ChargeCreditCard ``` diff --git a/cloudbuild.yml b/cloudbuild.yml new file mode 100644 index 00000000..fefe0ea7 --- /dev/null +++ b/cloudbuild.yml @@ -0,0 +1,21 @@ +steps: +# Step to check out the source code from the repository +- name: 'gcr.io/cloud-builders/git' + args: ['clone', '--single-branch', '--branch', '${_BRANCH}', '--', 'https://github.com/your/repository.git', '.'] + env: + - '_BRANCH=${BRANCH_NAME}' + +# Step to build the Maven project +- name: 'maven:3.6.3-jdk-11-slim' + entrypoint: 'mvn' + args: ['clean', 'install'] + +# Optional: define substitutions for triggering builds on different branches/tags +substitutions: + _BRANCH: "master" + + options: + logging: CLOUD_LOGGING_ONLY + + + diff --git a/pom.xml b/pom.xml index a2f941a7..35b3142e 100644 --- a/pom.xml +++ b/pom.xml @@ -57,11 +57,9 @@ org.apache.maven.plugins maven-surefire-plugin - 2.9 + 2.19.1 - - **/*.java - + true