Skip to content
Closed

Jcasc #125

Show file tree
Hide file tree
Changes from all commits
Commits
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
61 changes: 61 additions & 0 deletions app/directory_generators/jcasc_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import os
project_name = "app/media/MyJcasc"
jcasc_dir = os.path.join(project_name, "jcasc")

# Create project directories
os.makedirs(jcasc_dir, exist_ok=True)

# Define the JCasc content
jcasc_content = """
jenkins:
numExecutors: 1
scmCheckoutRetryCount: 2
mode: NORMAL
markupFormatter:
rawHtml:
disableSyntaxHighlighting: false
primaryView:
all:
name: "all"
crumbIssuer:
standard:
excludeClientIPFromCrumb: true
credentials:
system:
domainCredentials:
- credentials:
- string:
scope: GLOBAL
id: "gitlab-token"
secret: "SECRET KEY"
description: "GitLab personal access token"
unclassified:
location:
url: "http://localhost:8080/"
security:
globalJobDslSecurityConfiguration:
useScriptSecurity: false
jobs:
- script: >
pipelineJob('DSL Job') {
quietPeriod(0)
properties {
disableConcurrentBuilds()
}
logRotator {
numToKeep(10)
}
triggers {
cron("H/15 * * * *")
}
definition {
cps {
script('createJobs()')
}
}
}
"""

# Write the JCasc content to a file
with open(os.path.join(jcasc_dir, "jcasc.yaml"), "w") as f:
f.write(jcasc_content.strip())
Loading
Loading