-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
496dd86
commit 6e943d1
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
commands: | ||
- echo Installing app dependencies... | ||
- curl -LO https://dl.k8s.io/release/v1.27.2/bin/linux/amd64/kubectl | ||
- chmod +x ./kubectl | ||
- mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin | ||
- echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc | ||
- source ~/.bashrc | ||
- echo 'Check kubectl version' | ||
- kubectl version --short --client | ||
|
||
pre_build: | ||
commands: | ||
- echo Logging in to Amazon ECR... | ||
- aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin 069279771141.dkr.ecr.us-east-2.amazonaws.com | ||
- IMAGE_REPO_NAME=069279771141.dkr.ecr.us-east-2.amazonaws.com/netflix-app:latest | ||
- IMAGE_TAG=latest | ||
build: | ||
commands: | ||
- echo Build started on `date` | ||
- echo Building the Docker image... | ||
- docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG . | ||
|
||
|
||
|
||
post_build: | ||
commands: | ||
- echo Build completed on `date` | ||
- echo Pushing the Docker image... | ||
- docker push $IMAGE_REPO_NAME:$IMAGE_TAG | ||
- aws eks --region us-east-2 update-kubeconfig --name k8s-boy | ||
- echo Push the latest image to cluster | ||
- kubectl apply -f deployment.yml |