How to push artifact from Cloud Builder to Cloud Storage?

6/11/2018

I have an app with frontend part of it written in React. This app builds the artifact (which is specifically a bundle.js file) in the manner of multistage image build:

from node:8 as builder
# build the bundle.js file
...
from nginx
# serve the bundle.js file
...

Such that i have very small image with bundle.js file only inside.

In order to serve the bundle.js file i want to push this artifact to the Google Cloud Storage bucket and enable CDN on it. What is the best practice to do this?

The backend of the application will use Skaffold, Container Builder and Kubernetes Engine. So it would be nice to use Container Builder for the frontend as well if possible.

-- Zhorzh Alexandr
cdn
docker
google-cloud-platform
google-kubernetes-engine

1 Answer

7/5/2018

I'll list your questions below and provide documentation links that will help answer, to keep this reply concise.

1- How to push artifact from Cloud Builder to Cloud Storage? I would recommend visiting our documentation about building, Testing, and Deploying Artifacts. This will help you understand how to push your artifacts to a bucket in Google Cloud Storage and give you some examples.

2- How to enable CDN on the bucket? in order to serve the artifacts that you pushed to the bucket. Using Cloud CDN documentation will be a perfect guide to help show you all the needed steps.

3- Using Container Builder for the frontend? According to my research, we don't have this option yet. I would recommend that you request this as a Features using Issue Trackers.This will ensure that our engineers study this option, to help improve our product.

-- Taame Amine
Source: StackOverflow