From 511368f237d7e818c25957de7536dd400ba75ec3 Mon Sep 17 00:00:00 2001 From: Michael Pawliszyn Date: Fri, 12 Feb 2021 16:35:29 -0500 Subject: [PATCH 1/3] Adds a method to override dependencies and other things locally. --- .gitignore | 5 ++++- settings.gradle | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 52af83118..c0c9dff5b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,7 @@ service/web/**/lib/ docs/0.x/* docs/index.md docs/changelog.md -docs/releasing.md \ No newline at end of file +docs/releasing.md + +# Local gradle includes +local.settings.gradle \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 017ebe908..6c99513ac 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,3 +4,8 @@ include 'client-misk-dynamodb' include 'client-misk-hibernate' include 'client-misk-testing' include 'service' + +def localSettings = file("local.settings.gradle") +if (localSettings.exists()) { + apply from: localSettings +} From 35031233c8e5b08f480c6965303de68e9f483ade Mon Sep 17 00:00:00 2001 From: Michael Pawliszyn Date: Mon, 1 Mar 2021 13:47:33 -0500 Subject: [PATCH 2/3] Fixing misk dependencies. --- client-misk-dynamodb/build.gradle | 6 ++++-- client-misk-hibernate/build.gradle | 6 ++++++ client-misk-testing/build.gradle | 5 +++-- client-misk/build.gradle | 6 ++++++ dependencies.gradle | 6 ++++++ service/build.gradle | 6 ++++++ 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/client-misk-dynamodb/build.gradle b/client-misk-dynamodb/build.gradle index 38df1a9cf..e2e4c46a6 100644 --- a/client-misk-dynamodb/build.gradle +++ b/client-misk-dynamodb/build.gradle @@ -21,13 +21,15 @@ dependencies { testApi project(':client-misk-testing') implementation dep.misk + implementation dep.miskInject api dep.miskHibernate testImplementation dep.assertj - testImplementation(dep.miskTesting) - testImplementation(dep.miskHibernateTesting) + testImplementation dep.miskTesting + testImplementation dep.miskHibernateTesting testImplementation dep.junitEngine testImplementation dep.miskAwsDynamodbTesting + testImplementation dep.kotlinTest } jar { diff --git a/client-misk-hibernate/build.gradle b/client-misk-hibernate/build.gradle index 67e6e4c8e..6301c7b35 100644 --- a/client-misk-hibernate/build.gradle +++ b/client-misk-hibernate/build.gradle @@ -8,18 +8,24 @@ dependencies { implementation dep.guice implementation dep.okio implementation dep.kotlinStdLib + implementation dep.loggingApi implementation dep.wireMoshiAdapter api project(':client-misk') testApi project(':client-misk-testing') implementation dep.misk + implementation dep.miskActions + implementation dep.miskCore + implementation dep.miskInject api dep.miskHibernate testImplementation dep.assertj testImplementation(dep.miskTesting) testImplementation(dep.miskHibernateTesting) + testImplementation dep.kotlinTest testImplementation dep.junitEngine + testImplementation dep.okHttp } jar { diff --git a/client-misk-testing/build.gradle b/client-misk-testing/build.gradle index a06863d57..2dca40abb 100644 --- a/client-misk-testing/build.gradle +++ b/client-misk-testing/build.gradle @@ -3,9 +3,10 @@ apply plugin: 'kotlin' dependencies { api project(':client-misk') - implementation(dep.misk) - implementation(dep.miskTesting) + implementation dep.misk + implementation dep.miskTesting implementation dep.junitEngine + implementation dep.assertj } jar { diff --git a/client-misk/build.gradle b/client-misk/build.gradle index eab0a8d1c..54dcc8653 100644 --- a/client-misk/build.gradle +++ b/client-misk/build.gradle @@ -14,11 +14,17 @@ dependencies { implementation dep.okio implementation dep.kotlinStdLib implementation dep.wireMoshiAdapter + implementation dep.slf4jApi + implementation dep.loggingApi api project(':client') testApi project(':client-misk-testing') implementation dep.misk + implementation dep.miskActions + implementation dep.miskCore + implementation dep.miskInject + implementation dep.miskService testImplementation dep.assertj testImplementation(dep.miskTesting) diff --git a/dependencies.gradle b/dependencies.gradle index 62f9bd3c1..cbddebac4 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -22,6 +22,7 @@ ext.dep = [ "kotlinGradlePlugin": "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10", "kotlinReflection": "org.jetbrains.kotlin:kotlin-reflect:1.4.10", "kotlinStdLib": "org.jetbrains.kotlin:kotlin-stdlib:1.4.10", + "kotlinTest": "org.jetbrains.kotlin:kotlin-test:1.4.10", "kotlinxCoroutines": "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5", "kotlinxCoroutinesLogging": "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.3.5", "kotlinxCoroutinesTest": "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.3.5", @@ -31,9 +32,13 @@ ext.dep = [ "metricsCore": "io.dropwizard.metrics:metrics-core:4.0.2", "metricsParent": "io.dropwizard.metrics:metrics-parent:4.0.2", "misk": "com.squareup.misk:misk:0.16.0", + "miskActions": "com.squareup.misk:misk-actions:0.16.0", "miskAwsDynamodbTesting": "com.squareup.misk:misk-aws-dynamodb-testing:0.16.0", + "miskCore": "com.squareup.misk:misk-core:0.16.0", "miskHibernate": "com.squareup.misk:misk-hibernate:0.16.0", "miskHibernateTesting": "com.squareup.misk:misk-hibernate-testing:0.16.0", + "miskInject": "com.squareup.misk:misk-inject:0.16.0", + "miskService": "com.squareup.misk:misk-service:0.16.0", "miskSlack": "com.squareup.misk:misk-slack:0.16.0", "miskTesting": "com.squareup.misk:misk-testing:0.16.0", "moshiCore": "com.squareup.moshi:moshi:1.11.0", @@ -49,6 +54,7 @@ ext.dep = [ "retrofitMoshi": "com.squareup.retrofit2:converter-moshi:2.9.0", "retrofitWire": "com.squareup.retrofit2:converter-wire:2.9.0", "shadowJarPlugin": "com.github.jengelman.gradle.plugins:shadow:6.1.0", + "slf4jApi": "org.slf4j:slf4j-api:1.7.28", "spotlessPlugin": "com.diffplug.spotless:spotless-plugin-gradle:3.25.0", "tracingJaeger": "io.jaegertracing:jaeger-core:1.1.0", "wireCompiler": "com.squareup.wire:wire-compiler:3.5.0", diff --git a/service/build.gradle b/service/build.gradle index f68824e08..0b47dad8d 100644 --- a/service/build.gradle +++ b/service/build.gradle @@ -36,7 +36,11 @@ dependencies { implementation dep.metricsCore implementation dep.metricsParent implementation dep.misk + implementation dep.miskActions + implementation dep.miskCore implementation dep.miskHibernate + implementation dep.miskInject + implementation dep.miskService implementation dep.miskSlack implementation dep.moshiCore implementation dep.moshiKotlin @@ -46,6 +50,7 @@ dependencies { implementation dep.openTracingOkHttp implementation dep.retrofit implementation dep.retrofitGuavaAdapter + implementation dep.retrofitWire implementation dep.tracingJaeger implementation dep.wireRuntime implementation dep.wireCompiler @@ -58,6 +63,7 @@ dependencies { testImplementation dep.junitApi testImplementation dep.junitParams testImplementation dep.junitEngine + testImplementation dep.kotlinTest testImplementation dep.kotlinxCoroutinesTest testImplementation dep.assertj testImplementation dep.openTracingMock From a7c8bf0a5705a2a048e8ec010429b4f41d3f6e7e Mon Sep 17 00:00:00 2001 From: Andrew Alexander Date: Wed, 17 Mar 2021 11:37:24 -0400 Subject: [PATCH 3/3] Migrate Docs build and release to Github Actions --- .circleci/config.yml | 20 ------------ .github/workflows/Publish-Website.yml | 45 +++++++++++++++++++++++++++ .github/workflows/prepare_mkdocs.sh | 38 ++++++++++++++++++++++ CONTRIBUTING.md | 13 ++++++++ mkdocs.yml | 3 +- 5 files changed, 98 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/Publish-Website.yml create mode 100755 .github/workflows/prepare_mkdocs.sh create mode 100644 CONTRIBUTING.md diff --git a/.circleci/config.yml b/.circleci/config.yml index a020a98e8..3e02c57c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,23 +86,6 @@ jobs: steps: - checkout - run: sudo npm install -g @misk/cli && miskweb ci-build -e - docs: - machine: - image: circleci/classic:latest - parallelism: 1 - steps: - - checkout # check out source code to working directory - - run: | # mkdocs wants to be run with Python 3, force the path to prioritize pyenv 3.5.2 - pyenv global 3.5.2 - export PATH="/opt/circleci/.pyenv/versions/3.5.2/lib/:$PATH" - pip install mkdocs mkdocs-material - - run: | - ./gradlew dokka - - run: | - cat README.md | grep -v 'project website' > docs/index.md - cp CHANGELOG.md docs/changelog.md - cp RELEASING.md docs/releasing.md - - run: mkdocs build workflows: version: 2 on_commit: @@ -113,13 +96,10 @@ workflows: only: master - java - node -# Disabling this for now since it is breaking due to the python 2 -> 3 migration -# - docs nightly: jobs: - java - node - - docs triggers: - schedule: # midnight mountain time in UTC diff --git a/.github/workflows/Publish-Website.yml b/.github/workflows/Publish-Website.yml new file mode 100644 index 000000000..ce42c3179 --- /dev/null +++ b/.github/workflows/Publish-Website.yml @@ -0,0 +1,45 @@ +name: Publish the mkdocs to gh-pages + +on: + pull_request: + push: + branches: + - master + +env: + GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" + +jobs: + deploy-website: + runs-on: ubuntu-latest + + steps: + - name: Checkout the repo + uses: actions/checkout@v2 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Configure JDK + uses: actions/setup-java@v1 + with: + java-version: 14 + + - name: Prep mkdocs + run: .github/workflows/prepare_mkdocs.sh + + - name: Build mkdocs + run: | + pip3 install mkdocs-macros-plugin + mkdocs build + + - name: Deploy 🚀 + if: success() && github.ref == 'refs/heads/master' + uses: JamesIves/github-pages-deploy-action@releases/v3 + with: + GITHUB_TOKEN: ${{ secrets.GH_CLIPPY_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: site # The folder the action should deploy. + SINGLE_COMMIT: true diff --git a/.github/workflows/prepare_mkdocs.sh b/.github/workflows/prepare_mkdocs.sh new file mode 100755 index 000000000..80d31dd75 --- /dev/null +++ b/.github/workflows/prepare_mkdocs.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# The website is built using MkDocs with the Material theme. +# https://squidfunk.github.io/mkdocs-material/ +# It requires Python to run. +# Install the packages with the following command: +# pip install mkdocs mkdocs-material + +set -ex + +# Generate the API docs +./gradlew dokka + +# Dokka filenames like `-http-url/index.md` don't work well with MkDocs tags. +# Assign metadata to the file's first Markdown heading. +# https://www.mkdocs.org/user-guide/writing-your-docs/#meta-data +title_markdown_file() { + TITLE_PATTERN="s/^[#]+ *(.*)/title: \1 - Backfila/" + echo "---" > "$1.fixed" + cat $1 | sed -E "$TITLE_PATTERN" | grep "title: " | head -n 1 >> "$1.fixed" + echo "---" >> "$1.fixed" + echo >> "$1.fixed" + cat $1 >> "$1.fixed" + mv "$1.fixed" "$1" +} + +set +x +for MARKDOWN_FILE in $(find docs/0.x/ -name '*.md'); do + echo $MARKDOWN_FILE + title_markdown_file $MARKDOWN_FILE +done +set -x + +# Copy in special files that GitHub wants in the project root. +cat README.md | grep -v 'project website' > docs/index.md +cp CHANGELOG.md docs/changelog.md +cp CONTRIBUTING.md docs/contributing.md +cp RELEASING.md docs/releasing.md \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..7a5f5ee89 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,13 @@ +# Contributing + +If you would like to contribute code to this project you can do so through GitHub by +forking the repository and sending a pull request. + +When submitting code, please make every effort to follow existing conventions +and style in order to keep the code as readable as possible. + +Before your code can be accepted into the project you must also sign the +[Individual Contributor License Agreement (CLA)][1]. + + + [1]: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1 \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 00d058f07..9c5b67257 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -43,5 +43,6 @@ nav: - 'client': 0.x/client/index.md - 'client-service': 0.x/client-misk/index.md - 'Change Log': changelog.md + - 'Contributing': contributing.md - 'Releasing': releasing.md - - 'Stack Overflow ⏏': https://stackoverflow.com/questions/tagged/backfila?sort=active \ No newline at end of file + - 'Stack Overflow ⏏': https://stackoverflow.com/questions/tagged/backfila?sort=active