Compare commits
1 Commits
36dac62c67
...
flip_dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ec10f0f65 |
0
.ansible/.lock
Normal file
0
.ansible/.lock
Normal file
@@ -1,58 +0,0 @@
|
|||||||
---
|
|
||||||
name: CI/CD Pipeline
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, flip_dev]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: node:20-bullseye
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Python & linters
|
|
||||||
run: |
|
|
||||||
apt-get update && apt-get install -y python3 python3-pip bash git
|
|
||||||
pip3 install --upgrade pip
|
|
||||||
pip3 install yamllint ansible-lint
|
|
||||||
|
|
||||||
- name: Run linters
|
|
||||||
run: |
|
|
||||||
yamllint .
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
runs-on: docker
|
|
||||||
container:
|
|
||||||
image: node:20-bullseye
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Ansible & dependencies
|
|
||||||
run: |
|
|
||||||
apt-get update && apt-get install -y python3 python3-pip openssh-client bash git
|
|
||||||
pip3 install --upgrade pip
|
|
||||||
pip3 install ansible
|
|
||||||
|
|
||||||
- name: Setup SSH key with passphrase
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.ssh
|
|
||||||
printf "%s\n" "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
|
|
||||||
chmod 600 ~/.ssh/id_rsa
|
|
||||||
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)"
|
|
||||||
ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE"
|
|
||||||
fi
|
|
||||||
ansible-playbook -i ansible/inventory.yaml site.yaml
|
|
||||||
11
.gitlab-ci.yml
Normal file
11
.gitlab-ci.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
stages:
|
||||||
|
- lint
|
||||||
|
|
||||||
|
yamllint:
|
||||||
|
stage: lint
|
||||||
|
image: python:3.12-alpine
|
||||||
|
before_script:
|
||||||
|
- pip install --no-cache-dir yamllint
|
||||||
|
script:
|
||||||
|
- yamllint .
|
||||||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"ansible.python.interpreterPath": "/opt/homebrew/bin/python3"
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
extends: default
|
|
||||||
|
|
||||||
ignore: |
|
|
||||||
^venv/*
|
|
||||||
^\.venv/*
|
|
||||||
^\.gitea/*
|
|
||||||
^\.git/*
|
|
||||||
^\.ansible_test/*
|
|
||||||
^ansible_test/*
|
|
||||||
^\.ansiblelint/*
|
|
||||||
|
|
||||||
rules:
|
|
||||||
line-length:
|
|
||||||
max: 400
|
|
||||||
level: warning
|
|
||||||
trailing-spaces: disable
|
|
||||||
indentation:
|
|
||||||
spaces: 2
|
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
- name: Create app directory
|
- name: Create app directory
|
||||||
file:
|
file:
|
||||||
path: "{{ app_dir }}"
|
path: "{{ app_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Copy compose file
|
- name: Copy compose file
|
||||||
copy:
|
copy:
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ services:
|
|||||||
|
|
||||||
grafana:
|
grafana:
|
||||||
image: grafana/grafana:latest
|
image: grafana/grafana:latest
|
||||||
|
user: "472"
|
||||||
volumes:
|
volumes:
|
||||||
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
- ./grafana/provisioning:/etc/grafana/provisioning:ro
|
||||||
- grafana_data:/var/lib/grafana
|
- grafana_data:/var/lib/grafana
|
||||||
environment:
|
environment:
|
||||||
GF_SECURITY_ADMIN_PASSWORD: "admin"
|
GF_SECURITY_ADMIN_PASSWORD: "admin"
|
||||||
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/home.json
|
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,9 +2,9 @@
|
|||||||
apiVersion: 1
|
apiVersion: 1
|
||||||
|
|
||||||
providers:
|
providers:
|
||||||
- name: 'default'
|
- name: default
|
||||||
folder: 'Home'
|
orgId: 1
|
||||||
|
folder: ""
|
||||||
type: file
|
type: file
|
||||||
editable: true
|
|
||||||
options:
|
options:
|
||||||
path: /var/lib/grafana/dashboards
|
path: /etc/grafana/provisioning/dashboards
|
||||||
|
|||||||
Reference in New Issue
Block a user