stage('production'); localServer('server4') ->stage('production'); task('test:hello', function () { writeln('Hello world!'); }); task('test:onlyForStage', function () { writeln('You should only see this for production'); }) ->onlyForStage('production'); task('test', [ 'test:hello', 'test:onlyForStage' ]); task('test:hello', function () { runLocally('echo "hello"'); writeln('Hello world!'); })->once();