-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_and_deploy.ps1
24 lines (20 loc) · 1.15 KB
/
build_and_deploy.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Write-Host "----------- Deleting old pod -----------" -ForegroundColor Yellow
$delete_pod = "kubectl delete pod keci-pod"
Invoke-Expression $delete_pod
Write-Host "----------- Old pod deleted -----------" -ForegroundColor Green
Write-Host "----------- Building new image -----------" -ForegroundColor Yellow
$build_image = "docker build -t keci ."
Invoke-Expression $build_image
Write-Host "----------- Image built -----------" -ForegroundColor Green
Write-Host "----------- Tagging new image -----------" -ForegroundColor Yellow
$tag_image = "docker tag keci:latest localhost:5000/keci:latest"
Invoke-Expression $tag_image
Write-Host "----------- Image tagged -----------" -ForegroundColor Green
Write-Host "----------- Pushing image to repo -----------" -ForegroundColor Yellow
$push_to_repo = "docker push localhost:5000/keci:latest"
Invoke-Expression $push_to_repo
Write-Host "----------- Image pushed -----------" -ForegroundColor Green
Write-Host "----------- Creating new pod -----------" -ForegroundColor Yellow
$create_pod = "kubectl create -f .\k8s\keci-pod.yaml"
Invoke-Expression $create_pod
Write-Host "----------- Pod created -----------" -ForegroundColor Green