목적
생각 : Notion과 TodoList어플을 연결하고 싶다.
이유 : Notion에서 제공하는 위젯 어플이 없기 때문에
AgileBoard
SSH 연결
ssh -i "C:\Users\d9801\Downloads\Pem\NTT_Frontend.pem" "ec2-user"@54.180.28.187
JSON
복사
SCP 전송
scp -i "C:\Users\d9801\Downloads\Pem\NTT_Frontend.pem" "전송할 파일 절대경로" "ec2-user"@54.180.28.187
JSON
복사
CD 용 Token값
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
JSON
복사
#!/bin/bash
# 변수 설정
key_file="/home/ec2-user/deploy-test.pem"
username="ec2-user"
internal_ec2_ip="172.31.22.18"
# SSH 접속 명령 실행
ssh -i "$key_file" "$username@$internal_ec2_ip" "$@"
JavaScript
복사
ssh -i deploy-test.pem ec2-user@172.31.22.18
JavaScript
복사
#!/bin/bash
image_name="ghcr.io/annsunghee/docker_build에서_사용한_저장소이름"
image_tag="latest"
GHCR_TOKEN=$1
GITHUB_ACTOR=$2
key_file="pem키경로"
username="ec2-user"
internal_ec2_ip="내부ip"
archive_file="docker_build에서_사용한_저장소이름.tar.gz"
echo "GITHUB_ACTOR: $GITHUB_ACTOR"
echo "$GHCR_TOKEN" | docker login ghcr.io --username "$GITHUB_ACTOR" --password-stdin
docker pull "$image_name:$image_tag"
docker save "$image_name:$image_tag" > docker_build에서_사용한_저장소이름.tar
gzip docker_build에서_사용한_저장소이름.tar
scp -i "$key_file" "$archive_file" "$username"@"$internal_ec2_ip":~/backend_download/
./connect_private_ec2_instance.sh <<EOF
cd backend_download
tar zxf "$archive_file"
ls
echo "image_name: $image_name"
echo "image_tag: $image_tag"
ls -al
docker load -i docker_build에서_사용한_저장소이름.tar.gz
rm -rf *
cd ~/bastion-redis-backend-deploy
docker-compose up -d
EOF
rm -f "$archive_file"
docker logout
JavaScript
복사