[JIRA] (JENKINS-61665) withAnt - automatically use correct shell

2 views
Skip to first unread message

stefan.drissen@gmail.com (JIRA)

unread,
Mar 24, 2020, 9:33:02 AM3/24/20
to jenkinsc...@googlegroups.com
Stefan Drissen created an issue
 
Jenkins / Improvement JENKINS-61665
withAnt - automatically use correct shell
Issue Type: Improvement Improvement
Assignee: Francisco Fernández
Components: ant-plugin, pipeline
Created: 2020-03-24 13:32
Environment: Jenkins 2.226
Priority: Major Major
Reporter: Stefan Drissen

The declarative pipeline offers the withAnt build step. Unfortunately this only sets up the Ant environment and then uses a shell (bat / sh) to execute Ant within that environment.

While the work-around as documented on https://plugins.jenkins.io/ant/ works:

withAnt(installation: 'myinstall') {
    dir("scoring") {
    if (isUnix()) {
      sh "ant mytarget"
    } else {
      bat "ant mytarget"
    }
}

Needing to detect the operating system for a tool that works on all operating systems is plain clunky and immediately raises the difficulty bar when migrating from freestyle jobs. Freestyle jobs allow you to simply use Ant without you having to worry about which operating system is being used.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

fjfernandez@cloudbees.com (JIRA)

unread,
Mar 25, 2020, 3:41:02 AM3/25/20
to jenkinsc...@googlegroups.com
Francisco Fernández assigned an issue to Unassigned
Change By: Francisco Fernández
Assignee: Francisco Fernández
Reply all
Reply to author
Forward
0 new messages