Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
23815b5
feat(compose): comelete compose prompt
abolfazl8131 Dec 3, 2024
7c593ab
fix(kuber): remove lb
abolfazl8131 Dec 3, 2024
91a80bd
feat(compose): compelete compose prompt
abolfazl8131 Dec 3, 2024
385ae2e
Merge remote-tracking branch 'origin/master'
abolfazl8131 Dec 3, 2024
72814e8
nothing
abolfazl8131 Dec 3, 2024
5c60edc
fix(compose): edit some related fields to compose
abolfazl8131 Dec 4, 2024
67e63bb
fix(compose): totally restructre docker compose generator
abolfazl8131 Dec 4, 2024
c61adb3
fix(compose): directory builder
abolfazl8131 Dec 4, 2024
7db40d2
fix(compose): compelete compose generation allgorithm
abolfazl8131 Dec 5, 2024
b9e4ed1
fix(compose): edit default values for documentation
abolfazl8131 Dec 5, 2024
41c6fde
feat(compose): add union type input for networks
abolfazl8131 Dec 5, 2024
e4f7117
fix(routes): add /api to all routes
abolfazl8131 Dec 6, 2024
a7c126b
Merge branch 'master' into master
abolfazl8131 Dec 6, 2024
161f712
Merge branch 'devopshobbies:master' into master
abolfazl8131 Dec 7, 2024
fd2efe7
fix(installation): fix terraform installation process and model
abolfazl8131 Dec 8, 2024
bfd5ce6
Merge branch 'devopshobbies:master' into master
abolfazl8131 Dec 8, 2024
c7eb0a9
Merge branch 'master' of github.com:abolfazl8131/devops-gpt
abolfazl8131 Dec 8, 2024
26c3bd8
fix(installation): create MyBash for scripts
abolfazl8131 Dec 8, 2024
90bece3
fix(bash): edit bi/bash
abolfazl8131 Dec 8, 2024
54d507f
fix(docker install): fix it
abolfazl8131 Dec 8, 2024
95e8dda
Merge branch 'master' of github.com:devopshobbies/devops-gpt
abolfazl8131 Dec 8, 2024
3dcf0ee
feat(install): add jenkins and gitlab installation
abolfazl8131 Dec 9, 2024
705a61b
Merge branch 'devopshobbies:master' into master
abolfazl8131 Dec 9, 2024
7cbfb64
Merge branch 'master' of github.com:devopshobbies/devops-gpt
abolfazl8131 Dec 9, 2024
fddb77c
Update unit-test.yml
abolfazl8131 Dec 9, 2024
818d508
Merge branch 'devopshobbies:master' into master
abolfazl8131 Dec 9, 2024
192d0a7
Merge branch 'master' of github.com:devopshobbies/devops-gpt
abolfazl8131 Dec 9, 2024
fc7addc
Merge branch 'master' of github.com:devopshobbies/devops-gpt
abolfazl8131 Dec 10, 2024
55deb59
fix(install): fix jenkins and gitlab
abolfazl8131 Dec 10, 2024
5aa2a2a
Merge branch 'devopshobbies:master' into master
abolfazl8131 Dec 10, 2024
43676b8
Merge branch 'master' of github.com:abolfazl8131/devops-gpt
abolfazl8131 Dec 10, 2024
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
4 changes: 3 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
from app.routes.helm import *
from app.routes.ansible import *
from app.routes.jcasc import *
from app.routes.docker import *
from app.routes.docker import *
from app.routes.jenkins import *
from app.routes.gitlab import *
19 changes: 19 additions & 0 deletions app/media/Installation_base/Docker/RHEL.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

sudo dnf remove -y \
docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine \
podman \
runc


sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo

sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
16 changes: 16 additions & 0 deletions app/media/Installation_base/Docker/centos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
sudo dnf remove -y \
docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine


sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
19 changes: 19 additions & 0 deletions app/media/Installation_base/Docker/fedora.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
sudo dnf remove -y \
docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine


sudo dnf -y install dnf-plugins-core
sudo dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo


