Skip to content

Commit

Permalink
CI and deploy steps for docs
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Leszczynski <[email protected]>
  • Loading branch information
pawel-big-lebowski committed Aug 26, 2024
1 parent fe7a75f commit fb9c32f
Show file tree
Hide file tree
Showing 318 changed files with 141 additions and 68,815 deletions.
17 changes: 0 additions & 17 deletions .circleci/continue_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1063,23 +1063,6 @@ jobs:
paths:
- ~/.gradle

# REST
publish-javadoc:
working_directory: ~/openlineage/client/java
docker:
- image: cimg/openjdk:17.0
steps:
- *checkout_project_root
- when:
condition:
equal: [ inactive, << pipeline.parameters.nightly-run >> ]
steps:
- add_ssh_keys:
fingerprints:
- "7d:bc:78:35:09:c9:25:04:63:f9:eb:4b:f1:f4:d1:91"
- run: ./gradlew --console=plain javadoc
- run: ./release-javadoc.sh

publish-spec:
working_directory: ~/openlineage
docker:
Expand Down
14 changes: 0 additions & 14 deletions .circleci/workflows/openlineage-integration-publish.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .circleci/workflows/openlineage-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ workflows:
- compile-integration-sql-java-linux-arm
- compile-integration-sql-java-linux-x86
- compile-integration-sql-java-macos
- publish-javadoc:
filters:
branches:
only: main
context: release
- release-client-java:
filters:
tags:
Expand All @@ -70,6 +65,5 @@ workflows:
tags:
only: /^[0-9]+(\.[0-9]+){2}(-rc\.[0-9]+)?$/
requires:
- publish-javadoc
- release-client-java
- release-integration-sql-java
15 changes: 15 additions & 0 deletions .circleci/workflows/openlineage-spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
workflows:
openlineage-spec:
jobs:
- verify-spec-snapshot:
filters:
tags:
only: /^[0-9]+(\.[0-9]+){2}(-rc\.[0-9]+)?$/
context: << pipeline.parameters.build-context >>
- workflow_complete:
filters:
tags:
only: /^[0-9]+(\.[0-9]+){2}(-rc\.[0-9]+)?$/
requires:
- release-client-java
- release-integration-sql-java
87 changes: 87 additions & 0 deletions .github/workflows/website-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Build & Deploy spec to Github Pages

on:
pull_request:
branches:
- main
push:
branches:
- main
# testing only, not allowed to run on OpenLineage/OpenLineage repo
- docs-deploy

permissions:
id-token: write

jobs:
site-deploy:
name: Build and Publish To openlineage-site repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: 'source'
- uses: actions/checkout@v4
with:
repository: 'pawel-big-lebowski/openlineage-site' # TODO: remove this
path: 'target'
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: source/website/package-lock.json
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
- uses: shogo82148/actions-setup-perl@v1
with:
perl-version: "5.38"
- name: Regenerate Javadoc to website
run: |
cd source/client/java
./gradlew javadoc
cp -r build/docs/javadoc ../../website/static/apidocs
- name: Install dependencies
run: |
cd source/website
yarn install --frozen-lockfile
- name: Generate openapi
run: |
SPEC_DIR="$(pwd)/source/website/static/spec"
APIDOC_DIR="$(pwd)/source/website/static/apidocs"
pushd $SPEC_DIR
LATEST_VERSION=$(find . -maxdepth 1 | grep -v 'facets' | grep '[0-9]*-[0-9]-[0-9]' | sort -Vr | head -1)
echo latest version is $LATEST_VERSION
rm -f ./OpenLineage.json 2>/dev/null
perl -i -pe"s/version: [[:alnum:]\.-]*/version: ${LATEST_VERSION:2}/g" ./OpenLineage.yml
echo Versions updated
mkdir "${LATEST_VERSION}/facets"
for i in $(ls -d ./facets/* | sort); do cp $i/*.json ${LATEST_VERSION}/facets; done;
echo "LATEST_VERSION=${LATEST_VERSION}" >> "$GITHUB_ENV"
pushd $LATEST_VERSION
ln -sf ../OpenLineage.yml .
popd
- name: Generate redoc
run: |
npm install redoc-cli
yarn run redoc-cli build -o source/website/static/apidocs/openapi/index.html source/website/static/spec/$LATEST_VERSION/OpenLineage.yml --title "OpenLineage API Docs"
- name: Clean temp files
run: |
pushd source/website/static/spec/$LATEST_VERSION
rm -rf facets
rm OpenLineage.yml
popd
- name: Push target repo
run: |
rm -r target/*
cp -r source/website/* target
cd target
git config user.name "GitHub Action Website Snapshot"
git config user.email "<>"
git add .
git commit -m "refreshing website content from main repo"
git push
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,8 @@ repos:
files: ^client/java/src/.*\.java$
exclude: ".*test.*"
require_serial: true
- id: spec-changes
name: Verify spec changes committed to website
language: script
files: ^spec/
entry: .pre_commit/run-spec-snapshot.sh
21 changes: 21 additions & 0 deletions .pre_commit/run-spec-snapshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Copy changed spec JSON files to target location
git diff --name-only HEAD -- 'spec/*.json' 'spec/OpenLineage.yml' | while read LINE; do
# ignore registry files
if [[ $LINE =~ "registry.json" ]]; then
continue
fi

# extract target file name from $id field in spec files
URL=$(cat $LINE | jq -r '.["$id"]')

# extract target location in website repo
LOC="website/static/${URL#*//*/}"
LOC_DIR="${LOC%/*}"

# create dir if necessary, and copy files
echo "change detected in $LINE"
mkdir -p $LOC_DIR
cp $LINE $LOC
done
10 changes: 10 additions & 0 deletions client/java/regenerate-docs-to-website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
#
# Copyright 2018-2024 contributors to the OpenLineage project
# SPDX-License-Identifier: Apache-2.0
#

cd "$(dirname "$0")"
./gradlew javadoc
rm -rf ../../website/static/apidocs/javadoc
mv ./build/docs/javadoc ../../website/static/apidocs/
46 changes: 0 additions & 46 deletions client/java/release-javadoc.sh

This file was deleted.

80 changes: 0 additions & 80 deletions spec/release.sh

This file was deleted.

2 changes: 1 addition & 1 deletion website/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
openlineage.io
openlineage.github.io
4 changes: 2 additions & 2 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const linksSocial = [
const config = {
title: 'OpenLineage',
tagline: 'OpenLineage',
url: 'https://openlineage.io',
baseUrl: '/',
url: 'https://openlineage.github.io', // TODO: replace with openlineage.io in the next step
baseUrl: '/OpenLineage',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.ico',
Expand Down
Loading

0 comments on commit fb9c32f

Please sign in to comment.