project neme aws-ci-python-codebuild Description - optional
Source Source 1 - Primary select GitHub
Public repository Repository URL https://github.com/pythonkid2/DevOps-Practice
Environment - Operating system - ubuntu
Runtime(s) - Standard
Image - aws/codebuild/standard:7.0
Buildspec-
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.11
pre_build:
commands:
- echo "Installing dependencies..."
- pip install -r Devops-Projects/AWS-CI/simple-python-app/requirements.txt
build:
commands:
- echo "Running tests..."
- cd Devops-Projects/AWS-CI/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!"
add AmazonSSMFullAccess policy to role we created
Parameter details Name - /myapp/docker-credentials/username/ nameopff application/whatsit /what u wanna store Tier - standard type - secure string
My current account KMS Key ID - alias/aws/ssm
Create pipeline
Source Source provider GitHub (Version 2)
connect to github
+++
Sure, here's a more structured documentation of your CI process:
This document outlines the Continuous Integration (CI) process for automating the build and deployment of a Python application using AWS CodeBuild, AWS Systems Manager Parameter Store, and AWS CodePipeline.
- Project Name: aws-ci-python-codebuild
- Description: (Optional)
- Source:
- Source Provider: GitHub (Version 1)
- Repository URL: https://github.com/pythonkid2/DevOps-Practice
- Environment:
- Operating System: Ubuntu
- Runtime(s): Standard
- Image: aws/codebuild/standard:7.0
- Buildspec:
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.11
pre_build:
commands:
- echo "Installing dependencies..."
- pip install -r Devops-Projects/AWS-CI/simple-python-app/requirements.txt
build:
commands:
- echo "Running tests..."
- cd Devops-Projects/AWS-CI/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!"- IAM Role: Add
AmazonSSMFullAccesspolicy to the role used by CodeBuild.
- Parameter Details:
- Name: /myapp/docker-credentials/username/
- Description: (Optional)
- Tier: Standard
- Type: Secure String
- KMS Key ID: alias/aws/ssm (KMS key for encryption)
- Create Pipeline:
- Source:
- Source Provider: GitHub (Version 2)
- Connect to GitHub repository for source code.
- Stages and Actions: (Pending)
- Source:
Feel free to customize and expand upon this documentation as needed for your specific requirements.