sudo dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
16 changes: 16 additions & 0 deletions app/media/Installation_base/Docker/ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
sudo apt-get update -y
sudo apt-get install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y


sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
31 changes: 31 additions & 0 deletions app/media/Installation_base/Gitlab/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# sudo mkdir -p /srv/gitlab
# export GITLAB_HOME=/srv/gitlab

version: '3.6'
services:
gitlab:
image: gitlab/gitlab-ce:<version>-ce.0
container_name: gitlab
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
# Add any other gitlab.rb configuration here, each on its own line
external_url 'https://gitlab.example.com'

# you can also use custom HTTP and SSH port. if you you want to do that, follow the below syntax

# external_url 'http://gitlab.example.com:8929'
# gitlab_rails['gitlab_shell_ssh_port'] = 2424

ports:
# - '8929:8929' # Custom HTTP Port
# - '2424:22' # Custom SSH Port
- '80:80'
- '443:443'
- '22:22'
volumes:
- '$GITLAB_HOME/config:/etc/gitlab'
- '$GITLAB_HOME/logs:/var/log/gitlab'
- '$GITLAB_HOME/data:/var/opt/gitlab'
shm_size: '256m'
10 changes: 10 additions & 0 deletions app/media/Installation_base/Jenkins/RHEL.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
sudo yum upgrade -y
# Add required dependencies for the jenkins package
sudo yum install -y fontconfig java-17-openjdk
sudo yum install -y jenkins
sudo systemctl daemon-reload
sudo systemctl enable --now jenkins
15 changes: 15 additions & 0 deletions app/media/Installation_base/Jenkins/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3.8'
services:
jenkins:
image: jenkins/jenkins:lts
privileged: true
user: root
ports:
- 8080:8080
- 50000:50000
container_name: jenkins
volumes:
- /home/${myname}/jenkins_compose/jenkins_configuration:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock

# Replace "/home/${myname}/jenkins_compose/jenkins_configuration" with the path you want to use to store your jenkins data
10 changes: 10 additions & 0 deletions app/media/Installation_base/Jenkins/fedora.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
sudo dnf upgrade -y
# Add required dependencies for the jenkins package
sudo dnf install -y fontconfig java-17-openjdk
sudo dnf install -y jenkins
sudo systemctl daemon-reload
sudo systemctl enable --now jenkins
13 changes: 13 additions & 0 deletions app/media/Installation_base/Jenkins/ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
sudo apt update -y
sudo apt install -y fontconfig openjdk-17-jre


sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update -y
sudo apt-get install -y jenkins
sudo systemctl enable --now jenkins
8 changes: 8 additions & 0 deletions app/media/Installation_base/Terraform/amazon_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash


sudo yum install -y yum-utils

sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo

sudo yum -y install terraform
8 changes: 8 additions & 0 deletions app/media/Installation_base/Terraform/centos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash


sudo yum install -y yum-utils

sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

sudo yum -y install terraform
8 changes: 8 additions & 0 deletions app/media/Installation_base/Terraform/fedora.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash


sudo dnf install -y dnf-plugins-core

sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo

sudo dnf -y install terraform
15 changes: 15 additions & 0 deletions app/media/Installation_base/Terraform/ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

sudo apt-get update && sudo apt-get install -y gnupg software-properties-common

wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null

echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/hashicorp.list

sudo apt update

sudo apt-get install terraform
12 changes: 12 additions & 0 deletions app/media/MyBash/bash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sudo apt update -y
sudo apt install -y fontconfig openjdk-17-jre


sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update -y
sudo apt-get install -y jenkins
sudo systemctl enable --now jenkins
31 changes: 31 additions & 0 deletions app/media/MyCompose/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# sudo mkdir -p /srv/gitlab
# export GITLAB_HOME=/srv/gitlab

version: '3.6'
services:
gitlab:
image: gitlab/gitlab-ee:<version>-ee.0
container_name: gitlab
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
# Add any other gitlab.rb configuration here, each on its own line
external_url 'https://gitlab.example.com'

# you can also use custom HTTP and SSH port. if you you want to do that, follow the below syntax

