Merge "Fix Honeycomb linting"
[ci-management.git] / jjb / csit / include-raw-csit-cpta.sh
1 #!/bin/bash
2
3 set -xe -o pipefail
4
5 [ "$DOCS_REPO_URL" ] || DOCS_REPO_URL="https://nexus.fd.io/content/sites/site"
6 [ "$PROJECT_PATH" ] || PROJECT_PATH=io/fd/csit
7 [ "$DOC_DIR" ] || DOC_DIR=resources/tools/presentation
8 [ "$BUILD_DIR" ] || BUILD_DIR=${DOC_DIR}/_build
9 [ "$SITE_DIR" ] || SITE_DIR=build-root/docs/deploy-site
10 [ "$RESOURCES_DIR" ] || RESOURCES_DIR=${SITE_DIR}/src/site/resources/trending
11 [ "$MVN" ] || MVN="/opt/apache/maven/bin/mvn"
12
13 cd ${DOC_DIR}
14 chmod +x ./run_cpta.sh
15 STATUS=$(./run_cpta.sh | tail -1)
16
17 cd ${WORKSPACE}
18
19 mkdir -p ${RESOURCES_DIR}
20 mv -f ${BUILD_DIR}/* ${RESOURCES_DIR}
21 cd ${SITE_DIR}
22
23 cat > pom.xml << EOF
24 <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">
25     <modelVersion>4.0.0</modelVersion>
26     <groupId>io.fd.csit</groupId>
27     <artifactId>docs</artifactId>
28     <version>1.0.0</version>
29     <packaging>pom</packaging>
30     <properties>
31         <generateReports>false</generateReports>
32     </properties>
33     <build>
34         <extensions>
35             <extension>
36                 <groupId>org.apache.maven.wagon</groupId>
37                 <artifactId>wagon-webdav-jackrabbit</artifactId>
38                 <version>2.9</version>
39             </extension>
40         </extensions>
41     </build>
42     <distributionManagement>
43         <site>
44             <id>fdio-site</id>
45             <url>dav:${DOCS_REPO_URL}/${PROJECT_PATH}/${GERRIT_BRANCH}</url>
46         </site>
47     </distributionManagement>
48 </project>
49 EOF
50
51 ${MVN} site:site site:deploy -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}" -T 4C
52
53 cd -
54
55 if [ ${STATUS} == "PASS" ]; then
56     exit 0
57 else
58     exit 1
59 fi