Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add docs build kokoro config for django spanner #644

Merged
merged 21 commits into from Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a3f23a0
docs: added trampoline v2 file and docs config for kokoro
vi3k6i5 Jun 15, 2021
a89c019
Merge branch 'master' into docs
vi3k6i5 Jun 15, 2021
26e5c97
fix: change library_type to INTEGRATION
vi3k6i5 Jun 15, 2021
85e92cc
docs: add kokoro docker build for docs
vi3k6i5 Jun 15, 2021
bbf2282
Merge branch 'master' of github.com:googleapis/python-spanner-django …
vi3k6i5 Jun 15, 2021
305a78c
Merge branch 'docs' of github.com:vi3k6i5/python-spanner-django into …
vi3k6i5 Jun 15, 2021
c1c2e6a
fix:repo metadata
vi3k6i5 Jun 15, 2021
074e1f9
fix: updated PROJECT_ROOT for django spanner docs build using kokoro
vi3k6i5 Jun 15, 2021
975298c
fix: remove sudo apt update because sudo is not allowed
vi3k6i5 Jun 15, 2021
5d86b7f
fix: add build_nox.sh as original build.sh file is used by kokoro wor…
vi3k6i5 Jun 15, 2021
79a0d62
refactor: renamed build_nox.sh to build-nox.sh
vi3k6i5 Jun 15, 2021
d27017f
refactor: change build-nox to nox.sh
vi3k6i5 Jun 16, 2021
851a4ac
refactor: change build-nox to nox.sh
vi3k6i5 Jun 16, 2021
e37957c
refactor: change kokoro build to run different test for docs and diff…
vi3k6i5 Jun 16, 2021
ff4915b
refactor: change kokoro build to run different test for docs and diff…
vi3k6i5 Jun 16, 2021
b0ec9b2
refactor: add log msg for debugging
vi3k6i5 Jun 16, 2021
9457c20
refactor: remove log msg added for debugging
vi3k6i5 Jun 16, 2021
6666172
fix: correct docs build command
vi3k6i5 Jun 16, 2021
2cdaae7
refactor: remove unused nox file
vi3k6i5 Jun 16, 2021
61c4c88
feat: add .trampolinerc file
vi3k6i5 Jun 16, 2021
42edbdf
fix: correct repo_metadata release_level to beta
vi3k6i5 Jun 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 65 additions & 0 deletions .kokoro/docs/common.cfg
@@ -0,0 +1,65 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-spanner-django/.kokoro/trampoline_v2.sh"

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-lib-docs"
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-spanner-django/.kokoro/publish-docs.sh"
}

env_vars: {
key: "STAGING_BUCKET"
value: "docs-staging"
}

env_vars: {
key: "V2_STAGING_BUCKET"
value: "docs-staging-v2"
}

# It will upload the docker image after successful builds.
env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "true"
}

# It will always build the docker image.
env_vars: {
key: "TRAMPOLINE_DOCKERFILE"
value: ".kokoro/docker/docs/Dockerfile"
}

# Fetch the token needed for reporting release status to GitHub
before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "yoshi-automation-github-key"
}
}
}

before_action {
fetch_keystore {
keystore_resource {
keystore_config_id: 73713
keyname: "docuploader_service_account"
}
}
}
28 changes: 28 additions & 0 deletions .kokoro/docs/docs-presubmit.cfg
@@ -0,0 +1,28 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "STAGING_BUCKET"
value: "gcloud-python-test"
}

env_vars: {
key: "V2_STAGING_BUCKET"
value: "gcloud-python-test"
}

# We only upload the image in the main `docs` build.
env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-spanner-django/.kokoro/build.sh"
}

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "docs docfx"
}
1 change: 1 addition & 0 deletions .kokoro/docs/docs.cfg
@@ -0,0 +1 @@
# Format: //devtools/kokoro/config/proto/build.proto
64 changes: 64 additions & 0 deletions .kokoro/publish-docs.sh
@@ -0,0 +1,64 @@
#!/bin/bash
# Copyright 2020 Google LLC
#
# 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
#
# https://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.

set -eo pipefail

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

export PATH="${HOME}/.local/bin:${PATH}"

# Install nox
python3 -m pip install --user --upgrade --quiet nox
python3 -m nox --version

# build docs
nox -s docs

python3 -m pip install --user gcp-docuploader

# create metadata
python3 -m docuploader create-metadata \
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
--version=$(python3 setup.py --version) \
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
--distribution-name=$(python3 setup.py --name) \
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)

cat docs.metadata

# upload docs
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket "${STAGING_BUCKET}"


# docfx yaml files
nox -s docfx

# create metadata.
python3 -m docuploader create-metadata \
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
--version=$(python3 setup.py --version) \
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
--distribution-name=$(python3 setup.py --name) \
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)

cat docs.metadata

# upload docs
python3 -m docuploader upload docs/_build/html/docfx_yaml --metadata-file docs.metadata --destination-prefix docfx --staging-bucket "${V2_STAGING_BUCKET}"