Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeptossss committed Nov 24, 2023
1 parent 01a34a7 commit 882c0d2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea
value.yaml
15 changes: 2 additions & 13 deletions helm/whanos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,20 @@ jenkins:
- script: |
import java.io.File
def cloneRepoAndGetImagesDir() {
def cloneRepo() {
def workspace = new File('/tmp/whanos_repo')
def cloneCommand = "git clone https://github.com/Tux-Inc/Whanos.git /tmp/whanos_repo"
def process = cloneCommand.execute()
process.waitFor()
if (process.exitValue() != 0) {
println "Error cloning repository: " + process.err.text
return null
}
return new File(workspace, "images")
}
def imagesDir = cloneRepoAndGetImagesDir()
def languages = []
cloneRepo()
if (imagesDir.exists() && imagesDir.isDirectory()) {
def directories = imagesDir.listFiles().findAll { it.isDirectory() }
languages = directories.collect { it.name }
println "Available languages: " + languages
} else {
println "Images directory not found or is not a directory, no languages available"
}
- file: /tmp/whanos_repo/jenkins/job_dsl.groovy
agent:
Expand Down
29 changes: 29 additions & 0 deletions jenkins/job_dsl.groovy
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
import java.io.File

println "Creating Jenkins jobs..."

def cloneRepo() {
def workspace = new File('/tmp/whanos_repo')
def cloneCommand = "git clone https://github.com/Tux-Inc/Whanos.git /tmp/whanos_repo"
def process = cloneCommand.execute()
process.waitFor()
if (process.exitValue() != 0) {
println "Error cloning repository: " + process.err.text
return null
}
return new File(workspace, "images")
}

def imagesDir = cloneRepo()
println "Images directory: " + imagesDir

def languages = []

if (imagesDir.exists() && imagesDir.isDirectory()) {
def directories = imagesDir.listFiles().findAll { it.isDirectory() }
languages = directories.collect { it.name }
println "Available languages: " + languages
} else {
println "Images directory not found or is not a directory, no languages available"
}

folder("Whanos base images") {
description("Whanos base images folder")
}
Expand Down

0 comments on commit 882c0d2

Please sign in to comment.