On this page
๐ Appendix - ๋ช ๋ น์ด ๋ชจ์
๊น ๋ช ๋ น์ด ๋ชจ์
# ๋ฆฌํฌ์งํ ๋ฆฌ ์ด๊ธฐํ git init # Git Config ํ์ผ ์์ git config --global --edit git config --global user.name "Your Name" git config --global user.email you@example.com # Stage ์ ํ์ผ ์ถ๊ฐ git add . # ํธ๋ํน์์ ์ ๊ฑฐ (ํ์ผ) git rm --cached <file-name> # ํธ๋ํน์์ ์ ๊ฑฐ (ํด๋) git rm -r --cached <folder-name> # ์ปค๋ฐํ ๋ ํ์ผ์ถ๊ฐํ๊ณ ๋ฉ์์ง๊น์ง ๋จ๊ธฐ๊ธฐ git commit -am <message> # ๋ก์ปฌ ์ปค๋ฐ๋ค์ ์๊ฒฉ ์ ์ฅ์๋ก ์ ๋ก๋ ๋ฐ update, "์๊ฒฉ ์ถ์ ๋ธ๋ ์น update" git push origin main # ๋ก์ปฌ ์ปค๋ฐ๋ค์ ์๊ฒฉ ์ ์ฅ์๋ก ๊ฐ์ ์ ๋ก๋ ๋ฐ update, "์๊ฒฉ ์ถ์ ๋ธ๋ ์น update" git push origin main # ์๊ฒฉ ์ ์ฅ์ main ๋ธ๋ ์น ๋ด์ฉ์ "์๊ฒฉ ์ถ์ ๋ธ๋ ์น fetch", "ํ์ฌ ๋ธ๋ ์น merge", "์์ ๋๋ ํ ๋ฆฌ update" git pull origin main # ์๊ฒฉ ์ ์ฅ์ main ๋ธ๋ ์น ๋ด์ฉ์ "์๊ฒฉ ์ถ์ ๋ธ๋ ์น fetch" git fetch origin main # ์๊ฒฉ์ ์ ์ฅ์ ๋ด์ฉ์ ๋ก์ปฌ๋ก ์ ๋ฐ์ดํธ ํ๊ณ ๊ทธ์์ ๋ก์ปค ์ปค๋ฐ์ ์ถ๊ฐํจ git pull --rebase # ํด๋น ์ปค๋ฐ์ผ๋ก ๋๋์๊ฐ - ์ดํ ์ปค๋ฐ ํ์คํ ๋ฆฌ ๋ณด๊ด git revert <commit hash ID> # ํด๋น ์ปค๋ฐ๋ฐ๋ก ์ด์ (^)์ผ๋ก ๋์๊ฐ - ์ดํ ์ปค๋ฐ ํ์คํ ๋ฆฌ๋ ์ญ์ ๋จ git reset --hard <commit hash ID>^ # ์ปค๋ฐ ํ์คํ ๋ฆฌ ๋ณด๊ธฐ git log # ์คํ ์ด์ง ์์ญ ์ ์ฒด ์ญ์ git reset HEAD . # ์คํ ์ด์ง ์์ญ ํน์ ํ์ผ ์ญ์ git reset HEAD <file> # ๋ธ๋ ์น ๋ชฉ๋ก ๋ณด๊ธฐ (๋ก์ปฌ) git branch # ๋ธ๋ ์น ๋ชฉ๋ก ๋ณด๊ธฐ (์๊ฒฉ๊ฒฉ) git branch -r # ๋ธ๋ ์น ์ญ์ git branch -d <branch name> # ๋ณํฉ๋์ง ์๋ ๋ธ๋ ์น ์ญ์ git branch -D <branch name> git branch -D origin/tutor --remote # ์๊ฒฉ ๋ธ๋์น ์ญ์ git push origin --delete <branch name> git fetch -p # ์ญ์ ํ ๋ก์ปฌ ๋๊ธฐํgh ๋ช ๋ น์ด ๋ชจ์
# github cli ์ธ์ฆ gh auth login # ๋ฆฌํฌ์งํ ๋ฆฌ ์ธ์ฆ ๋ฐ ์ฐ๊ฒฐ ์ํ ํฉ์ธ gh auth status # ๋ฆฌํฌ์งํ ๋ฆฌ ์ฐ๊ฒฐ ๋ณ๊ฒฝ (๋ค๋ฅธ ๊ณ์ ์ผ๋ก) gh auth switch # ์ํฌํ๋ก์ฐ ์กฐํ gh workflow list # ์ํฌํ๋ก์ฐ ํ์ฑํ gh workflow enable "Change Working Dir & Shell" # ์ํฌํ๋ก์ฐ ๋นํ์ฑํ gh workflow disable "Change Working Dir & Shell" # ์ํฌํ๋ก์ฐ run ๋ฆฌ์คํธ gh run list # ์คํจํ run ๋ฆฌ์คํธ๋ง ๋ณด๊ธฐ gh run list --status failure # ์ํฌํ๋ก์ฐ run Cancel gh run cancel <workflow-hash-id> # ์ํฌํ๋ก์ฐ run Delete gh run delete <workflow-hash-id> # ๋ฆฌํฌ์งํ ๋ฆฌ ์์ฑ gh repo create <REPO_NAME> --public # ๋ฆฌํฌ์งํ ๋ฆฌ Fork gh repo fork <github https url>Terraform ๋ช ๋ น์ด ๋ชจ์
# ์ด๊ธฐํ terraform init terraform init --upgrade # ๊ณํ ํ์ธ terraform plan # ์ ์ฉ terraform apply # ์ธ์คํด์ค ๋ฆฌ์คํธ terraform state list # ์ธ์คํด์ค ์ธ๋ถ์ฌํญ ์กฐํ terraform state show aws_instance.nginx_instanceAWS CLI ๋ช ๋ น์ด ๋ชจ์
# ์ธ์ฆ์ ๋ณด ์ค์ aws configure # ์ธ์ฆ์ ๋ณด ํ์ธ aws sts get-caller-identity # ์ธ์ฆ์ ๋ณด ์ญ์ aws configure delete profile --profile <profile-name> # EC2 ํคํ์ธ ๋ฐ ์ญ์ aws ec2 describe-key-pairs --query 'KeyPairs[*].KeyName' aws ec2 delete-key-pair --key-name ec2-key # deployment ๋ฆฌ์คํธ aws deploy list-deployments # aws eks ๋ก ๋ถํฐ kubectl config ์ ๋ฐ์ดํธ ํ๊ธฐ aws eks update-kubeconfig --region ap-northeast-2 --name istory # aws ๋ก๋๋ฐธ๋ฐ์ ์ํ ํ์ธ aws elbv2 describe-load-balancers # default SC ์ค์ kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' # Deploy Agent ๋ก๊ทธ ํ์ธ tail -100 /var/log/aws/codedeploy-agent/codedeploy-agent.log # Deploy Agent ์ํ ํ์ธ sudo systemctl status codedeploy-agent # Deploy Agent ์ฌ๊ฐ๋ sudo systemctl restart codedeploy-agentHugo ๋ช ๋ น์ด
# ์ปจํ ์ด๋ ๋ด๋ถ์์ ์ฌ์ฉ hugo server --bind 0.0.0.0 --baseURL=http://localhost --port 1313 -D # ๋ก์ปฌ๋จธ์ ์์ ์ฌ์ฉ hugo server -DJava ๊ด๋ จ
# ์ ํ๋ฆฌ์ผ์ด์ ์คํ ./gradlew bootRunDocker ๋ช ๋ น์ด
# manifest ํ์ธ docker manifest inspect dangtong76/cicd-devops-ide:latest # buildx ์ด์ฉํ ๋ฉํฐ ํ๋ซํผ ๋น๋ docker buildx build --platform linux/amd64,linux/arm64 -t <your-dockerhub-id>/<image-name> --push .