Skip to content

Commit 5d287c8

Browse files
authored
Merge pull request #9 from meleksabit/test
chore: [Test] Integrate All Feature Branches for v1.0.0 Platform Deployment
2 parents 3222d74 + 1aaadc1 commit 5d287c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+4416
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PR Title Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited]
6+
7+
jobs:
8+
lint-pr-title:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Check PR Title
16+
uses: actions/github-script@v7.0.1
17+
with:
18+
script: |
19+
const title = context.payload.pull_request.title;
20+
const regex = /^(feat|fix|chore|docs|style|refactor|perf|test|ci|build|deps|hotfix|env|security)(\([\w\-]+\))?: .+/;
21+
if (!regex.test(title)) {
22+
core.setFailed(`❌ Invalid PR title: "${title}".\n✅ Expected format: type(scope): description\nExamples:\n - feat(docker): preload Hugging Face models\n - fix(api): handle missing auth headers`);
23+
} else {
24+
console.log(`✅ PR title "${title}" is valid.`);
25+
}

.github/workflows/super-linter.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: Lint
3+
4+
on:
5+
push:
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
# ✅ Step 1: Run Super-Linter in check-only mode (does not fix issues)
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Run Super-Linter (Check Only)
22+
uses: super-linter/super-linter@v7.3.0
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
25+
VALIDATE_ALL_CODEBASE: true
26+
27+
# ✅ Step 2: Run Super-Linter in fix mode and commit changes
28+
fix-lint-issues:
29+
permissions:
30+
contents: write # Allows writing fixed files
31+
statuses: write # Allows updating PR status
32+
checks: write # Allows updating PR checks
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Run Super-Linter (Fix Mode)
41+
uses: super-linter/super-linter@v7.3.0
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
44+
# ✅ Enable auto-fix for Shell, Python, YAML, Markdown, and Terraform:
45+
FIX_SHELL_SHFMT: true
46+
FIX_YAML_PRETTIER: true
47+
FIX_PYTHON_BLACK: true
48+
FIX_PYTHON_ISORT: true
49+
FIX_PYTHON_PYINK: true
50+
FIX_MARKDOWN: true
51+
FIX_TERRAFORM_FMT: true
52+
53+
- name: Commit and push linting fixes
54+
if: github.event_name == 'pull_request' && github.ref_name != github.event.repository.default_branch
55+
uses: stefanzweifel/git-auto-commit-action@v5
56+
with:
57+
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
58+
commit_message: "chore: fix linting issues"
59+
commit_user_name: super-linter
60+
commit_user_email: super-linter@super-linter.dev

.gitignore

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# General
2+
*.log
3+
*.tmp
4+
*.bak
5+
*.swp
6+
*.DS_Store
7+
Thumbs.db
8+
9+
# Python
10+
__pycache__/
11+
*.py[cod]
12+
*.pyo
13+
*.pyd
14+
.Python
15+
env/
16+
venv/
17+
ENV/
18+
*.env
19+
*.venv
20+
*.egg-info/
21+
.eggs/
22+
dist/
23+
build/
24+
pip-log.txt
25+
pip-delete-this-directory.txt
26+
27+
# Hugging Face / TensorFlow / PyTorch (AI models and cache)
28+
*.ckpt
29+
*.pt
30+
*.pth
31+
*.h5
32+
*.onnx
33+
output/
34+
logs/
35+
lightning_logs/
36+
cache/
37+
model_cache/
38+
.tokenizers_cache/
39+
.transformers_cache/
40+
__pycache__/
41+
42+
# Go
43+
*.exe
44+
*.out
45+
*.test
46+
vendor/
47+
*.mod
48+
*.sum
49+
50+
# Terraform
51+
secrets.tf
52+
secrets.tfvars
53+
.terraform/
54+
*.tfstate
55+
*.tfstate.*
56+
crash.log
57+
override.tf
58+
override.tf.json
59+
*.tfvars
60+
*.tfvars.json
61+
.terraform.lock.hcl
62+
63+
# Docker
64+
*.env
65+
.env.local
66+
.dockerignore
67+
docker-compose.override.yml
68+
tag.txt
69+
# Ignore local Docker configuration files
70+
.docker/
71+
72+
# Kubernetes
73+
*.yml~
74+
.kube/
75+
*.crt
76+
*.key
77+
78+
# AWS
79+
.aws/
80+
.terraform/
81+
*.pem
82+
*.key
83+
*.config
84+
85+
# Helm / Kustomize
86+
.kube/
87+
*.release.yaml
88+
89+
# Secrets
90+
secrets/
91+
*.secret
92+
*.key
93+
*.cert
94+
*.pfx
95+
*.pem
96+
*.json
97+
98+
# Node.js (if used for any UI dashboard)
99+
node_modules/
100+
npm-debug.log*
101+
yarn-debug.log*
102+
yarn-error.log*
103+
104+
# JetBrains IDEs
105+
.idea/
106+
*.iml
107+
*.iws
108+
out/
109+
110+
# VS Code
111+
.vscode/
112+
.history/
113+
114+
# Operating System Files
115+
.DS_Store
116+
Thumbs.db
117+
118+
# Miscellaneous
119+
*.sqlite3
120+
*.db
121+
*.sql
122+
*.tar
123+
*.zip
124+
*.gz
125+
*.7z
126+
*.rar
127+
*.bak
128+
129+
# Logs
130+
logs/
131+
*.log
132+
*.log.*
133+
nohup.out
134+
135+
# Artifacts
136+
*.artifact.zip
137+
*.whl
138+
139+
# Trivy Cache
140+
.trivy-cache/
141+
.trivyignore

