Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

chore: move samples from python-docs-sample #28

Merged
merged 118 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
37d3f63
Cloud iot core [(#946)](https://github.com/GoogleCloudPlatform/python…
gguuss May 25, 2017
3c2b6c8
Adds tests, CLI, and fixes some tiny bugs. [(#973)](https://github.co…
gguuss Jun 2, 2017
20424e6
Auto-update dependencies. [(#1005)](https://github.com/GoogleCloudPla…
dpebot Jun 28, 2017
10d8af9
Auto-update dependencies. [(#1011)](https://github.com/GoogleCloudPla…
dpebot Jul 13, 2017
3e9221d
Auto-update dependencies. [(#1047)](https://github.com/GoogleCloudPla…
dpebot Aug 2, 2017
367ebbd
Auto-update dependencies. [(#1055)](https://github.com/GoogleCloudPla…
dpebot Aug 7, 2017
1f703f1
Gets API key, project ID, and service account JSON from environment […
gguuss Aug 9, 2017
438e87d
Auto-update dependencies. [(#1094)](https://github.com/GoogleCloudPla…
dpebot Aug 30, 2017
df3efdd
Changes for snippets [(#1105)](https://github.com/GoogleCloudPlatform…
gguuss Sep 12, 2017
f37d82a
Auto-update dependencies. [(#1109)](https://github.com/GoogleCloudPla…
dpebot Sep 13, 2017
ae0356b
Update all generated readme auth instructions [(#1121)](https://githu…
Sep 18, 2017
a2f75ea
Auto-update dependencies. [(#1133)](https://github.com/GoogleCloudPla…
dpebot Sep 21, 2017
0ad6027
Final additions in private beta [(#1136)](https://github.com/GoogleCl…
gguuss Sep 26, 2017
7293840
Removes API key because discovery is now public [(#1140)](https://git…
gguuss Sep 27, 2017
ef32d09
Added Link to Python Setup Guide [(#1158)](https://github.com/GoogleC…
Oct 12, 2017
eefa331
Auto-update dependencies. [(#1186)](https://github.com/GoogleCloudPla…
dpebot Nov 1, 2017
bfbabb0
Updates pubsub client [(#1195)](https://github.com/GoogleCloudPlatfor…
gguuss Nov 3, 2017
31ed8e4
Fix linter errors
andrewsg Nov 9, 2017
450139a
Merge pull request #1209 from andrewsg/flake8
andrewsg Nov 9, 2017
0a61f3c
Auto-update dependencies. [(#1208)](https://github.com/GoogleCloudPla…
dpebot Nov 9, 2017
a46e685
Auto-update dependencies. [(#1217)](https://github.com/GoogleCloudPla…
dpebot Nov 15, 2017
524b937
Auto-update dependencies. [(#1239)](https://github.com/GoogleCloudPla…
dpebot Nov 30, 2017
19a30a8
Updated the certificate [(#1251)](https://github.com/GoogleCloudPlatf…
Dec 6, 2017
028499b
Added "Open in Cloud Shell" buttons to README files [(#1254)](https:/…
Dec 7, 2017
6bff0fd
Adds set-config to manager sample [(#1275)](https://github.com/Google…
gguuss Dec 14, 2017
53bdf32
Auto-update dependencies. [(#1282)](https://github.com/GoogleCloudPla…
dpebot Jan 2, 2018
13bf638
Auto-update dependencies. [(#1309)](https://github.com/GoogleCloudPla…
dpebot Jan 10, 2018
7fffab2
Add sample to get config versions for a device. [(#1310)](https://git…
noerog Jan 11, 2018
54cc0e6
Trivial fix to Cloud IoT URL. [(#1302)](https://github.com/GoogleClou…
postmasters Jan 16, 2018
29522a8
Auto-update dependencies. [(#1320)](https://github.com/GoogleCloudPla…
dpebot Feb 2, 2018
ae27ec3
Adds IAM examples for Python. [(#1318)](https://github.com/GoogleClou…
gguuss Feb 5, 2018
8540289
MQTT Exponential backoff and manager updates [(#1345)](https://github…
gguuss Feb 6, 2018
da55d5a
Auto-update dependencies. [(#1355)](https://github.com/GoogleCloudPla…
dpebot Feb 9, 2018
efb3bc2
Auto-update dependencies. [(#1359)](https://github.com/GoogleCloudPla…
dpebot Feb 26, 2018
a653948
Cleanup Cloud IoT region tags.
jmdobry Feb 28, 2018
267b4c3
Adds region to examples [(#1378)](https://github.com/GoogleCloudPlatf…
gguuss Mar 19, 2018
ed90210
Auto-update dependencies.
dpebot Apr 2, 2018
ae157a8
Regenerate the README files and fix the Open in Cloud Shell link for …
Apr 7, 2018
ccb73ef
fixes iot_list_registries closing region tag [(#1434)](https://github…
bshaffer Apr 12, 2018
87e6260
Update READMEs to fix numbering and add git clone [(#1464)](https://g…
frankyn Apr 26, 2018
80b00a0
Resolved conflicts.
michaelawyu Jun 29, 2018
0a7f3fe
Merge branch 'dpebot-repositorygardener' despite flaky dataproc tests
michaelawyu Jun 29, 2018
8aaf2d7
Updates dependencies [(#1713)](https://github.com/GoogleCloudPlatform…
gguuss Sep 25, 2018
d90b81d
Auto-update dependencies. [(#1846)](https://github.com/GoogleCloudPla…
dpebot Nov 20, 2018
9b4205b
Updates library versions and tests [(#1884)](https://github.com/Googl…
gguuss Dec 4, 2018
98e824d
Better reliability for flaky tests [(#1960)](https://github.com/Googl…
gguuss Jan 10, 2019
0041556
Migrates manager samples for Gateways from beta folder [(#1973)](http…
gguuss Jan 22, 2019
e59b92e
Migrates Gateway code to MQTT example [(#1977)](https://github.com/Go…
gguuss Jan 28, 2019
4255398
Auto-update dependencies. [(#1980)](https://github.com/GoogleCloudPla…
dpebot Feb 6, 2019
6983ce0
Remove stale test registries to avoid reaching limits [(#2159)](https…
gguuss May 20, 2019
495b446
Fix IoT parameters [(#2320)](https://github.com/GoogleCloudPlatform/p…
gguuss Aug 12, 2019
6bee98a
Fix list devices in IoT sample [(#2319)](https://github.com/GoogleClo…
gguuss Aug 12, 2019
5011209
iot: switch to Cloud Client [(#2418)](https://github.com/GoogleCloudP…
gguuss Sep 26, 2019
2de8f00
Updates create / delete device methods to use Cloud client library [(…
gguuss Oct 7, 2019
469e6e8
Adds split updates for Firebase ... opencensus [(#2438)](https://gith…
gguuss Oct 8, 2019
751b20a
Cloud client library migration for registry management features [(#24…
gguuss Oct 10, 2019
4a7c281
Adds cloud client for remaining Cloud IoT Core apis [(#2479)](https:/…
gguuss Oct 18, 2019
b57115d
Cleanly disconnect client before JWT expiration. [(#2622)](https://gi…
gguuss Dec 17, 2019
67eef12
Auto-update dependencies. [(#2005)](https://github.com/GoogleCloudPla…
dpebot Dec 21, 2019
ee6d939
Replaces empty return value with string [(#2709)](https://github.com/…
gguuss Jan 10, 2020
b64eaad
chore(deps): update dependency google-auth to v1.11.2 [(#2724)](https…
leahecole Mar 5, 2020
384509f
Iot flaky tests [(#3068)](https://github.com/GoogleCloudPlatform/pyth…
gguuss Mar 10, 2020
8ddc936
chore(deps): update dependency google-cloud-iot to v0.3.1 [(#3159)](h…
renovate-bot Mar 27, 2020
29099af
chore(deps): update dependency google-cloud-iot to v1 [(#3209)](https…
renovate-bot Mar 30, 2020
39e2c84
Simplify noxfile setup. [(#2806)](https://github.com/GoogleCloudPlatf…
kurtisvg Apr 2, 2020
78dcd8a
Adds example parameters [(#3102)](https://github.com/GoogleCloudPlatf…
gguuss Apr 3, 2020
0aa9cf9
Remove oauth2client from IoT and Functions samples [(#3255)](https://…
busunkim96 Apr 3, 2020
8e6dbe7
[iot] fix: mitigate flaky tests [(#3299)](https://github.com/GoogleCl…
Apr 8, 2020
3c7dadf
Update dependency google-auth to v1.14.0 [(#3148)](https://github.com…
renovate-bot Apr 17, 2020
393be3e
chore(deps): update dependency google-api-python-client to v1.8.0 [(#…
renovate-bot Apr 17, 2020
3752102
[iot] testing: re-raise the exception [(#3425)](https://github.com/Go…
Apr 17, 2020
fc638e6
chore(deps): update dependency cryptography to v2.9 [(#3266)](https:/…
renovate-bot Apr 22, 2020
6c6cf17
Update dependency google-cloud-pubsub to v1.4.2 in functions and IoT …
busunkim96 Apr 22, 2020
b8161a5
chore(deps): update dependency cryptography to v2.9.1 [(#3463)](https…
renovate-bot Apr 22, 2020
eb00265
Update dependency cryptography to v2.9.2 [(#3473)](https://github.com…
renovate-bot Apr 23, 2020
21fee9d
Update dependency google-api-python-client to v1.8.2 [(#3452)](https:…
renovate-bot Apr 24, 2020
f4cd6c2
chore(deps): update dependency google-auth to v1.14.1 [(#3464)](https…
renovate-bot Apr 28, 2020
64f7fd8
Add example command for docs [(#3708)](https://github.com/GoogleCloud…
gguuss May 8, 2020
9dfd97e
chore(deps): update dependency google-auth to v1.14.2 [(#3724)](https…
renovate-bot May 11, 2020
fd81c39
chore: some lint fixes [(#3747)](https://github.com/GoogleCloudPlatfo…
May 12, 2020
826e6fc
chore(deps): update dependency google-cloud-pubsub to v1.4.3 [(#3725)…
renovate-bot May 13, 2020
3b34dec
chore(deps): update dependency google-auth to v1.14.3 [(#3728)](https…
renovate-bot May 13, 2020
b556f85
update google-auth to 1.15.0 part 5 [(#3818)](https://github.com/Goog…
leahecole May 19, 2020
b503f6e
update google-api-python-client to 1.8.3 part 4 [(#3826)](https://git…
leahecole May 19, 2020
5dc8234
chore(deps): update dependency google-cloud-pubsub to v1.5.0 [(#3781)…
renovate-bot May 21, 2020
a99e0a0
chore(deps): update dependency google-api-python-client to v1.8.4 [(#…
renovate-bot May 27, 2020
39dd89d
chore(deps): update dependency google-auth to v1.16.0 [(#3903)](https…
renovate-bot May 28, 2020
8e25b42
chore(deps): update dependency google-api-python-client to v1.9.1 [(#…
renovate-bot Jun 2, 2020
98a25ed
update google-auth part 5 [(#3966)](https://github.com/GoogleCloudPla…
leahecole Jun 4, 2020
f328549
testing: start using btlr [(#3959)](https://github.com/GoogleCloudPla…
Jun 9, 2020
0d5d07b
Replace GCLOUD_PROJECT with GOOGLE_CLOUD_PROJECT. [(#4022)](https://g…
kurtisvg Jun 9, 2020
7a8dd35
Update dependency google-api-python-client to v1.9.2 [(#4038)](https:…
renovate-bot Jun 10, 2020
4c56eb8
Update dependency google-auth to v1.17.0 [(#4058)](https://github.com…
renovate-bot Jun 11, 2020
d6974f7
chore(deps): update dependency google-auth to v1.17.1 [(#4073)](https…
renovate-bot Jun 12, 2020
023959c
Update dependency google-auth to v1.17.2 [(#4083)](https://github.com…
renovate-bot Jun 12, 2020
aa8fae7
Update dependency google-api-python-client to v1.9.3 [(#4057)](https:…
renovate-bot Jun 12, 2020
18852d1
Update dependency google-auth to v1.18.0 [(#4125)](https://github.com…
renovate-bot Jun 19, 2020
35f5a3e
Update dependency google-cloud-pubsub to v1.6.0 [(#4039)](https://git…
renovate-bot Jun 20, 2020
1465b0c
chore(deps): update dependency google-cloud-pubsub to v1.6.1 [(#4242)…
renovate-bot Jul 6, 2020
b93b7d1
chore(deps): update dependency flaky to v3.7.0 [(#4263)](https://gith…
renovate-bot Jul 8, 2020
b89a03a
Update dependency google-auth-httplib2 to v0.0.4 [(#4255)](https://gi…
renovate-bot Jul 9, 2020
9f429a8
chore(deps): update dependency pytest to v5.4.3 [(#4279)](https://git…
renovate-bot Jul 12, 2020
d8749db
chore(deps): update dependency google-auth to v1.19.0 [(#4293)](https…
renovate-bot Jul 13, 2020
a6613ae
chore(deps): update dependency google-cloud-pubsub to v1.7.0 [(#4290)…
renovate-bot Jul 14, 2020
51934fb
Update dependency google-api-python-client to v1.10.0 [(#4302)](https…
renovate-bot Jul 16, 2020
45f85b2
chore(deps): update dependency google-auth to v1.19.1 [(#4304)](https…
renovate-bot Jul 17, 2020
85eb454
chore(deps): update dependency google-auth to v1.19.2 [(#4321)](https…
renovate-bot Jul 18, 2020
8353982
chore(deps): update dependency cryptography to v3 [(#4337)](https://g…
renovate-bot Jul 21, 2020
fd44267
Update dependency google-auth to v1.20.0 [(#4387)](https://github.com…
renovate-bot Jul 28, 2020
f051c8d
Update dependency pytest to v6 [(#4390)](https://github.com/GoogleClo…
renovate-bot Aug 1, 2020
77b981e
chore(deps): update dependency google-auth to v1.20.1 [(#4452)](https…
renovate-bot Aug 7, 2020
101f23f
chore(deps): update dependency google-api-python-client to v1.10.1 [(…
renovate-bot Aug 27, 2020
82de852
Update dependency google-auth to v1.21.0 [(#4588)](https://github.com…
renovate-bot Aug 27, 2020
dcc77ee
Update dependency google-api-python-client to v1.11.0 [(#4587)](https…
renovate-bot Aug 28, 2020
73db86c
Update dependency cryptography to v3.1 [(#4571)](https://github.com/G…
renovate-bot Aug 28, 2020
06ed25e
Merge branch 'api-client-manager-samples' into add-api-client-manager…
arithmetic1728 Sep 9, 2020
bdec6cd
chore: update templates
arithmetic1728 Sep 9, 2020
244a3a5
chore: add files from mqtt_example
arithmetic1728 Sep 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Code owners file.
# This file controls who is tagged for review for any given pull request.
#
# For syntax help see:
# https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax


/samples/**/*.py @gguuss @googleapis/python-samples-owners
Empty file added .github/snippet-bot.yml
Empty file.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pip-log.txt
# Built documentation
docs/_build
bigquery/docs/generated
docs.metadata

# Virtual environment
env/
Expand All @@ -57,4 +58,4 @@ system_tests/local_test_setup

# Make sure a generated file isn't accidentally committed.
pylintrc
pylintrc.test
pylintrc.test
8 changes: 7 additions & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ python3.6 -m pip uninstall --yes --quiet nox-automation
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version

python3.6 -m nox
# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
else
python3.6 -m nox
fi
98 changes: 98 additions & 0 deletions .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# 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
#
# 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.

from ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

# Ensure local Python is preferred over distribution Python.
ENV PATH /usr/local/bin:$PATH

# Install dependencies.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
build-essential \
ca-certificates \
curl \
dirmngr \
git \
gpg-agent \
graphviz \
libbz2-dev \
libdb5.3-dev \
libexpat1-dev \
libffi-dev \
liblzma-dev \
libreadline-dev \
libsnappy-dev \
libssl-dev \
libsqlite3-dev \
portaudio19-dev \
redis-server \
software-properties-common \
ssh \
sudo \
tcl \
tcl-dev \
tk \
tk-dev \
uuid-dev \
wget \
zlib1g-dev \
&& add-apt-repository universe \
&& apt-get update \
&& apt-get -y install jq \
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -f /var/cache/apt/archives/*.deb


COPY fetch_gpg_keys.sh /tmp
# Install the desired versions of Python.
RUN set -ex \
&& export GNUPGHOME="$(mktemp -d)" \
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \
&& /tmp/fetch_gpg_keys.sh \
&& for PYTHON_VERSION in 3.7.8 3.8.5; do \
wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \
&& rm -r python-${PYTHON_VERSION}.tar.xz.asc \
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \
&& rm python-${PYTHON_VERSION}.tar.xz \
&& cd /usr/src/python-${PYTHON_VERSION} \
&& ./configure \
--enable-shared \
# This works only on Python 2.7 and throws a warning on every other
# version, but seems otherwise harmless.
--enable-unicode=ucs4 \
--with-system-ffi \
--without-ensurepip \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
; done \
&& rm -rf "${GNUPGHOME}" \
&& rm -rf /usr/src/python* \
&& rm -rf ~/.cache/

RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
&& python3.7 /tmp/get-pip.py \
&& python3.8 /tmp/get-pip.py \
&& rm /tmp/get-pip.py

CMD ["python3.7"]
45 changes: 45 additions & 0 deletions .kokoro/docker/docs/fetch_gpg_keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/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
#
# 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.

# A script to fetch gpg keys with retry.
# Avoid jinja parsing the file.
#

function retry {
if [[ "${#}" -le 1 ]]; then
echo "Usage: ${0} retry_count commands.."
exit 1
fi
local retries=${1}
local command="${@:2}"
until [[ "${retries}" -le 0 ]]; do
$command && return 0
if [[ $? -ne 0 ]]; then
echo "command failed, retrying"
((retries--))
fi
done
return 1
}

# 3.6.9, 3.7.5 (Ned Deily)
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D

# 3.8.0 (Łukasz Langa)
retry 3 gpg --keyserver ha.pool.sks-keyservers.net --recv-keys \
E3FF2839C048B25C084DEBE9B26995E310250568

#
21 changes: 19 additions & 2 deletions .kokoro/docs/common.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ action {
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

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

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-multi"
value: "gcr.io/cloud-devrel-kokoro-resources/python-lib-docs"
}
env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
Expand All @@ -28,6 +28,23 @@ env_vars: {
value: "docs-staging"
}

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

# 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 {
Expand Down
17 changes: 17 additions & 0 deletions .kokoro/docs/docs-presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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"
}
39 changes: 24 additions & 15 deletions .kokoro/publish-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,16 @@ set -eo pipefail
# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

cd github/python-iot

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation
export PATH="${HOME}/.local/bin:${PATH}"

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

# build docs
nox -s docs

python3 -m pip install gcp-docuploader

# install a json parser
sudo apt-get update
sudo apt-get -y install software-properties-common
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get -y install jq
python3 -m pip install --user gcp-docuploader

# create metadata
python3 -m docuploader create-metadata \
Expand All @@ -52,4 +42,23 @@ python3 -m docuploader create-metadata \
cat docs.metadata

# upload docs
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket docs-staging
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}"
Loading