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/12/11 13:58:06 UTC

[incubator-plc4x] branch develop updated: Streamlined the Jenkinsfile to use the jenkins.pom for deploying the site the same way we are doing this in the deploy-snapshots phase.

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 5768c8a  Streamlined the Jenkinsfile to use the jenkins.pom for deploying the site the same way we are doing this in the deploy-snapshots phase.
5768c8a is described below

commit 5768c8ae3661bc4043d644d0bad6351cc6b28b6a
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Tue Dec 11 14:58:00 2018 +0100

    Streamlined the Jenkinsfile to use the jenkins.pom for deploying the site the same way we are doing this in the deploy-snapshots phase.
---
 Jenkinsfile | 12 +++++++++---
 jenkins.pom | 24 ++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 91efc56..fd543e5 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -99,8 +99,10 @@ pipeline {
             }
             steps {
                 echo 'Building'
-                // Make sure the directory is wiped.
-                sh 'rm -rf ./local-snapshots-dir'
+                // Clean up the snapshots directory.
+                dir("local-snapshots-dir/") {
+                    deleteDir()
+                }
 
                 // We'll deploy to a relative directory so we can save
                 // that and deploy in a later step on a different node
@@ -188,10 +190,14 @@ pipeline {
             }
             steps {
                 echo 'Deploying Site'
+                // Clean up the site directory.
+                dir("ltarget/staging") {
+                    deleteDir()
+                }
                 // Unstash the previously stashed site.
                 unstash 'plc4x-site'
                 // Publish the site with the scm-publish plugin.
-                sh 'mvn -P${JENKINS_PROFILE} scm-publish:publish-scm'
+                sh 'mvn -f jenkins.pom -X -P deploy-site scm-publish:publish-scm'
             }
         }
     }
diff --git a/jenkins.pom b/jenkins.pom
index cd938b5..d376990 100644
--- a/jenkins.pom
+++ b/jenkins.pom
@@ -37,6 +37,13 @@
     <name>PLC4X: Jenkins Tools</name>
     <description>Set of helpers to do individual tasks only needed on our Jenkins build.</description>
 
+    <distributionManagement>
+        <site>
+            <id>apache.website</id>
+            <url>scm:git:https://gitbox.apache.org/repos/asf/incubator-plc4x-website.git</url>
+        </site>
+    </distributionManagement>
+
     <profiles>
         <!--
             This profile is used to deploy all the artifacts in the
@@ -60,6 +67,23 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>deploy-site</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-scm-publish-plugin</artifactId>
+                        <configuration>
+                            <!-- mono-module doesn't require site:stage -->
+                            <content>${project.build.directory}/staging</content>
+                            <!-- branch where to deploy -->
+                            <scmBranch>asf-site</scmBranch>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
     </profiles>
 
 </project>
\ No newline at end of file