Switch java part to proto pipeline (#585)

* Bump parent and build-utils
This commit is contained in:
Alexey Pronin 2020-07-08 18:49:53 +03:00 committed by GitHub
parent a1072d0666
commit 2f62a8cd64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 57 deletions

18
Jenkinsfile vendored
View File

@ -10,6 +10,7 @@ build('damsel', 'docker-host') {
runStage('load pipeline') {
env.JENKINS_LIB = "build_utils/jenkins_lib"
pipeDefault = load("${env.JENKINS_LIB}/pipeDefault.groovy")
pipeJavaProto = load("${env.JENKINS_LIB}/pipeJavaProto.groovy")
gitUtils = load("${env.JENKINS_LIB}/gitUtils.groovy")
}
@ -31,19 +32,8 @@ build('damsel', 'docker-host') {
}
}
}
// Java
runStage('Execute build container') {
withCredentials([[$class: 'FileBinding', credentialsId: 'java-maven-settings.xml', variable: 'SETTINGS_XML']]) {
if (env.BRANCH_NAME == 'master') {
sh 'make wc_deploy_nexus SETTINGS_XML=$SETTINGS_XML'
} else if (env.BRANCH_NAME.startsWith('epic/')) {
sh 'make wc_deploy_epic_nexus SETTINGS_XML=$SETTINGS_XML'
} else {
sh 'make wc_java_compile SETTINGS_XML=$SETTINGS_XML'
}
}
}
}
env.skipSonar = 'true'
pipeJavaProto()
}

View File

@ -24,9 +24,7 @@ DESTDIR = _gen
RELDIR = _release
CALL_W_CONTAINER := \
all compile doc clean \
java_compile deploy_nexus deploy_epic_nexus java_install \
release-erlang
all compile doc clean release-erlang
all: compile
@ -42,7 +40,7 @@ endef
CUTLINE = $(shell printf '=%.0s' $$(seq 1 80))
.PHONY: all compile doc clean java_compile deploy_nexus deploy_epic_nexus java_install
.PHONY: all compile doc clean
LANGUAGE_TARGETS = $(foreach lang, $(THRIFT_LANGUAGES), verify-$(lang))
@ -107,39 +105,4 @@ build-release:
endif
endif
# Java
MVN = mvn --no-transfer-progress
ifdef SETTINGS_XML
DOCKER_RUN_OPTS = -v $(SETTINGS_XML):$(SETTINGS_XML)
DOCKER_RUN_OPTS += -e SETTINGS_XML=$(SETTINGS_XML)
endif
ifdef LOCAL_BUILD
DOCKER_RUN_OPTS += -v $$HOME/.m2:/home/$(UNAME)/.m2:rw
endif
COMMIT_HASH = $(shell git --no-pager log -1 --pretty=format:"%h")
NUMBER_COMMITS = $(shell git rev-list --count HEAD)
java_compile:
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
$(MVN) compile -s $(SETTINGS_XML)
deploy_nexus:
$(if $(SETTINGS_XML),, echo "SETTINGS_XML not defined"; exit 1)
$(MVN) versions:set versions:commit -DnewVersion="1.$(NUMBER_COMMITS)-$(COMMIT_HASH)" -s $(SETTINGS_XML) \
&& $(MVN) deploy -s $(SETTINGS_XML) -Dpath_to_thrift="$(THRIFT)" -Dcommit.number="$(NUMBER_COMMITS)"
deploy_epic_nexus:
$(if $(SETTINGS_XML),, echo "SETTINGS_XML not defined"; exit 1)
$(MVN) versions:set versions:commit -DnewVersion="1.$(NUMBER_COMMITS)-$(COMMIT_HASH)-epic" -s $(SETTINGS_XML) \
&& $(MVN) deploy -s $(SETTINGS_XML) -Dpath_to_thrift="$(THRIFT)" -Dcommit.number="$(NUMBER_COMMITS)"
java_install:
$(if $(SETTINGS_XML),, echo "SETTINGS_XML not defined"; exit 1)
$(MVN) clean -s $(SETTINGS_XML) && \
$(MVN) versions:set versions:commit -DnewVersion="1.$(NUMBER_COMMITS)-$(COMMIT_HASH)" -s $(SETTINGS_XML) \
&& $(MVN) install -s $(SETTINGS_XML) -Dpath_to_thrift="$(THRIFT)" -Dcommit.number="$(NUMBER_COMMITS)"
include $(UTILS_PATH)/make_lib/java_proto.mk

@ -1 +1 @@
Subproject commit 4e6aae0f31885d3c56d09c72de7ef8d432149dbf
Subproject commit 2fab5dff82ae08dacbea2f4a0d35d4f58577b708

18
pom.xml
View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.rbkmoney</groupId>
<artifactId>parent</artifactId>
<version>1.0.0</version>
<version>1.0.5</version>
</parent>
<groupId>com.rbkmoney</groupId>
@ -17,6 +17,20 @@
<name>Damsel</name>
<description>Generates jar artifact containing compiled thrift classes based on generated thrift IDL files</description>
<url>https://github.com/rbkmoney/damsel.git</url>
<developers>
<developer>
<organization>RBK.money</organization>
<organizationUrl>https://rbk.money</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/rbkmoney/damsel.git</connection>
<developerConnection>scm:git:ssh://github.com/rbkmoney/damsel.git</developerConnection>
<url>https://github.com/rbkmoney/damsel/tree/master</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -39,7 +53,7 @@
<plugin>
<groupId>org.apache.thrift</groupId>
<artifactId>thrift-maven-plugin</artifactId>
<version>0.9.3-1</version>
<version>0.10.0</version>
<configuration>
<generator>java:fullcamel</generator>
<thriftSourceRoot>${project.basedir}/proto</thriftSourceRoot>