Compare commits

27 Commits

Author SHA1 Message Date
Robert Ose
9f7e6db261 test 2025-12-17 12:53:48 +01:00
sotos
bb88b190ee update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Successful in 1m24s
2025-12-17 12:14:53 +01:00
sotos
7f100d85d1 update
Some checks failed
CI/CD Pipeline / lint (push) Has been cancelled
CI/CD Pipeline / deploy (push) Successful in 1m15s
2025-12-17 11:35:01 +01:00
sotos
6931df8463 Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 39s
2025-12-17 11:32:59 +01:00
sotos
a339ad8d9c update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 56s
2025-12-17 11:28:21 +01:00
sotos
a975f69891 Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 1m23s
2025-12-17 11:13:38 +01:00
sotos
fa8afa87e5 Merge branch 'main' of https://dns.s-martika.com/smartika/Wordpress-Ansible
Some checks failed
CI/CD Pipeline / lint (push) Failing after 19s
CI/CD Pipeline / deploy (push) Failing after 47s
2025-12-17 11:03:39 +01:00
sotos
46582b611d Update 2025-12-17 11:03:08 +01:00
Robert Ose
ddcc2ace6a Merge branch 'main' of https://dns.s-martika.com/smartika/Wordpress-Ansible
Some checks failed
CI/CD Pipeline / lint (push) Failing after 17s
CI/CD Pipeline / deploy (push) Failing after 1m2s
2025-12-17 10:54:08 +01:00
Robert Ose
dc23f3ac69 update 2025-12-17 10:53:59 +01:00
sotos
1e1d4913a8 update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 42s
2025-12-17 10:48:06 +01:00
sotos
4f77663f89 Update 2025-12-17 10:44:03 +01:00
sotos
882a32f2dc Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 1m29s
2025-12-17 10:33:05 +01:00
sotos
7d8f7d4658 Updtae
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 48s
2025-12-17 10:15:52 +01:00
sotos
6dfca196a2 Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 19s
CI/CD Pipeline / deploy (push) Failing after 46s
2025-12-17 10:08:53 +01:00
sotos
0600f09f5b Funktionsfähig
Some checks failed
CI/CD Pipeline / lint (push) Failing after 17s
CI/CD Pipeline / deploy (push) Failing after 46s
2025-12-17 09:43:37 +01:00
sotos
90adb34542 update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 47s
2025-12-17 09:33:11 +01:00
sotos
8c871178cc asdf
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 1m4s
2025-12-17 09:24:08 +01:00
sotos
6d4effa607 Funktionsfähig
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 40s
2025-12-17 09:07:26 +01:00
sotos
d2102f88e7 Funktionsfähig
Some checks failed
CI/CD Pipeline / lint (push) Failing after 17s
CI/CD Pipeline / deploy (push) Failing after 40s
2025-12-17 09:02:57 +01:00
sotos
f28f43bdab asdf
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 41s
2025-12-17 09:00:00 +01:00
sotos
2618ea8ec3 Funktionsfähig
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 39s
2025-12-17 08:57:17 +01:00
sotos
c8f490d8aa Update
Some checks failed
CI/CD Pipeline / lint (push) Has been cancelled
CI/CD Pipeline / deploy (push) Failing after 39s
2025-12-17 08:54:14 +01:00
sotos
3108c915c8 Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 19s
CI/CD Pipeline / deploy (push) Failing after 39s
2025-12-17 08:52:24 +01:00
Robert Ose
7bade2f31e Merge branch 'main' of https://dns.s-martika.com/smartika/Wordpress-Ansible
Some checks failed
CI/CD Pipeline / lint (push) Failing after 17s
CI/CD Pipeline / deploy (push) Failing after 1m8s
2025-12-16 12:34:03 +01:00
Robert Ose
be029575ed Maaa
:erge branch 'main' of https://dns.s-martika.com/smartika/Wordpress-Ansible
2025-12-16 12:33:05 +01:00
Robert Ose
6a49e454a9 fixed 2025-12-16 12:26:21 +01:00
9 changed files with 71 additions and 44 deletions

View File

@@ -1,9 +1,9 @@
--- ---
name: CI/CD Pipeline name: CI/CD Pipeline
on: "on":
push: push:
branches: [main, flip_dev] branches: [main, flip_dev, hannes]
jobs: jobs:
lint: lint:
@@ -39,20 +39,32 @@ jobs:
pip3 install --upgrade pip pip3 install --upgrade pip
pip3 install ansible pip3 install ansible
- name: Setup SSH key with passphrase - name: Setup SSH
shell: bash
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }}
run: | run: |
set -euo pipefail
mkdir -p ~/.ssh mkdir -p ~/.ssh
printf "%s\n" "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa <<< "${{ secrets.SSH_PASSPHRASE }}"
- name: Run Ansible deployment
run: |
if [ -n "$SSH_PASSPHRASE" ]; then
eval "$(ssh-agent -s)" eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE" if [ -n "${SSH_PASSPHRASE:-}" ]; then
echo "$SSH_PASSPHRASE" | ssh-add ~/.ssh/id_ed25519
else
ssh-add ~/.ssh/id_ed25519
fi fi
ssh -o BatchMode=yes root@213.95.90.157 true
- name: Run Ansible
run: |
ansible-playbook -i ansible/inventory.yaml site.yaml ansible-playbook -i ansible/inventory.yaml site.yaml

