Skip to content

Commit

Permalink
[WIP] doc infra
Browse files Browse the repository at this point in the history
  • Loading branch information
LesTR committed Oct 27, 2020
1 parent b6c4a41 commit b015935
Show file tree
Hide file tree
Showing 19 changed files with 207 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ export GOOGLE_APPLICATION_CREDENTIALS=/tmp/google-credentials.json

RESUME=""
if echo ${VERSION} | grep SNAPSHOT >/dev/null && echo ${GITHUB_REPOSITORY} | grep O2-Czech-Republic >/dev/null; then
git submodule update
TRY=0
while [ $TRY -lt 3 ]; do
CMD="mvn deploy -DskipTests -Prelease-snapshot -Pallow-snapshots"
CMD="mvn deploy -DskipTests -Prelease-snapshot -Pallow-snapshots -Pwith-doc"
if [ ! -z "${RESUME}" ]; then
CMD="${CMD} $(echo $RESUME | sed "s/.\+\(-rf .\+\)/\1/")"
fi
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
- name: Deploy with Maven
env:
MAVEN_SETTINGS: ${{ secrets.MAVEN_SETTINGS }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/src/themes/book"]
path = docs/src/themes/book
url = https://github.com/alex-shpak/hugo-book
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ addons:
apt:
packages:
- realpath
- hugo
sonarcloud:
organization: datadriven

Expand All @@ -17,7 +18,7 @@ install: true
before_script:
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
script:
- mvn spotless:check -B -V && mvn install -B -V -Pallow-snapshots,with-coverage,travis -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.shade=error || exit 1
- mvn spotless:check -B -V && mvn install -B -V -Pallow-snapshots,with-coverage,travis,with-doc -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.shade=error || exit 1
- export JAVA_HOME=$HOME/openjdk11
- chmod u+x $TRAVIS_BUILD_DIR/install-jdk.sh
- $TRAVIS_BUILD_DIR/install-jdk.sh --feature 11 --target $JAVA_HOME
Expand Down
1 change: 1 addition & 0 deletions docs/license-header-spotless.txt
1 change: 1 addition & 0 deletions docs/license-header.txt
87 changes: 87 additions & 0 deletions docs/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017-2020 O2 Czech Republic, a.s.
Licensed 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">
<parent>
<artifactId>platform-parent</artifactId>
<groupId>cz.o2.proxima</groupId>
<version>0.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>proxima-docs</artifactId>
<packaging>pom</packaging>

<name>${project.groupId}:${project.artifactId}</name>
<properties>
<proxima.doc.baseurl>https://proxima.datadriven.cz</proxima.doc.baseurl>
<maven.exec.version>3.0.0</maven.exec.version>
</properties>

<profiles>
<profile>
<id>with-doc</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${maven.exec.version}</version>
<executions>
<execution>
<id>build-doc</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>hugo</executable>
<workingDirectory>${project.basedir}/src/</workingDirectory>
<arguments>
<argument>-b</argument>
<argument>${proxima.doc.baseurl}</argument>
<argument>-F</argument>
<argument>-d</argument>
<arguemnt>${project.build.directory}/public/</arguemnt>
<argument>--buildDrafts</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>deploy-doc</id>
<phase>deploy</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>hugo</executable>
<workingDirectory>${project.basedir}/src/</workingDirectory>
<arguments>
<argument>deploy</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
6 changes: 6 additions & 0 deletions docs/src/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

63 changes: 63 additions & 0 deletions docs/src/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#
# Copyright 2017-2020 O2 Czech Republic, a.s.
#
# Licensed 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.
#

baseURL: https://proxima.datadriven.cz
languageCode: en-us
title: Proxima platform
theme: book

#googleAnalytics = "UA-XXXXXXXXX-X"

# Needed for mermaid/katex shortcodes
markup:
goldmark:
renderer:
unsafe: true
tableOfContents:
startLevel: 1

languages:
en:
languageName: English
contentDir: content
weight: 1

menu:
# before: []
after:
- name: "Github"
url: "https://github.com/datadrivencz/proxima-platform/"
weight: 10
- name: "Hugo Themes"
url: "https://themes.gohugo.io/hugo-book/"
weight: 20


enableGitInfo: true
params:
BookTheme: light
BookMenuBundle: /menu
BookRepo: https://github.com/datadrivencz/proxima-platform/
BookEditPath: edit/master/docs/src/content
# BookComments: false
BookPortableLinks: true
BookServiceWorker: true

deployment:
order: [".jpg$", ".gif$", ".png$"]
targets:
- name: proxima-doc
URL: "gs://proxima-docs?prefix=proxima-docs/"
1 change: 1 addition & 0 deletions docs/src/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Proxima platform documentation (WIP)
5 changes: 5 additions & 0 deletions docs/src/content/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
headless: false
draft: false
---
## TEST
19 changes: 19 additions & 0 deletions docs/src/content/license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: "License"
date: 2020-10-25T13:46:22+01:00
draft: true
---
**License**

Licensed 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.

8 changes: 8 additions & 0 deletions docs/src/content/menu/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
headless: true
draft: false
---
- [Book Example]({{< relref "/" >}})
- [Page One]({{< relref "/" >}})
- [Page Two]({{< relref "/" >}})
- [Blog]({{< relref "/" >}})
1 change: 1 addition & 0 deletions docs/src/public
Loading

0 comments on commit b015935

Please sign in to comment.