Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jcasc #124

Closed
wants to merge 2 commits into from
Closed

Jcasc #124

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