Terraform GIT notes

 


gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (todelete2DBs_1)

$ git checkout master

Switched to branch 'master'

Your branch is up to date with 'origin/master'.


gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (master)        <-- TO SYNC MASTER WITH YOUR LOCAL COPY

$ git pull

remote: Enumerating objects: 12, done.

remote: Counting objects: 100% (12/12), done.

remote: Compressing objects: 100% (9/9), done.

remote: Total 12 (delta 4), reused 9 (delta 3), pack-reused 0

Unpacking objects: 100% (12/12), 3.97 KiB | 71.00 KiB/s, done.

From https://github.com/MensWearhouse/gcp

   b5df3d22..6b119f90  master      -> origin/master

 * [new branch]        DEVOPS-1298 -> origin/DEVOPS-1298

Updating b5df3d22..6b119f90

Fast-forward

 CODEOWNERS                                      |  2 +-

 folders/nonprod/np-storeapps-1/variables.tfvars | 38 ++-----------------------

 2 files changed, 3 insertions(+), 37 deletions(-)


gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (master)



gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (master)                  SWITCH TO YOUR LOCAL BRANCH

$ git checkout -b BuildTestTBI_DB

Switched to a new branch 'BuildTestTBI_DB'




PUT A BLANK COMMIT 



gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (BuildTestTBI_DB)    I do this just to get the folder and file name BUT DO NOT DO THIS. Rakesh said to be sure of which file you are updating 


git status

git diff


$ git commit -m "dummy commit before building test tbi DB"

On branch BuildTestTBI_DB

Changes not staged for commit:

  (use "git add <file>..." to update what will be committed)

  (use "git restore <file>..." to discard changes in working directory)

        modified:   folders/nonprod/np-storeapps-1/variables.tfvars             <-- HERE IS THE FOLDER AND FILE NAME


no changes added to commit (use "git add" and/or "git commit -a")


gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (BuildTestTBI_DB)       TO STAGE THE CHANGES BLANK LINE THIS TIME

$ git add folders/nonprod/np-storeapps-1/variables.tfvars




gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (BuildTestTBI_DB)       SO NOW COMMIT TO THIS FILE

$ git commit -m "dummy commit before building test tbi DB"

[BuildTestTBI_DB 3597f828] dummy commit before building test tbi DB

 1 file changed, 1 insertion(+)




gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (BuildTestTBI_DB)     YOU SHOULD BE ABLE TO SEE ONE COMMIT IN JENKINS 

$ git push origin BuildTestTBI_DB

Enumerating objects: 11, done.

Counting objects: 100% (11/11), done.

Delta compression using up to 8 threads

Compressing objects: 100% (6/6), done.

Writing objects: 100% (6/6), 542 bytes | 542.00 KiB/s, done.

Total 6 (delta 4), reused 0 (delta 0), pack-reused 0

remote: Resolving deltas: 100% (4/4), completed with 4 local objects.

remote: 

remote: Create a pull request for 'BuildTestTBI_DB' on GitHub by visiting:

remote:      https://github.com/MensWearhouse/gcp/pull/new/BuildTestTBI_DB

remote:

To https://github.com/MensWearhouse/gcp

 * [new branch]        BuildTestTBI_DB -> BuildTestTBI_DB




MAKE YOUR REAL CHANGES NOW 



gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (BuildTestTBI_DB)    STAGE IN YOUR BRANCH

$ git add folders/nonprod/np-storeapps-1/variables.tfvars




gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (BuildTestTBI_DB)    COMMIT TO YOUR LOCAL BRANCH

$ git commit -m "Build test MySQL TBI DB in np-storeapps-1"

[BuildTestTBI_DB 7672bbba] Build test MySQL TBI DB in np-storeapps-1

 1 file changed, 22 insertions(+), 1 deletion(-)




gm15@1099ISP201118D MINGW64 /c/Users/gm15/source/repos/gcp (BuildTestTBI_DB)   PUSH TO GITHUB AND JENKINS 

$ git push origin BuildTestTBI_DB

Enumerating objects: 11, done.

Counting objects: 100% (11/11), done.

Delta compression using up to 8 threads

Compressing objects: 100% (6/6), done.

Writing objects: 100% (6/6), 879 bytes | 879.00 KiB/s, done.

Total 6 (delta 4), reused 0 (delta 0), pack-reused 0

remote: Resolving deltas: 100% (4/4), completed with 4 local objects.

To https://github.com/MensWearhouse/gcp

   3597f828..7672bbba  BuildTestTBI_DB -> BuildTestTBI_DB





New process in Terraform:

1) Open PR 2)Get the 2 approvals 3) comment "atlantis apply" and wait for the results 4) merge the PR after apply is successful.

if the code is changed, I will need approvals again.



When the following is seen, then MERGE:

Apply complete! Resources: 0 added, 3 changed, 0 destroyed.

Outputs:

DB_password_MySQL = <sensitive>
DB_password_PostgreSQL = <sensitive>
GKE_account_email = "gke-nonprod-sa@np-ecom-1-08ba.iam.gserviceaccount.com"
Project_service_account = "project-service-account@np-ecom-1-08ba.iam.gserviceaccount.com"
project_id = "np-ecom-1-08ba"
project_number = "363728384911"

'admin:login' logged in successfully
Context 'argocd-server.argocd.svc.cluster.local:443' updated
Cluster gke-ecom-cluster already added to ArgoCD.



Also if seeing:

"Apply Failed: Pull request must be mergeable before running apply."

Then need approvals again


For UPDATE BRANCH, this means:

it's normal, I merged my PR in some other project - in your PR you got a suggestion to merge latest master (inlcuding my merge) in your PR

 now, you could do commands below on your laptop if you want to have updated version of your branch on your laptop

 git branch --set-upstream-to=origin/BuildProdDB_coupons BuildProdDB_coupons

git pull


   


Comments

Popular posts from this blog

Oracle: To clean up WRI$_ADV_OBJECTS