forked from 00farhan00/Python-Flask-RestAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
46 lines (44 loc) · 1.58 KB
/
.gitlab-ci.yml
File metadata and controls
46 lines (44 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
stages:
- build
- Build Docker Image
- Login & Push Docker Image
- deploy on eks
build-job:
stage: build
tags:
- test-runner #gitlab-Runner Tag to run project on that specific tag
script:
- echo "python build started"
- "pip install -r requirements.txt"
dockerimage-job:
stage: Build Docker Image
tags:
- test-runner
script:
- echo "Building Docker image"
- "docker info"
- aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 391215170865.dkr.ecr.ap-south-1.amazonaws.com
- docker build -t 391215170865.dkr.ecr.ap-south-1.amazonaws.com/python-app .
dockerlogin and push -job:
stage: Login & Push Docker Image
tags:
- test-runner
before_script:
- echo "login to ECR"
- "aws ecr get-login-password --region ap-south-1 | docker login --username AWS --password-stdin 391215170865.dkr.ecr.ap-south-1.amazonaws.com"
# - docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_PASSWD"
# - docker login registry.gitlab.com -u 00farhan00 -p $CICD_TOKEN
script:
- echo "docker push image"
- docker push 391215170865.dkr.ecr.ap-south-1.amazonaws.com/python-app:latest
# - docker push farhanregistery/python-application
# - docker push registery.gitlab.com/00farhan00/maven-web-app
deploy on eks:
stage: deploy on eks
tags:
- test-runner #gitlab- Runner Tag to run project on that specific tag
script:
- echo "deployment on eks cluster started"
- "kubectl apply -f manifest.yml"
- "kubectl get pods"
- "kubectl get svc"