# external_url 'http://gitlab.example.com:8929'
# gitlab_rails['gitlab_shell_ssh_port'] = 2424

ports:
# - '8929:8929' # Custom HTTP Port
# - '2424:22' # Custom SSH Port
- '80:80'
- '443:443'
- '22:22'
volumes:
- '$GITLAB_HOME/config:/etc/gitlab'
- '$GITLAB_HOME/logs:/var/log/gitlab'
- '$GITLAB_HOME/data:/var/opt/gitlab'
shm_size: '256m'
Binary file removed app/media/MyCompose_zip.zip
Binary file not shown.
5 changes: 4 additions & 1 deletion app/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
from .utils import *
from .ansible_models import *
from .jcasc import *
from .compose_models import *
from .compose_models import *
from .docker_installation_models import *
from .jenkins import *
from .gitlab_models import *
1 change: 0 additions & 1 deletion app/models/compose_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ class DockerCompose(BaseModel):
version: str = "3"
services: Dict[str, Service] = {"web":Service(), "web2":Service()}
networks: Union[Optional[Dict[str, PreCreatedNetwork]],Optional[Dict[str, Network]]] = {"app_network": {"driver":"bridge"}}

20 changes: 20 additions & 0 deletions app/models/docker_installation_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from typing import Dict, List, Optional,Union
from pydantic import BaseModel, model_validator,validator

class DockerInstallationInput(BaseModel):
os:str = "Ubuntu"
environment:str = "Linux"

@validator("os")
def validate_os(cls, value):
allowed_os = ['Ubuntu', 'Centos', 'Fedora', 'RHEL']
if value not in allowed_os:
raise ValueError(f"OS must be one of {allowed_os}.")
return value

@validator("environment")
def validate_environment(cls, value):
allowed_os = ['Linux']
if value not in allowed_os:
raise ValueError(f"Environment must be one of {allowed_os}.")
return value
17 changes: 17 additions & 0 deletions app/models/gitlab_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from typing import List, Optional
from pydantic import BaseModel, validator, ValidationError



class GitLabInstallation(BaseModel):


environment:str = 'Docker'


@validator("environment")
def validator_environment(cls, value):
env = ['Docker']
if value not in env:
raise ValueError(f"your selected Environemnt must be in {env}")
return value
24 changes: 24 additions & 0 deletions app/models/jenkins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from typing import List, Optional
from pydantic import BaseModel, validator, ValidationError



class JenkinsInstallation(BaseModel):

os: str = 'Ubuntu'

environment:str = 'Linux'

@validator("os")
def validator_os(cls, value):
valid_oss = ['Ubuntu','Fedora','RHEL']
if value not in valid_oss:
raise ValueError(f"your selected OS must be in {valid_oss}")
return value

@validator("environment")
def validator_environment(cls, value):
env = ['Linux','Docker']
if value not in env:
raise ValueError(f"your selected Environemnt must be in {env}")
return value
22 changes: 11 additions & 11 deletions app/models/terraform_models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from pydantic import BaseModel, validator, ValidationError
from typing import List, Optional

from .utils import BasicInput


Expand Down Expand Up @@ -46,22 +45,23 @@ def validate_service(cls, value):
return value

class IaCInstallationInput(BaseModel):
os:str = "ubuntu"
service:Optional[str] = 'terraform'

os:str = "Ubuntu"
environment:str = "Linux"
@validator("os")
def validate_os(cls, value):
allowed_os = ['ubuntu', 'centos', 'debian']
allowed_os = ['Ubuntu', 'Centos', 'Fedora', 'Amazon_linux']
if value not in allowed_os:
raise ValueError(f"OS must be one of {allowed_os}.")
return value

@validator("service")
def validate_service(cls, value):
allowed_services = ['terraform']
if value not in allowed_services:
raise ValueError(f"Service must be one of {allowed_services}.")
@validator("environment")
def validate_environment(cls, value):
allowed_os = ['Linux']
if value not in allowed_os:
raise ValueError(f"Environment must be one of {allowed_os}.")
return value


class IaCTemplateGenerationDocker(BaseModel):
docker_image: bool = True
Expand Down
Loading
Loading