Add custom location for jobs and fix exec of jobs
Gitea/ncDocConverter/pipeline/head This commit looks good
Details
Gitea/ncDocConverter/pipeline/head This commit looks good
Details
parent
65cfa0ec64
commit
3ce008c97e
|
@ -34,5 +34,5 @@ go.work
|
|||
# Build binaries
|
||||
/ncDocConverth-*
|
||||
|
||||
# Note folder
|
||||
# Space for private notes
|
||||
/notes
|
|
@ -27,9 +27,10 @@ pipeline {
|
|||
}
|
||||
|
||||
stage('Deploy') {
|
||||
when {
|
||||
buildingTag()
|
||||
}
|
||||
// Tags not working with gitea?
|
||||
//when {
|
||||
// buildingTag()
|
||||
//}
|
||||
|
||||
steps {
|
||||
script {
|
||||
|
|
|
@ -53,13 +53,14 @@ func main() {
|
|||
WriteTimeout: 10 * time.Second,
|
||||
}
|
||||
|
||||
ncConvertUsers, err := models.ParseConvertUsers("./ncConverter.json")
|
||||
ncConvertUsers, err := models.ParseConvertUsers(webApp.config.Server.JobFile)
|
||||
if err != nil {
|
||||
logger.Error("Unable to parse the file %s: %s", "dd", err)
|
||||
}
|
||||
ncworker.NewScheduler(ncConvertUsers, config)
|
||||
|
||||
if 1 == 1 {
|
||||
// Webserver for BookStack hooks currently not implemented
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,9 @@ server:
|
|||
# Afterward the program does exit -> The "execution" field in the jobs are going to be ignored
|
||||
oneShot: false
|
||||
|
||||
# Location of the file with the job configurations
|
||||
JobFile: "./ncConverter.json"
|
||||
|
||||
logging:
|
||||
# Minimum log Level for printing to the console (debug, info, warning, error, fatal)
|
||||
printLogLevel: info
|
||||
|
|
|
@ -18,6 +18,7 @@ type Server struct {
|
|||
Address string `yaml:"address"`
|
||||
Certificate string `yaml:"certificate"`
|
||||
OneShot bool `yaml:"oneShot"`
|
||||
JobFile string `yaml:"JobFile"`
|
||||
Version string
|
||||
}
|
||||
|
||||
|
@ -49,6 +50,7 @@ func getDefaultConfig() *WebConfig {
|
|||
return &WebConfig{
|
||||
Server: Server{
|
||||
Address: ":4000",
|
||||
JobFile: "./ncConverter.json",
|
||||
},
|
||||
Logging: Logging{
|
||||
PrintLogLevel: "info",
|
||||
|
|
|
@ -87,7 +87,7 @@ func (s NcConvertScheduler) ScheduleExecutions() {
|
|||
|
||||
// Schedule Nextcloud jobs
|
||||
for i, job := range user.ConvertJobs {
|
||||
convJob := NewNcJob(&s.users.Users[ui].ConvertJobs[i], &s.users.Users[i])
|
||||
convJob := NewNcJob(&s.users.Users[ui].ConvertJobs[i], &s.users.Users[ui])
|
||||
|
||||
_, err := s.scheduler.Cron(job.Execution).DoWithJobDetails(s.executeJob, convJob)
|
||||
if err != nil {
|
||||
|
@ -98,7 +98,7 @@ func (s NcConvertScheduler) ScheduleExecutions() {
|
|||
// Schedule boockstack jobs
|
||||
if user.BookStack.URL != "" {
|
||||
for i, job := range user.BookStack.Jobs {
|
||||
bsJob := NewBsJob(&s.users.Users[ui].BookStack.Jobs[i], &s.users.Users[i])
|
||||
bsJob := NewBsJob(&s.users.Users[ui].BookStack.Jobs[i], &s.users.Users[ui])
|
||||
|
||||
_, err := s.scheduler.Cron(job.Execution).DoWithJobDetails(s.executeJob, bsJob)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue