Groovy web console

subscribe to the feed Subscribe
to this
site

test

Published 1 month ago by Koss
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class PushImagesStage {
    void run(
            Map optionalData = [
                pushCron:false
                ],
            context,
            String dockerHubConf,
            String serviceName,
            String branch,
            boolean pushApi,
            boolean pushWorker
        ) {

        if (pushApi) {
            println 1;
        }

        if (pushWorker) {
            println 2;
        }

        if (optionalData.pushCron) {
            println 3;
        }
    }
}

(new PushImagesStage()).run(this, 'asdf', 'a1', 'a2', true, true);
println '-------------'
(new PushImagesStage()).run(this, 'asdf', 'a1', 'a2', true, false);
println '-------------'
(new PushImagesStage()).run([pushCron: false], this, 'asdf', 'a1', 'a2', true, false);
println '-------------'
(new PushImagesStage()).run([pushCron: true], this, 'asdf', 'a1', 'a2', true, false);