A Spring Boot application for distributing build artifacts to public repositories.
The Concourse Release Scripts application can be included in Concourse container build images to distribute build artifacts to public repositories.
This is a command line application and it should be used as such in build scripts.
To configure the app, add an application.yml file in the same folder or in ./config.
For more on that, see the Spring Boot reference documentation. The available configuration options are described in the Configuration Properties section.
java -jar ./concourse-release-scripts.jar $COMMAND [$ARG...]To interact with Artifactory repositories in Concourse, usage of the Concourse Artifactory Resource is recommended.
This application interacts with Artifactory and Maven Central. The corresponding credentials must be provided using configuration properties:
artifactory:
username: # Artifactory credentials, username
password: # Artifactory credentials, password
# server property is currently locked on https://repo.spring.iosonatype:
username: # Sonatype user name.
password: # Sonatype password.
url: # URL of the Nexus instance used to publish releases.
staging_profile: # Name of the staging profile used to publish releases. Usually the top-level group id, e.g. "org.springframework"
staging_profile_id: # ID of the staging profile used to publish releases. Deprecated, use staging_profile insteadsdkman:
consumer-key: # SDKMAN! Consumer Key
consumer-token: # SDKMAN! Consumer Token
candidate: # SDKMAN! candidate name
artifact: # group:artifact:version[:packaging[:classifier]] coordinates with version ignored, e.g. "org.springframework.boot:spring-boot-cli:*:zip:bin"The Concourse Release Scripts application supports several commands:
-
publishToCentral, to publish artifacts to Maven Central. -
promote, to move the build artifacts to a target repository in Artifactory. -
publishToSdkMan, to publish the Spring Boot CLI to SDKMAN!.
java -jar /spring-boot-release-scripts.jar $COMMAND $RELEASE_TYPE $BUILD_INFO_LOCATIONWhere:
-
$COMMANDis the command name:promote,distribute,publishGradlePluginorsyncToMavenCentral -
$RELEASE_TYPEis the type of release:"M"(milestones),"RC"(release candidates) or"RELEASE" -
$BUILD_INFO_LOCATIONshould point to the absolute location of the artifactory build file info (e.g./local-repository/build-info.json)
Command used to publish artifacts to Maven Central using the OSS Sonatype instance.
The release is published by creating a staging repository and deploying to it the artifacts at the given $ARTIFACTS_LOCATION.
The repository is then closed and, upon successful closure, it is released.
java -jar /spring-boot-release-scripts.jar publishToMavenCentral $RELEASE_TYPE $BUILD_INFO_LOCATION $ARTIFACTS_LOCATIONWhere:
-
$RELEASE_TYPEis the type of release:"M"(milestones),"RC"(release candidates) or"RELEASE" -
$BUILD_INFO_LOCATIONshould point to the absolute location of the artifactory build file info (e.g./local-repository/build-info.json) -
$ARTIFACTS_LOCATIONthe location of the local artifact repository (e.g.local-repository)
There are additional configuration properties available for tuning the publishing process:
sonatype:
polling_interval: 15s # Time between requests made to determine if the closing of a staging repository has completed.
upload_threads: 8 # Number of threads used to upload artifacts to the staging repository.
exclude: # Regular expression patterns of artifacts to exclude
- 'build-info\.json' # required to avoid publishing Artifactory build info
- 'org/springframework/boot/spring-boot-docs/.*'Command used to move the build artifacts to a target repository in Artifactory. This steps usually happens after the staging of artifacts on Artifactory. This step can be done with the Concourse Artifactory Resource.
This command sends a request to the Artifactory REST API to promote artifacts from a staging repository to a target repository.
java -jar /spring-boot-release-scripts.jar publishToSdkman $RELEASE_TYPE $VERSION $BRANCHWhere:
-
$RELEASE_TYPEis the type of release:"M"(milestones),"RC"(release candidates) or"RELEASE" -
$VERSIONthe actual artifact version -
$BRANCHthe git branch the artifact is being tagged and released from