falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject falcon git commit: Script to copy docs from release branch
Date Thu, 10 Mar 2016 10:47:00 GMT
Repository: falcon
Updated Branches:
  refs/heads/asf-site 4e4b8457d -> 3c2973890


Script to copy docs from release branch


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/3c297389
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/3c297389
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/3c297389

Branch: refs/heads/asf-site
Commit: 3c2973890e0ceb9f42f3d281394c6873d326f492
Parents: 4e4b845
Author: Pallavi Rao <pallavi.rao@inmobi.com>
Authored: Thu Mar 10 16:16:41 2016 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Thu Mar 10 16:16:41 2016 +0530

----------------------------------------------------------------------
 fetch-docs.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++
 pom.template  | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/3c297389/fetch-docs.py
----------------------------------------------------------------------
diff --git a/fetch-docs.py b/fetch-docs.py
new file mode 100644
index 0000000..b1e5fee
--- /dev/null
+++ b/fetch-docs.py
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+
+#
+# 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.
+#
+# Usage:
+#   $  python fetch-docs.py
+import traceback
+import subprocess
+import os
+import shutil
+
+def run_cmd(cmd):
+    try:
+        print "Running command: %s" % cmd
+        output = subprocess.check_output(cmd, shell=True)
+        return output
+    except:
+        traceback.print_exc()
+        sys.exit(1)
+
+def create_pom(branch):
+    f1 = open('pom.template', 'r')
+    f2 = open('trunk/releases/%s/pom.xml' % branch, 'w')
+    for line in f1:
+        f2.write(line.replace('${branch}', branch))
+    f1.close()
+    f2.close()
+
+branch = raw_input("Enter the Falcon branch from which you wish to copy the docs :")
+# Copy docs from the branch into asf-site
+print("Copy docs from https://git-wip-us.apache.org/repos/asf/falcon.git, branch %s" % branch)
+os.mkdir("trunk/releases/%s" % branch)
+run_cmd("git checkout origin/%s docs/src" % branch)
+run_cmd("cp -r docs/src/site/ trunk/general/src/site")
+os.rename("docs/src", "trunk/releases/%s/src" % branch)
+run_cmd("git rm -r -f docs")
+# Update poms
+create_pom(branch)
+print("Copied docs from branch %s " % branch)
+print("To publish the new docs to falcon site do the following:")
+print("1. Update trunk/releases/pom.xml to add the new doc module fetched")
+print("2. Update trunk/pom.xml to new version. Update the team members list, if required.")
+print("3. Update trunk/general/src/site/site.xml to add links to the new release and doc")
+print("4. cd to trunk and build : mvn clean install")
+print("5. git add the new files, commit and git push")

http://git-wip-us.apache.org/repos/asf/falcon/blob/3c297389/pom.template
----------------------------------------------------------------------
diff --git a/pom.template b/pom.template
new file mode 100644
index 0000000..10913bf
--- /dev/null
+++ b/pom.template
@@ -0,0 +1,66 @@
+<?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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.falcon</groupId>
+        <artifactId>falcon-website-releases</artifactId>
+        <version>0.2</version>
+    </parent>
+    <artifactId>falcon-website-${branch}</artifactId>
+    <version>${branch}</version>
+    <packaging>pom</packaging>
+
+    <name>Apache Falcon - Documentation v${branch}</name>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-site-plugin</artifactId>
+                <version>3.3</version>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.maven.doxia</groupId>
+                        <artifactId>doxia-module-twiki</artifactId>
+                        <version>1.3</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.maven.wagon</groupId>
+                        <artifactId>wagon-ssh-external</artifactId>
+                        <version>2.6</version>
+                    </dependency>
+                </dependencies>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>site</goal>
+                        </goals>
+                        <phase>prepare-package</phase>
+                    </execution>
+                </executions>
+                <configuration>
+                    <outputDirectory>../../../site/${branch}</outputDirectory>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>


Mime
View raw message