Happy Saturday everyone! I hope you are doing well as you're reading this post. I'm doing pretty decent. Just yesterday my team and I presented our thesis app for our coding bootcamp! It's an amazing little social media app for plant enthusiasts. It's very crazy that I will soon be done with the class environment and move into the work force. And what a great economy to start working in! All joked aside I'm excited to show the world what I can do in the world of software development.
With one week left to build our app, we had yet to deploy it! We made a mobile app, and we weren't going to add it to the app store or anything, so all we could do was deploy the back end, but we still needed to do that. Somehow I was entrusted with the amazing task of deploying our lovely app. There was just one problem: I didn't have a lot of experience with deploying! I had deployed on Heroku and Digital Ocean before, but that was about it. I knew I had a big task ahead of me, but it was a challenge I was excited to take on.
I knew that I wanted to deploy our app on Google Cloud, but I didn't know much about it, so I had to do my research. So I will share with you what I learned about Google Cloud, which will hopefully help us both have a better understanding of it, and then I'll go through how we can deploy a very basic app.
Google Cloud was founded in 2008 by Google, and runs on the same infrastructure that Google uses for their own products (Youtube, Gmail, etc). It was made with a focus on cloud computing services, and they have over 90 products under the Google Cloud Platform brand. Which to me is crazy! Once I learned that I understood why their documentation can be so frustrating to read.
One of those amazing brands is the Google App Engine, or simply App Engine. App Engine is a platform that allows you to develop and host websites on Google's data centers. And deploying a website with the App Engine actually isn't that bad. So let's walk through deploying a very basic, Hello World, app.
The first thing that we're going to do is go to our GCP console and create a new project.
As you can see I currently have three projects, but we're gonna work in My Project 92601.
So after we have a project we can click on the cloud terminal and clone our repo into our project. This would be the same way you always clone your repo!
Now we can shell into our repo and test our app. This would be the same command you would normally use to run your app (npm run server, npm run start), but for this app it's 'go run .'.
If everything is working for your app (mine seems to be working great) you can create your app! You do this with the following gcloud command.
gcloud app create
Now you're ready to deploy your app! Just run this in the terminal!
gcloud app deploy
If you have any errors in your terminal, don't be afraid to look up your errors! But if everything went according to plan, you should get a URL for your sight. Let's check mine out.
Perfect!
Of course this was a very simple app. I haven't gone over environmental variables or app.yaml files, But maybe I will in a future blog post. I hope that this was helpful!
Top comments (0)