-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildspec.yaml
More file actions
26 lines (23 loc) · 844 Bytes
/
buildspec.yaml
File metadata and controls
26 lines (23 loc) · 844 Bytes
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
# This file is used to create CI/CD pipeline in AWS
version: 0.2
env:
parameter-store:
DOCKER_REGISTRY_USERNAME : /cicd/docker-creds/my-username
DOCKER_REGISTRY_PASSWORD : /cicd/docker-creds/my-password
DOCKER_REGISTRY_URL : /cicd/docker-registry/url
phases:
install:
runtime-versions:
python: 3.11
pre_build:
commands:
- pip3 install -r requirements.txt
build:
commands:
- echo "Building the application"
- docker build -t $DOCKER_REGISTRY_URL/$DOCKER_REGISTRY_USERNAME/python_application:v1 .
- echo "$DOCKER_REGISTRY_PASSWORD" | docker login --username $DOCKER_REGISTRY_USERNAME --password-stdin $DOCKER_REGISTRY_URL
- docker push $DOCKER_REGISTRY_URL/$DOCKER_REGISTRY_USERNAME/python_application:v1
post_build:
commands:
- echo "Build completed on `date`"