Hi I am new to Google Cloud Platform. I want to build an Java application which should be built using Google Cloud Build without docker containers. And also the built application to be tested and artifact to be saved in bucket. Can anyone help me on this ?
-
Hi, can you post your code of how you would do all this on your own computer? From their we can help you do it with google cloud build. – ThdK Dec 15 '22 at 10:50
2 Answers
Cloud Build is conceptually a pipeline mechanism that takes some set of files as input (commonly in some source repo) and applies a number of processing steps to the files including steps that produce output: file(s) | step-1 | step-2 | ... | step-n
.
Most of the examples show Cloud Build producing Docker images but this underplays all the many things it can do.
Importantly, each of the processors (steps) must be a Docker containers but the input and output need not be docker images.
You can use javac
or mvn
or gradle
steps to compile your code and then use the gsutil
step to copy the war
or jar
to Google Cloud Storage.
https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/javac https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/mvn https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gradle https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gsutil

- 32,823
- 5
- 47
- 88
-
I saw the links shared. But can you share me a clouldbuild.yml file for java project without docker file. Presently we have Jenkins for build which uses ant I want to replicate the same thing in cloudbuild. I am confused, pls help – Vallabh Aug 18 '18 at 01:44
-
Check this out: https://cloud.google.com/cloud-build/docs/configuring-builds/store-images-artifacts#uploading_files_and_folders – DazWilkin Aug 20 '18 at 21:38
Since you mentioned that you without docker container, I assume you want to deploy your application not in docker image. You can deploy your app into Google App Engine Standard. So in how to deploy into App Engine, you can refer to this documentation: https://cloud.google.com/build/docs/deploying-builds/deploy-appengine
To run the application on App Engine, you create app.yaml on your project Then you put these lines inside app.yaml
runtime: java11
entrypoint: java -Xmx64m -jar {your application artifact in jar file}```

- 3
- 3