Search code examples
node.jsgitgoogle-cloud-platformgpc

node js app engine github trigger builds not getting published to development?


I have a node.js website that runs locally fine with node server.js. I added a Dockerfile:

FROM node:carbon    
VOLUME ["/root"]    
# Create app directory  
WORKDIR /usr/src/app    
# Install app dependencies  
# A wildcard is used to ensure both package.json AND package-lock.json are copied   
# where available (npm@5+)  
COPY package*.json ./   
RUN npm install 
# If you are building your code for production  
# RUN npm install --only=production 
# Bundle app source 
COPY . .    
EXPOSE 8080 
CMD [ "npm", "start" ]

And if I deploy my app with gcloud app deploy I can get it accessible online via a url. I believe my project is an 'App Engine' project? If I run subsequent gcloud app deploy commands, my new code gets pushed to the online site. But I can't get github master commits trigger and publish a new build.

I tried adding a trigger so that everytime new code gets added to my public github repo master branch, it gets sent to my production URL. enter image description here

Full Trigger: enter image description here

So I merge a PR into the master branch of my github repo. I look in my build history and see there is a new build, clicking the commit takes me to the new pr I just merged into the master branch of my github repo.

enter image description here

But If I access my website url, the new code is not there. If I run cloud app deploy again eventually it will appear, my trigger seems to be working fine from the logs, why is my build not getting published?

enter image description here


Solution

  • I think the problem might be with the fact that you're using a Dockerfile instead of Cloud Build configuration file... Unless there's something else I'm not seeing.

    Look here under the fourth step, fifth bullet, for the solution. It says:

    Under Build configuration, select Cloud Build configuration file.