Skip to content

Commit

Permalink
Update buildspec.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-veeramalla authored Jul 14, 2023
1 parent 25ee5af commit bbf02e7
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions day-14/simple-python-app/buildspec.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
version: 0.3
version: 0.2

env:
parameter-store:
DOCKER_REGISTRY_USERNAME: /myapp/docker-credentials/username
DOCKER_REGISTRY_PASSWORD: /myapp/docker-credentials/password
DOCKER_REGISTRY_URL: /myapp/docker-registry/url
phases:
install:
runtime-versions:
python: 3.8
python: 3.11
pre_build:
commands:
- echo "Installing dependencies..."
- pip install -r requirements.txt
- pip install -r day-13/simple-python-app/requirements.txt
build:
commands:
- echo "Running tests..."
- pytest
- echo "Building the Flask application..."
- python setup.py install
- cd day-13/simple-python-app/
- echo "Building Docker image..."
- echo "$DOCKER_REGISTRY_PASSWORD" | docker login -u "$DOCKER_REGISTRY_USERNAME" --password-stdin "$DOCKER_REGISTRY_URL"
- docker build -t "$DOCKER_REGISTRY_URL/$DOCKER_REGISTRY_USERNAME/simple-python-flask-app:latest" .
- docker push "$DOCKER_REGISTRY_URL/$DOCKER_REGISTRY_USERNAME/simple-python-flask-app:latest"
post_build:
commands:
- echo "Build completed successfully!"
artifacts:
files:
- '**/*'
base-directory: ../simple-python-app

0 comments on commit bbf02e7

Please sign in to comment.