Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c5948b4
feat: Created main part of the lab1 task
setterwars Jan 25, 2026
9523364
feat: completed lab1 bonus task
setterwars Jan 26, 2026
82ede12
feat: completed lab1 bonus task
setterwars Jan 26, 2026
f10edd2
Merge pull request #1 from setterwars/lab1
setterwars Jan 29, 2026
d24f89d
feat: completed lab 2 with bonus task
setterwars Jan 29, 2026
9542450
feat: completed lab 2 with bonus task
setterwars Jan 29, 2026
1abdcd5
created CI/CD
setterwars Feb 5, 2026
4d6c08b
created CI/CD
setterwars Feb 5, 2026
bba93a7
fix: some fix in CI/CD
setterwars Feb 5, 2026
9e441ca
fix: CI/CD
setterwars Feb 5, 2026
9c86b69
fix: CI/CD
setterwars Feb 5, 2026
82c375d
fix: CI/CD
setterwars Feb 5, 2026
82985fb
fix: CI/CD pytest
setterwars Feb 5, 2026
96339ba
feat: Added best practice of CI/CD
setterwars Feb 5, 2026
c7930ae
fix: Some fix in CI/CD
setterwars Feb 5, 2026
4aa4cec
fix synk in CI/CD
setterwars Feb 5, 2026
7544deb
snyk fix
setterwars Feb 5, 2026
3863ca1
fix: try to fix snyk
setterwars Feb 5, 2026
adbba9d
fix ci/cd
setterwars Feb 5, 2026
27b32c6
fix: Notice what sync now paied instrument use free pip-audit
setterwars Feb 5, 2026
e48146a
fix: Changed flask version
setterwars Feb 5, 2026
02f7837
Completed lab without bonus tasl
setterwars Feb 5, 2026
11d0811
implement bonus task
setterwars Feb 5, 2026
bd545f2
implement bonus task
setterwars Feb 5, 2026
924736f
some fix
setterwars Feb 5, 2026
672ee75
completed lab
setterwars Feb 5, 2026
3f45029
Created 1 and 2 task and part of the bonus task
setterwars Feb 14, 2026
2591fe6
fix
setterwars Feb 14, 2026
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
91 changes: 91 additions & 0 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Go CI/CD Pipeline

on:
push:
branches: [ "master", "lab3" ]
paths:
- 'app_go/**'
- '.github/workflows/go-ci.yml'
pull_request:
branches: [ "master", "lab3" ]
paths:
- 'app_go/**'
- '.github/workflows/go-ci.yml'

env:
REGISTRY: docker.io
IMAGE_NAME: zsalavat/devops-info-service-go

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('app_go/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
working-directory: app_go
run: go mod download

- name: Lint with golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
working-directory: app_go
args: --timeout=2m

- name: Run unit tests
working-directory: app_go
run: go test ./... -v

cd:
needs: ci
runs-on: ubuntu-latest
if: >
github.event_name == 'push' &&
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/lab3')
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata for Docker tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value={{date 'YYYY.MM'}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: app_go
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
106 changes: 106 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Python CI/CD Pipeline

on:
push:
branches: [ "master", "lab3" ]
paths:
- 'app_python/**'
- '.github/workflows/python-ci.yml'
pull_request:
branches: [ "master", "lab3" ]
paths:
- 'app_python/**'
- '.github/workflows/python-ci.yml'
env:
REGISTRY: docker.io
IMAGE_NAME: zsalavat/devops-info-service-python

jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f app_python/requirements.txt ]; then
pip install -r app_python/requirements.txt
fi
pip install pytest pylint pip-audit
- name: Lint with pylint
run: |
pylint --disable=R,C,W1203,W1514,W0621,W0611,E0401 app_python/app.py app_python/tests/
- name: Run unit tests with coverage
run: |
pytest -v --tb=short --cov=app_python --cov-report=xml --cov-report=term
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
flags: python
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}


- name: Run security scan with pip-audit
working-directory: app_python
run: pip-audit -r requirements.txt

cd:
needs: ci
runs-on: ubuntu-latest
if: >
github.event_name == 'push' &&
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/lab3')
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata for Docker tags
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=raw,value={{date 'YYYY.MM'}}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: app_python
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
81 changes: 81 additions & 0 deletions .github/workflows/terraform-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Terraform CI/CD Pipeline

on:
push:
branches: ["master", "lab4"]
paths:
- 'terraform/**'
pull_request:
branches: ["master", "lab4"]
paths:
- 'terraform/**'

jobs:
validate:
name: Validate Terraform
runs-on: ubuntu-latest
defaults:
run:
shell: bash

env:
TF_IN_AUTOMATION: "true"
TF_INPUT: "false"
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.6.6
terraform_wrapper: false

- name: Prepare Terraform plugin cache
run: |
mkdir -p "${TF_PLUGIN_CACHE_DIR}"
- name: Cache Terraform plugins
uses: actions/cache@v4
with:
path: .terraform.d/plugin-cache
key: ${{ runner.os }}-terraform-plugins-${{ hashFiles('terraform/.terraform.lock.hcl') }}
restore-keys: |
${{ runner.os }}-terraform-plugins-
- name: Terraform fmt (check)
working-directory: terraform
run: |
echo "::group::terraform fmt"
terraform fmt -check -recursive -diff
echo "::endgroup::"
- name: Terraform init (no backend)
working-directory: terraform
run: |
echo "::group::terraform init"
terraform init -backend=false -no-color
echo "::endgroup::"
- name: Terraform validate
working-directory: terraform
run: |
echo "::group::terraform validate"
terraform validate -no-color
echo "::endgroup::"
- name: Set up TFLint
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: v0.53.0

- name: TFLint (lint)
working-directory: terraform
run: |
echo "::group::tflint"
tflint --version
# If you keep placeholder/unused variables for later labs, disable this rule.
tflint --disable-rule=terraform_unused_declarations
echo "::endgroup::"
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
test
test
app_python/.venv
app_python/.pytest_cache
app_python/__pycache__


# Terraform files
*.tfstate
*.tfstate.*
*.tfvars
.terraform/
terraform.tfvars

# Sensitive files
secrets.auto.tfvars

Pulumi.*.yaml
venv/
__pycache__/
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/DevOps-Core-Course.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/copilot.data.migration.ask2agent.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading