Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0ae2c02
chore: added lab1 structure
dorley174 Jan 28, 2026
6c55c84
setupped venv and flask settings
dorley174 Jan 28, 2026
97278aa
completed main task
dorley174 Jan 28, 2026
882466a
finalizing work with main lab task
dorley174 Jan 28, 2026
a299fba
Merge pull request #1 from dorley174/lab01
dorley174 Feb 4, 2026
a5751cb
feat: add docker usage and lab report for lab2
dorley174 Feb 4, 2026
6cb4986
Merge pull request #2 from dorley174/lab02
dorley174 Feb 11, 2026
e9a7686
feat: added main lab3 task and added gh ecrets
dorley174 Feb 11, 2026
6842685
fix: added correct branches to ci work
dorley174 Feb 11, 2026
aab12d7
fix: fixing snyk work
dorley174 Feb 11, 2026
56f8169
fix: fixing snyk work 2
dorley174 Feb 11, 2026
34ca629
fix: removing unused libraries from py files
dorley174 Feb 11, 2026
d715cc0
fix: fixing app_python folder missing in commands
dorley174 Feb 11, 2026
e99bb2c
fix: added coverage.xml and added lab03 branch to docker work
dorley174 Feb 11, 2026
21ce340
feat: finalize lab work, added lab03.md, added ci badge to readme
dorley174 Feb 11, 2026
bbb6c21
Merge pull request #3 from dorley174/lab03
dorley174 Feb 19, 2026
4686605
feat: added terraform lab part
dorley174 Feb 19, 2026
11d5b0b
finished work with pulumi
dorley174 Feb 19, 2026
1f8700e
Merge pull request #4 from dorley174/lab04
dorley174 Feb 25, 2026
6d3473d
added ansible setup
dorley174 Feb 25, 2026
07e3d9a
added local vagrant vm, waiting workflow image
dorley174 Feb 26, 2026
ee892c5
ci: enable python workflow on lab05
dorley174 Feb 26, 2026
c899840
Lab05: make deploy work without extra-vars; optional docker login
dorley174 Feb 26, 2026
05dcaa1
finalize work with filling lab05.mdd
dorley174 Feb 26, 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
114 changes: 114 additions & 0 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: python-ci

on:
workflow_dispatch:
push:
branches: ["lab03", "lab05", "master"]
paths:
- "app_python/**"
- ".github/workflows/python-ci.yml"
pull_request:
branches: ["master"]
paths:
- "app_python/**"
- ".github/workflows/python-ci.yml"

concurrency:
group: python-ci-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
IMAGE_NAME: devops-info-service
APP_DIR: app_python

jobs:
test-and-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: |
app_python/requirements.txt
app_python/requirements-dev.txt

- name: Install deps
run: |
python -m pip install --upgrade pip
pip install -r app_python/requirements.txt
pip install -r app_python/requirements-dev.txt

- name: Lint (ruff)
run: |
cd app_python
ruff check .

- name: Tests (pytest) + coverage
run: |
cd app_python
pytest -q tests --cov=. --cov-report=term-missing --cov-report=xml

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: app_python/coverage.xml

- name: Install Snyk CLI
run: npm install -g snyk

- name: Snyk scan (dependencies)
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: |
cd app_python
snyk test --severity-threshold=high --file=requirements.txt

docker-build-and-push:
runs-on: ubuntu-latest
needs: test-and-lint
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/lab03' || github.ref == 'refs/heads/lab05')
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare CalVer tags
run: |
echo "CALVER_MONTH=$(date -u +'%Y.%m')" >> $GITHUB_ENV
echo "CALVER_BUILD=$(date -u +'%Y.%m').${{ github.run_number }}" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

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

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ${{ env.APP_DIR }}
file: ${{ env.APP_DIR }}/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.CALVER_BUILD }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.CALVER_MONTH }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
57 changes: 57 additions & 0 deletions .github/workflows/terraform-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Terraform CI

on:
pull_request:
paths:
- "terraform/**"
- ".github/workflows/terraform-ci.yml"
push:
branches:
- master
- lab04
paths:
- "terraform/**"
- ".github/workflows/terraform-ci.yml"

jobs:
terraform-check:
name: "fmt / validate / tflint"
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
workdir:
- terraform
- terraform/github

defaults:
run:
working-directory: ${{ matrix.workdir }}

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

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false

- name: Terraform fmt
run: terraform fmt -check -recursive

- name: Terraform init (no backend)
run: terraform init -backend=false

- name: Terraform validate
run: terraform validate -no-color

- name: Setup TFLint
uses: terraform-linters/setup-tflint@v3

- name: TFLint init
run: tflint --init

- name: TFLint
run: tflint
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
test
test
.env
key.json
# --- Ansible ---
*.retry
.vault_pass
ansible/inventory/*.pyc
ansible/inventory/__pycache__/
__pycache__/

# --- Vagrant ---
.vagrant/

# Do not commit real inventory with IPs if you don't want
# ansible/inventory/hosts.ini
21 changes: 21 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.hostname = "lab05"

# ВАЖНО: отключаем шаринг папки проекта в VM
# (часто ломается из-за кириллицы/пробелов в пути + нам не нужен репозиторий в VM)
config.vm.synced_folder ".", "/vagrant", disabled: true

# Пробрасываем порты на Windows-хост
# host_ip "0.0.0.0" нужно, чтобы WSL мог подключиться к проброшенному порту через IP Windows-хоста.
config.vm.network "forwarded_port", guest: 22, host: 2222, host_ip: "0.0.0.0", id: "ssh", auto_correct: true
config.vm.network "forwarded_port", guest: 5000, host: 5000, host_ip: "0.0.0.0", id: "app", auto_correct: true

config.ssh.insert_key = true

config.vm.provider "virtualbox" do |vb|
vb.name = "lab05-ansible"
vb.memory = 2048
vb.cpus = 2
end
end
24 changes: 24 additions & 0 deletions ansible/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Lab05 — Ansible

See:
- `labs/lab05.md` — assignment
- `ansible/docs/LAB05.md` — report template

## Quick start

```bash
cd ansible

# Install required collections
ansible-galaxy collection install -r requirements.yml

# Connectivity test
ansible all -m ping

# Provision the target VM (run twice to prove idempotency)
ansible-playbook playbooks/provision.yml
ansible-playbook playbooks/provision.yml

# Deploy the application (uses Ansible Vault)
ansible-playbook playbooks/deploy.yml --ask-vault-pass
```
14 changes: 14 additions & 0 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[defaults]
inventory = inventory/hosts.ini
roles_path = roles
host_key_checking = False
# For Vagrant boxes the default SSH user is usually "vagrant".
# You can still override this per-host in inventory/hosts.ini.
remote_user = vagrant
retry_files_enabled = False
interpreter_python = auto_silent

[privilege_escalation]
become = True
become_method = sudo
become_user = root
Loading