You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2018/10/19 07:45:33 UTC

[incubator-plc4x] 02/02: - Tried to fix the build by using an alternate approach for deploying

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git

commit f20eaa8d30857dc47520e3ab40e0fed6cafb6f44
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Fri Oct 19 09:44:57 2018 +0200

    - Tried to fix the build by using an alternate approach for deploying
---
 Jenkinsfile | 16 +++++++++++----
 jenkins.pom | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 4 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index e76666b..f2c38dd 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -99,9 +99,15 @@ pipeline {
             }
             steps {
                 echo 'Building'
-                sh 'mvn -P${JENKINS_PROFILE} ${MVN_TEST_FAIL_IGNORE} ${JQASSISTANT_NEO4J_VERSION} clean install'
+                // Make sure the directory is wiped.
+                sh 'rm -rf ./local-snapshots-dir'
+
+                // We'll deploy to a relative directory so we can save
+                // that and deploy in a later step on a different node
+                sh 'mvn -P${JENKINS_PROFILE} ${MVN_TEST_FAIL_IGNORE} ${JQASSISTANT_NEO4J_VERSION} -DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir clean deploy'
+
                 // Stash the build results so we can deploy them on another node
-                stash name: 'plc4x-build'
+                stash name: 'plc4x-build-snapshots', includes: 'local-snapshots-dir/**'
             }
             post {
                 always {
@@ -134,8 +140,10 @@ pipeline {
             steps {
                 echo 'Deploying'
                 // Unstash the previously stashed build results.
-                unstash name: 'plc4x-build'
-                sh 'mvn -U -P${JENKINS_PROFILE} ${MVN_LOCAL_REPO_OPT} -Drat.skip=true -Djqassistant.skip=true -Dmaven.resources.skip=true -Dmaven.test.skip=true -Dmaven.install.skip=true deploy'
+                unstash name: 'plc4x-build-snapshots'
+
+                // Deploy the artifacts using the wagon-maven-plugin.
+                sh 'mvn -f jenkins.pom -P deploy-snapshots wagon:upload'
             }
         }
 
diff --git a/jenkins.pom b/jenkins.pom
new file mode 100644
index 0000000..5b8b620
--- /dev/null
+++ b/jenkins.pom
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>21</version>
+    </parent>
+
+    <groupId>org.apache.plc4x</groupId>
+    <artifactId>plc4x-jenkins-tools</artifactId>
+    <version>0.2.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <name>PLC4X: Jenkins Tools</name>
+    <description>Set of helpers to do individual tasks only needed on our Jenkins build.</description>
+
+    <profiles>
+        <!--
+            This profile is used to deploy all the artifacts in the
+            'local-snapshots-dir' to Apache's SNAPSHOT repo.
+        -->
+        <profile>
+            <id>deploy-snapshots</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>wagon-maven-plugin</artifactId>
+                        <version>2.0.0</version>
+                        <configuration>
+                            <fromDir>${project.build.directory}/local-snapshots-dir</fromDir>
+                            <includes>*</includes>
+                            <serverId>apache.snapshots.https</serverId>
+                            <url>${distMgmtSnapshotsUrl}</url>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
\ No newline at end of file