Classroom related content

Task 1 reference example

https://github.com/s1mark/mzl7y1

Links

gcloud

login to gcp

  • gcloud auth login
  • gcloud auth application-default login

terraform

Change the directory to your workspace

initialize your code workspace

  • terraform init

plan your infrastructure

  • terraform plan

apply your changes

  • terraform apply

destroy your infrastructure

  • terraform destroy

git

clone the repository

Change your working directory where you want to download the repository and then issue the following command

  • $ git clone https://github.com/s1mark/cloud_hun.git

create a new branch

Create a new branch originated from the main branch. Refresh main prior

  • $(main) git pull
  • $(main) git checkout -b my-branch main

add your changes

After working on your branch add a specific file/path or add every change

  • $(my-branch) git add folder/file_you_have_changed
  • $(my-branch) git add -A

commit your changes

  • $(my-branch) git commit -m "your_custom_message"

push your local branch

In our example we created a local branch name 'my-branch'

  • $(my-branch) git push -u origin my-branch

pull main branch

Before starting your work it is advised to pull down the changes that have been made to the main branch

  • $(my-branch) git checkout main
  • $(main) git pull

switch back to your branch

  • $(main) git checkout my-branch

merge main changes

Since you have pulled down changes that were made on the main branch. It is advised to merge it to your branch.

  • $(my-branch) git merge main