Skip to content

Commit

Permalink
#263 Execute user scripts before seed jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
tumevoiz committed Apr 23, 2020
1 parent 9715217 commit e0ec43f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pkg/controller/jenkins/configuration/user/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@ func New(configuration configuration.Configuration, jenkinsClient jenkinsclient.
func (r *ReconcileUserConfiguration) Reconcile() (reconcile.Result, error) {
backupAndRestore := backuprestore.New(r.Configuration, r.logger)

result, err := r.ensureSeedJobs()
result, err := r.ensureUserConfiguration(r.jenkinsClient)
if err != nil {
return reconcile.Result{}, err
}
if result.Requeue {
return result, nil
}

if err := backupAndRestore.Restore(r.jenkinsClient); err != nil {
return reconcile.Result{}, err
}

result, err = r.ensureUserConfiguration(r.jenkinsClient)
result, err = r.ensureSeedJobs()
if err != nil {
return reconcile.Result{}, err
}
if result.Requeue {
return result, nil
}

if err := backupAndRestore.Restore(r.jenkinsClient); err != nil {
return reconcile.Result{}, err
}

if err := backupAndRestore.Backup(); err != nil {
return reconcile.Result{}, err
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/restorebackup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func waitForJob(t *testing.T, jenkinsClient client.Jenkins, jobID string) {
err := try.Until(func() (end bool, err error) {
_, err = jenkinsClient.GetJob(jobID)
return err == nil, err
}, time.Second*2, time.Minute*2)
}, time.Second*2, time.Minute*3)
require.NoErrorf(t, err, "Jenkins job '%s' not created by seed job", jobID)
}

Expand Down

0 comments on commit e0ec43f

Please sign in to comment.