jfrog / artifactory-gradle-plugin

JFrog Gradle plugin for Build Info extraction and Artifactory publishing.
Apache License 2.0
20 stars 15 forks source link

Migrating from CLI to Gradle Plugin #103

Open Yay295 opened 6 months ago

Yay295 commented 6 months ago

How can we help?

I'm currently uploading an EAR file (after building it with Gradle) using the following commands:

SET APP_NAME=my-app

REM Set JFrog variables from Jenkins variables.
SET JFROG_CLI_BUILD_NAME=%JOB_NAME:/= :: %
SET JFROG_CLI_BUILD_NUMBER=%BUILD_NUMBER%
SET JFROG_CLI_BUILD_URL=%BUILD_URL%

jf config add artifactory --overwrite --url=https://artifactory.xxx.yyy --user="%ART_USER%" --password="%ART_PASS%"
jf rt upload ".gradle_build\distributions\*.ear" "zzz/yyy/xxx/zz/%APP_NAME%/%RELEASE%-SNAPSHOT/%APP_NAME%-%RELEASE%-SNAPSHOT.ear"
jf rt build-publish

I've been looking into using the Gradle plugin instead, but I'm not sure what all needs to be set. This is what I have right now:

artifactory {
    publish {
        contextUrl = 'https://artifactory.xxx.zzz'
        repository {
            username = System.getenv('ART_USER')
            password = System.getenv('ART_PASS')
        }
        buildInfo {
            buildName = System.getenv('JOB_NAME').replace('/',' :: ')
            buildNumber = System.getenv('BUILD_NUMBER')
            buildUrl = System.getenv('BUILD_URL' )
        }
    }
}

What am I missing to get the plugin configured to work the same as the CLI commands?