forked from devopshobbies/devops-gpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'devopshobbies:master' into master
- Loading branch information
Showing
18 changed files
with
315 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from app.routes.utils import * | ||
from app.routes.terraform import * | ||
from app.routes.helm import * | ||
from app.routes.ansible import * | ||
from app.routes.ansible import * | ||
from app.routes.jcasc import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{/* | ||
Common template helpers | ||
*/}} | ||
{{- define "my-helm.fullname" -}} | ||
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: web-ingress | ||
spec: | ||
rules: | ||
- host: 123.com | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: web | ||
port: | ||
number: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
resource "argocd_repository" "repository" { | ||
count = var.repository_create ? 1 : 0 | ||
repo = var.argocd_repository_info["repo"] | ||
username = var.argocd_repository_info["username"] | ||
password = var.argocd_repository_info["password"] | ||
} | ||
|
||
resource "argocd_application" "application" { | ||
count = var.application_create ? 1 : 0 | ||
|
||
depends_on = [] | ||
|
||
metadata { | ||
name = var.argocd_application["name"] | ||
namespace = "argocd" | ||
labels = { | ||
using_sync_policy_options = "true" | ||
} | ||
} | ||
|
||
spec { | ||
destination { | ||
server = var.argocd_application["destination_server"] | ||
namespace = var.argocd_application["destination_namespace"] | ||
} | ||
|
||
source { | ||
repo_url = var.argocd_application["source_repo_url"] | ||
path = var.argocd_application["source_path"] | ||
target_revision = var.argocd_application["source_target_revision"] | ||
} | ||
|
||
sync_policy { | ||
automated { | ||
prune = false | ||
self_heal = true | ||
} | ||
sync_options = var.argocd_sync_options | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
repository_create = false | ||
argocd_repository_info = { | ||
repo = "https://YOUR_REPO.git" | ||
username = "USERNAME" | ||
password = "CHANGE_ME_WITH_TOKEN" | ||
} | ||
|
||
application_create = true | ||
argocd_application = { | ||
name = "APPLICATION_NAME" | ||
destination_server = "https://kubernetes.default.svc" | ||
destination_namespace = "DESTINATION_NAMESPACE" | ||
source_repo_url = "https://YOUR_REPO.git" | ||
source_path = "SOURCE_PATH" | ||
source_target_revision = "SOURCE_TARGET_REVISION" | ||
} | ||
|
||
argocd_sync_options = ["CreateNamespace=true", "ApplyOutOfSyncOnly=true", "FailOnSharedResource=true"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
variable "repository_create" { | ||
type = bool | ||
} | ||
|
||
variable "argocd_repository_info" { | ||
type = map(string) | ||
} | ||
|
||
variable "application_create" { | ||
type = bool | ||
} | ||
|
||
variable "argocd_application" { | ||
type = map(string) | ||
} | ||
|
||
variable "argocd_sync_options" { | ||
type = list(string) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
terraform { | ||
required_version = ">= 1.0" | ||
|
||
required_providers { | ||
argocd = { | ||
source = "oboukili/argocd" | ||
version = ">= 6.0.2" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from .helm_models import * | ||
from .terraform_models import * | ||
from .utils import * | ||
from .ansible_models import * | ||
from .ansible_models import * | ||
from .jcasc import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from pydantic import BaseModel | ||
from typing import List, Optional | ||
|
||
|
||
class Jcasc(BaseModel): | ||
allowsSignup:bool = True | ||
allowAnonymousRead:bool = True | ||
cache_size:int = 1 | ||
executators:int = 1 | ||
required_plugins:List[str] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from app.app_instance import app | ||
from app.gpt_services import gpt_service | ||
from app.services import (write_installation,edit_directory_generator,execute_pythonfile) | ||
from app.models import (Jcasc,Output) | ||
from app.template_generators.jenkins.jcasc import jcasc_template_generator | ||
import os | ||
|
||
@app.post("/jcasc-template/") | ||
async def jcasc_template_generation(request:Jcasc) -> Output: | ||
if os.environ.get("TEST"): | ||
return Output(output='output') | ||
generated_prompt = jcasc_template_generator(request) | ||
output = gpt_service(generated_prompt) | ||
edit_directory_generator("jcasc_generator",output) | ||
execute_pythonfile("MyJcasc","jcasc_generator") | ||
return Output(output='output') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
def jcasc_template_generator(input): | ||
prompt = """M""" | ||
return prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.