In this lab, you built a continuous integration pipeline using the Google Cloud tools Cloud Source Repositories, Cloud Build, build triggers, and Container Registry.
In this project, you will build a continuous integration pipeline using Cloud Source Repositories, Cloud Build, build triggers, and Container Registry.
Prerequisites
Google Cloud tools Cloud Source Repositories.
Cloud Build.
Build triggers.
Container Registry.
And, a bit of familiarity with GCP.
Objectives - In this lab, you will learn how to perform the following tasks:
Create a Git repository
Create a simple Python application
Test Your web application in Cloud Shell
Define a Docker build
Manage Docker images with Cloud Build and Container Registry
Automate builds with triggers
Test your build changes
You have done a great job! Pat ya back!
Task 1 : Create a Repository
After creating this repo -> got Cloud Console -> Activate Cloud shell
mkdir gcp-course #creating the folder
ls
cd gcp-course
gcloud repos clone DevOps-repo #cloning the repo in our folder
Task 2: Create a Simple python application
open the editor on gcp -> click on new window -> select the folder or file of you repo
main.py
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/")
def main():
model = {"title": "Hello! Welcome to the GCP DevOps Project!!"}
return render_template('index.html', model=model)
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8080, debug=True, threaded=True)
Save this file cntrl+S
Create a new folder in the gcp-course/DevOps-repo folder "templetes"
Afte that -
Create a new file "layout.html" inside the templetes folder