Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/devsecops-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: devsecops-pipeline
on:
push:
branches:
- 'main'
paths-ignore:
- '**/README.md'
jobs:
devsecops-pipeline:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Secret Scanning
uses: gitleaks/gitleaks-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v8.2.1
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/python@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

docker-pipeline:
needs: devsecops-pipeline
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker Linting
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
ignore: DL4000

- name: Docker Build
run: docker build -t ${{ vars.DOCKERHUB_USERNAME }}/helloworld-demo-python:latest .

- name: Docker Images
run: docker images

- name: Docker Container
run: docker run -itd ${{ vars.DOCKERHUB_USERNAME }}/helloworld-demo-python:latest

- name: Docker Container Lists
run: docker ps

- name: Docker Push
run: docker push ${{ vars.DOCKERHUB_USERNAME }}/helloworld-demo-python:latest

8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.14.7-alpine3.24
MAINTAINER Annamalai
LABEL description="DevSecOps Demo"
RUN mkdir /app
COPY . /app
WORKDIR /app
EXPOSE 8080
CMD ["python3", "app.py"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# A Simple Hello World Python Demo
# A Simple Hello World Python Demo - DevSecOps - 05-08-2026 Hello

Example used to demonstrate ```docker init``` CLI for a simple Hello World Python Program

Expand Down
6 changes: 6 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.organization=annaanjali2
sonar.projectKey=annaanjali2_helloworld-demo-python

# relative paths to source directories. More details and properties are described
# at https://docs.sonarsource.com/sonarqube-cloud/advanced-setup/analysis-scope/
sonar.sources=.