[jenkins 배포(1)]

이동현·2022년 9월 10일
0

SKT 프로젝트

목록 보기
11/15




1)
rm -r ./github-to-docker-practice
sudo -s
2)
//Build new image and push to ACR.
#mkdir azure-vote
git clone https://github.com/rodom1018/github-to-docker-practice.git
WEB_IMAGE_NAME="ACRLOGINSERVER/githubtodockerpractice:kube{ACR_LOGINSERVER}/github-to-docker-practice:kube{BUILD_NUMBER}"
docker build -t $WEB_IMAGE_NAME ./github-to-docker-practice
docker login ${ACR_LOGINSERVER} -u ${ACR_ID} -p ${ACR_PASSWORD}
docker push $WEB_IMAGE_NAME
#docker pull $WEB_IMAGE_NAME

3)
//Update kubernetes deployment with new image.
WEB_IMAGE_NAME="ACRLOGINSERVER/githubtodockerpractice:kube{ACR_LOGINSERVER}/github-to-docker-practice:kube{BUILD_NUMBER}"
#kubectl delete deployment github-to-docker-practice
#kubectl create deployment github-to-docker-practice --image=WEBIMAGENAMEkubectlsetimagedeployment/githubtodockerpracticegithubtodockerpractice=WEB_IMAGE_NAME kubectl set image deployment/github-to-docker-practice github-to-docker-practice=WEB_IMAGE_NAME
#kubectl expose deployment github-to-docker-practice --port=8000 --target-port=8000 --name=python-app-svc --type=LoadBalancer

수정해도 같은 주소?

0개의 댓글