.terraformignore

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Terraform state and backup files
2+
*.tfstate
3+
*.tfstate.backup
4+
*.tfplan
5+
6+
# Terraform internal directories
7+
.terraform/
8+
9+
# Logs and debug artifacts
10+
*.log
11+
crash.log
12+
*.out
13+
*.err
14+
15+
# AWS credentials and sensitive files
16+
.aws/
17+
*.pem
18+
*.key
19+
*.crt
20+
*.env
21+
.env.*
22+
credentials.json
23+
secrets/
24+
**/credentials.tfvars
25+
26+
# Python artifacts
27+
__pycache__/
28+
*.pyc
29+
*.pyo
30+
*.pyd
31+
*.egg-info/
32+
*.dist-info/
33+
*.ipynb_checkpoints/
34+
*.sqlite3
35+
*.db
36+
.venv/
37+
venv/
38+
env/
39+
40+
# Docker build cache and local overrides
41+
Dockerfile.*
42+
docker-compose.override.yml
43+
*.tar
44+
*.img
45+
46+
# Node-related (if present)
47+
node_modules/
48+
npm-debug.log
49+
yarn-error.log
50+
51+
# Editor/OS/CI-related
52+
.idea/
53+
.vscode/
54+
*.swp
55+
*.swo
56+
*.bak
57+
*.tmp
58+
.DS_Store
59+
Thumbs.db
60+
61+
# Git
62+
.git/
63+
.gitignore
64+
.gitattributes
65+
66+
# Tests & coverage (optional)
67+
coverage/
68+
tests/__pycache__/
69+
test-results/
70+
71+
# Model cache (if using Hugging Face Transformers)
72+
model_cache/
73+
transformers_cache/
74+
huggingface/

Jenkinsfile

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
pipeline {
2+
agent any
3+
environment {
4+
ECR_REGISTRY = credentials('ecr-registry-uri')
5+
AWS_REGION = 'eu-central-1'
6+
DOCKER_TAG = 'latest'
7+
}
8+
stages {
9+
stage('Build and Push ai-agent') {
10+
agent { docker { image 'docker:24-dind'; args '--privileged'; reuseNode true } }
11+
when { changeset "ai-agent/**" }
12+
steps {
13+
withAWS(credentials: 'aws-credentials', region: "${AWS_REGION}") {
14+
sh 'aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${ECR_REGISTRY}'
15+
sh 'docker build -t ${ECR_REGISTRY}/ai-agent:${DOCKER_TAG} ./ai-agent'
16+
sh 'docker push ${ECR_REGISTRY}/ai-agent:${DOCKER_TAG}'
17+
}
18+
}
19+
}
20+
stage('Build and Push Go Microservices') {
21+
agent { docker { image 'docker:24-dind'; args '--privileged'; reuseNode true } }
22+
when { anyOf { changeset "go-services/blockchain-monitor/**"; changeset "go-services/anomaly-detector/**"; changeset "go-services/dashboard/**" } }
23+
steps {
24+
withAWS(credentials: 'aws-credentials', region: "${AWS_REGION}") {
25+
sh 'aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${ECR_REGISTRY}'
26+
script {
27+
def services = ['blockchain-monitor', 'anomaly-detector', 'dashboard']
28+
services.each { svc ->
29+
sh "docker build -t ${ECR_REGISTRY}/${svc}:${DOCKER_TAG} ./go-services/${svc}"
30+
sh "docker push ${ECR_REGISTRY}/${svc}:${DOCKER_TAG}"
31+
}
32+
}
33+
}
34+
}
35+
}
36+
stage('Deploy to EKS') {
37+
steps {
38+
withAWS(credentials: 'aws-credentials', region: "${AWS_REGION}") {
39+
sh 'helm upgrade --install ai-agent ./helm/ai-agent --namespace default --set image.repository=${ECR_REGISTRY}/ai-agent'
40+
sh 'helm upgrade --install blockchain-monitor ./helm/go-microservices/blockchain-monitor --namespace default --set image.repository=${ECR_REGISTRY}/blockchain-monitor'
41+
sh 'helm upgrade --install anomaly-detector ./helm/go-microservices/anomaly-detector --namespace default --set image.repository=${ECR_REGISTRY}/anomaly-detector'
42+
sh 'helm upgrade --install dashboard ./helm/go-microservices/dashboard --namespace default --set image.repository=${ECR_REGISTRY}/dashboard'
43+
}
44+
}
45+
}
46+
}
47+
post {
48+
always { sh 'echo "Pipeline complete!"' }
49+
failure { echo 'Build failed!' }
50+
}
51+
}

0 commit comments

Comments
 (0)