Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
at: ~/
- run:
name: Deploy snapshot to Artifactory
command: ./gradlew -PbuildAccess=opensource -PbuildNumber=$CIRCLE_BUILD_NUM -PbuildTag=$CIRCLE_TAG -PartifactoryUrl=$ARTIFACTORY_URL -PartifactoryRepository=$SNAPSHOT_ARTIFACTORY_REPOSITORY -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --info --stacktrace artifactoryPublish
command: ./gradlew -PbuildNumber=$CIRCLE_BUILD_NUM -PbuildTag=$CIRCLE_TAG -PartifactoryUrl=$ARTIFACTORY_URL -PartifactoryRepository=$SNAPSHOT_ARTIFACTORY_REPOSITORY -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --info --stacktrace artifactoryPublish
deploy_release:
executor: openjdk_executor
working_directory: /home/circleci/mms
Expand All @@ -61,7 +61,10 @@ jobs:
at: ~/
- run:
name: Deploy release to Artifactory
command: ./gradlew -PbuildAccess=opensource -PbuildNumber=$CIRCLE_BUILD_NUM -PbuildTag=$CIRCLE_TAG -PartifactoryUrl=$ARTIFACTORY_URL -PartifactoryRepository=$RELEASE_ARTIFACTORY_REPOSITORY -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --info --stacktrace artifactoryPublish
command: ./gradlew -PbuildNumber=$CIRCLE_BUILD_NUM -PbuildTag=$CIRCLE_TAG -PartifactoryUrl=$ARTIFACTORY_URL -PartifactoryRepository=$RELEASE_ARTIFACTORY_REPOSITORY -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --info --stacktrace artifactoryPublish
- run:
name: Deploy release to Bintray
command: ./gradlew -PbuildNumber=$CIRCLE_BUILD_NUM -PbuildTag=$CIRCLE_TAG -PbintrayUser=$BINTRAY_USER -PbintrayKey=$BINTRAY_KEY --info --stacktrace bintrayUpload

workflows:
version: 2
Expand Down
35 changes: 29 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ buildscript {
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
Expand All @@ -12,10 +13,6 @@ buildscript {

description = 'Structured Data Version Control'

ext.snapshotBuild = version.contains("SNAPSHOT")
ext.releaseBuild = !version.contains("SNAPSHOT")
ext.milestoneBuild = !(snapshotBuild || releaseBuild)

ext {
commonDependencies = [
'swagger-annotations' : 'io.swagger.core.v3:swagger-annotations:2.1.2',
Expand All @@ -42,6 +39,17 @@ ext {
]
}

String buildTag = project.getProperties().get('buildTag')
if (buildTag != null && !buildTag.isEmpty() && buildTag != version) {
throw new GradleException('Version mismatch: '+buildTag+' vs '+version)
}
if (buildTag == null || buildTag.isEmpty() || project.getProperties().getOrDefault('artifactoryRepository', '').toLowerCase().contains('snapshot')) {
version += '-SNAPSHOT'
}
ext.snapshotBuild = version.contains("SNAPSHOT")
ext.releaseBuild = !version.contains("SNAPSHOT")
ext.milestoneBuild = !(snapshotBuild || releaseBuild)

subprojects {
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
Expand All @@ -53,13 +61,13 @@ subprojects {
project.sourceCompatibility = '10'
project.targetCompatibility = '10'
}
}
version = rootProject.version

allprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'io.spring.dependency-management'
apply plugin: "com.jfrog.artifactory"
apply plugin: 'com.jfrog.bintray'

Map<String, String> commonDependencies = rootProject.ext.commonDependencies

Expand Down Expand Up @@ -111,4 +119,19 @@ allprojects {
}
}
}

bintray {
user = project.getProperties().get('bintrayUser')
key = project.getProperties().get('bintrayKey')
publications = ['mavenJava']
publish = true
dryRun = true
pkg {
repo = 'maven'
name = 'mms-' + project.name
userOrg = 'openmbee'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/Open-MBEE/mms.git'
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=4.0.0-SNAPSHOT
version=4.0.0
group=org.openmbee.mms

springBootVersion=2.2.6.RELEASE
Expand Down