View File

@@ -2,3 +2,5 @@
[defaults] [defaults]
inventory = ansible/inventory.yaml inventory = ansible/inventory.yaml
roles_path = ./roles roles_path = ./roles
[ssh_connection]
ssh_args = -o BatchMode=yes -o PreferredAuthentications=publickey

View File

@@ -4,4 +4,3 @@ all:
server1: server1:
ansible_host: 213.95.90.157 ansible_host: 213.95.90.157
ansible_user: root ansible_user: root
ansible_ssh_private_key_file: /Users/sotos/.ssh/id_rsa

View File

@@ -1,24 +1,8 @@
---
- hosts: all - hosts: all
become: true become: true
roles:
- docker/snake
vars: vars:
app_dir: /opt/docker/snake app_dir: /opt/docker/snake
snake_image: dns.s-martika.com/smartika/snake-game:2.0
tasks: roles:
- name: Create app directory - role: docker/snake
file:
path: "{{ app_dir }}"
state: directory
- name: Copy compose file
copy:
src: "{{ playbook_dir }}/roles/docker/snake/files/docker-compose.yaml"
dest: "{{ app_dir }}/docker-compose.yaml"
- name: Start snake container
command: docker compose up -d
args:
chdir: "{{ app_dir }}"

View File

@@ -3,7 +3,7 @@
gitea_user: smartika gitea_user: smartika
gitea_token: "idNu783r4ub7ZXi" gitea_token: "idNu783r4ub7ZXi"
snake_image: dns.s-martika.com/smartika/snake-game snake_image: dns.s-martika.com/smartika/snake-game:2.0
snake_tag: "1.0" app_dir: /opt/docker/snake
snake_container_name: snake-game snake_container_name: snake-game
snake_port: 8080 snake_port: 8080

View File

@@ -2,7 +2,7 @@
version: "3.8" version: "3.8"
services: services:
snake: snake:
image: dns.s-martika.com/smartika/snake-game:1.0 image: dns.s-martika.com/smartika/snake-game:2.0
container_name: snake-game777 container_name: snake-game777
restart: unless-stopped restart: unless-stopped
ports: ports:

View File

@@ -1,22 +1,36 @@
--- ---
- name: Ensure app directory exists
file:
path: "{{ app_dir }}"
state: directory
owner: root
group: root
mode: '0755'
# Login to private registry
- name: Login to private registry - name: Login to private registry
docker_login: docker_login:
registry_url: dns.s-martika.com registry_url: dns.s-martika.com
username: "{{ gitea_user }}" username: "{{ gitea_user }}"
password: "{{ gitea_token }}" password: "{{ gitea_token }}"
# Pull latest image
- name: Pull snake-game image - name: Pull snake-game image
docker_image: docker_image:
name: dns.s-martika.com/smartika/snake-game name: "{{ snake_image }}"
tag: "1.0"
source: pull source: pull
# Run container
- name: Run snake-game container - name: Run snake-game container
docker_container: docker_container:
name: snake-game name: snake-game
image: dns.s-martika.com/smartika/snake-game:1.0 image: "{{ snake_image }}"
state: started state: started
restart_policy: always restart_policy: unless-stopped
ports: ports:
- "8080:80" - "8080:80" # host port → container port
pull: yes

View File

@@ -4,13 +4,25 @@ services:
prometheus: prometheus:
image: prom/prometheus:latest image: prom/prometheus:latest
volumes: volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - ./prometheus.yaml:/etc/prometheus/prometheus.yml:ro
ports: ports:
- "9090:9090" - "9090:9090"
networks: networks:
- snake_net - snake_net
restart: unless-stopped restart: unless-stopped
nginx-prometheus-exporter:
image: nginx/nginx-prometheus-exporter:latest
container_name: nginx-prometheus-exporter
ports:
- "9113:9113"
environment:
- NGINX_STATUS_URL=http://nginx:8081/status
networks:
- snake_net
grafana: grafana:
image: grafana/grafana:latest image: grafana/grafana:latest
volumes: volumes:

View File

@@ -6,3 +6,7 @@ scrape_configs:
- job_name: "prometheus" - job_name: "prometheus"
static_configs: static_configs:
- targets: ["localhost:9090"] - targets: ["localhost:9090"]
- job_name: 'nginx'
static_configs:
- targets: ['nginx-prometheus-exporter:9113']