From a893e8e76294a42dbba811b1527239a26b825a58 Mon Sep 17 00:00:00 2001 From: SebastianEbert <sebastian.ebert@tu-dresden.de> Date: Tue, 7 Dec 2021 13:39:24 +0100 Subject: [PATCH] added ci --- .gitlab-ci.yml | 35 +++++++++++++++++++++++++++++++++++ README.md | 2 +- build.gradle | 48 ++++++++++++++++++++++-------------------------- 3 files changed, 58 insertions(+), 27 deletions(-) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..3863f24 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,35 @@ +variables: + GIT_SUBMODULE_STRATEGY: recursive + GIT_DEPTH: 1000 + +stages: + - build + - publish + +cache: + paths: + - .gradle/wrapper + - .gradle/caches + +build: + image: maven:3-jdk-8 + stage: build + script: + - ./gradlew --console=plain --no-daemon assemble jar + artifacts: + paths: + - "message_generation/build/libs" + expire_in: 1 week + + +publish: + image: maven:3-jdk-8 + stage: publish + needs: + - build + script: + - "./gradlew publish" + only: + - main + + diff --git a/README.md b/README.md index ed8245b..645a6eb 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -See [rosjava_core](https://github.com/rosjava/rosjava_core) readme. +See [rosjava_core](https://git-st.inf.tu-dresden.de/ceti/ros/ros-java-packages/rosjava-core-gradle) readme. diff --git a/build.gradle b/build.gradle index cf7739c..4b8c154 100644 --- a/build.gradle +++ b/build.gradle @@ -31,36 +31,32 @@ subprojects { sourceCompatibility = 1.6 targetCompatibility = 1.6 - // These external repositories are copied from bootstrap.gradle. - repositories { - jcenter() - maven { - url "http://repository.springsource.com/maven/bundles/release" - } - maven { - url "http://repository.springsource.com/maven/bundles/external" - } - } - - // Configuration of the deployment repository is copied from the RosPlugin. - String mavenDeploymentRepository = System.getenv("ROS_MAVEN_DEPLOYMENT_REPOSITORY") - if (mavenDeploymentRepository != null && - mavenDeploymentRepository != "") { - publishing { - publications { - mavenJava(MavenPublication) { - from components.java + publishing { + publications { + maven(MavenPublication) { + artifactId = 'rosjava' + artifact("message_generation/build/libs/message_generation-${version}.jar") { + extension 'jar' + } } - } - repositories { + } + repositories { maven { - url 'file://' + mavenDeploymentRepository + url "https://git-st.inf.tu-dresden.de/api/v4/projects/1108/packages/maven" + + credentials(HttpHeaderCredentials) { + name = 'Job-Token' + value = System.getenv("CI_JOB_TOKEN") + } + authentication { + header(HttpHeaderAuthentication) + } } - } + } - } else { - logger.warn("ROS_MAVEN_DEPLOYMENT_REPOSITORY is not set. Have you sourced setup.bash?") - } } + + + defaultTasks 'publish', 'installDist' -- GitLab