Skip to content

Commit 9ea7ef6

Browse files
Integrate Python GAPIC Microgenerator in googleapis. This PR uses using documentai as an example. Depends on googleapis/gapic-generator-python#402
PiperOrigin-RevId: 309824146 Source-Author: Google APIs <noreply@google.com> Source-Date: Mon May 4 15:06:44 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: e0f9d9e1f9de890db765be46f45ca8490723e3eb Source-Link: googleapis/googleapis@e0f9d9e
1 parent 0a1dd94 commit 9ea7ef6

27 files changed

+2873
-1588
lines changed

.kokoro/build.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,4 @@ python3.6 -m pip uninstall --yes --quiet nox-automation
3636
python3.6 -m pip install --upgrade --quiet nox
3737
python3.6 -m nox --version
3838

39-
# If NOX_SESSION is set, it only runs the specified session,
40-
# otherwise run all the sessions.
41-
if [[ -n "${NOX_SESSION:-}" ]]; then
42-
python3.6 -m nox -s "${NOX_SESSION:-}"
43-
else
44-
python3.6 -m nox
45-
fi
39+
python3.6 -m nox

.kokoro/docs/common.cfg

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ action {
1111
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
1212

1313
# Use the trampoline script to run in docker.
14-
build_file: "python-logging/.kokoro/trampoline_v2.sh"
14+
build_file: "python-logging/.kokoro/trampoline.sh"
1515

1616
# Configure the docker image for kokoro-trampoline.
1717
env_vars: {
1818
key: "TRAMPOLINE_IMAGE"
19-
value: "gcr.io/cloud-devrel-kokoro-resources/python-lib-docs"
19+
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
2020
}
2121
env_vars: {
2222
key: "TRAMPOLINE_BUILD_FILE"
@@ -28,23 +28,6 @@ env_vars: {
2828
value: "docs-staging"
2929
}
3030

31-
env_vars: {
32-
key: "V2_STAGING_BUCKET"
33-
value: "docs-staging-v2-staging"
34-
}
35-
36-
# It will upload the docker image after successful builds.
37-
env_vars: {
38-
key: "TRAMPOLINE_IMAGE_UPLOAD"
39-
value: "true"
40-
}
41-
42-
# It will always build the docker image.
43-
env_vars: {
44-
key: "TRAMPOLINE_DOCKERFILE"
45-
value: ".kokoro/docker/docs/Dockerfile"
46-
}
47-
4831
# Fetch the token needed for reporting release status to GitHub
4932
before_action {
5033
fetch_keystore {

.kokoro/publish-docs.sh

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,35 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
#!/bin/bash
17+
1618
set -eo pipefail
1719

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

21-
export PATH="${HOME}/.local/bin:${PATH}"
23+
cd github/python-logging
24+
25+
# Remove old nox
26+
python3.6 -m pip uninstall --yes --quiet nox-automation
2227

2328
# Install nox
24-
python3 -m pip install --user --upgrade --quiet nox
25-
python3 -m nox --version
29+
python3.6 -m pip install --upgrade --quiet nox
30+
python3.6 -m nox --version
2631

2732
# build docs
2833
nox -s docs
2934

30-
python3 -m pip install --user gcp-docuploader
35+
python3 -m pip install gcp-docuploader
3136

32-
# create metadata
33-
python3 -m docuploader create-metadata \
34-
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
35-
--version=$(python3 setup.py --version) \
36-
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
37-
--distribution-name=$(python3 setup.py --name) \
38-
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
39-
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
40-
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)
37+
# install a json parser
38+
sudo apt-get update
39+
sudo apt-get -y install software-properties-common
40+
sudo add-apt-repository universe
41+
sudo apt-get update
42+
sudo apt-get -y install jq
4143

42-
cat docs.metadata
43-
44-
# upload docs
45-
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket "${STAGING_BUCKET}"
46-
47-
48-
# docfx yaml files
49-
nox -s docfx
50-
51-
# create metadata.
44+
# create metadata
5245
python3 -m docuploader create-metadata \
5346
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
5447
--version=$(python3 setup.py --version) \
@@ -61,4 +54,4 @@ python3 -m docuploader create-metadata \
6154
cat docs.metadata
6255

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

.kokoro/release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
#!/bin/bash
17+
1618
set -eo pipefail
1719

1820
# Start the releasetool reporter

0 commit comments

Comments
 (0)