Skip to content

Commit 4d21e3a

Browse files
build(java): generate docfx yml on release
* feat: generate docfx yml on release * fix: updates name variable * fix: remove non needed resource * fix: update date Source-Author: Emily Ball <[email protected]> Source-Date: Mon Feb 1 15:24:59 2021 -0800 Source-Repo: googleapis/synthtool Source-Sha: 5de29e9434b63ea6d7e46dc348521c62969af1a1 Source-Link: googleapis/synthtool@5de29e9
1 parent c295eac commit 4d21e3a

File tree

4 files changed

+89
-5
lines changed

4 files changed

+89
-5
lines changed

.kokoro/release/publish_javadoc.cfg

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,4 @@ before_action {
2626
keyname: "docuploader_service_account"
2727
}
2828
}
29-
}
30-
31-
# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/<doclet name>
32-
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx"
29+
}

.kokoro/release/publish_javadoc11.cfg

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "STAGING_BUCKET_V2"
5+
value: "docs-staging-v2"
6+
# Production will be at: docs-staging-v2
7+
}
8+
9+
# Configure the docker image for kokoro-trampoline
10+
env_vars: {
11+
key: "TRAMPOLINE_IMAGE"
12+
value: "gcr.io/cloud-devrel-kokoro-resources/java11"
13+
}
14+
15+
env_vars: {
16+
key: "TRAMPOLINE_BUILD_FILE"
17+
value: "github/java-memcache/.kokoro/release/publish_javadoc11.sh"
18+
}
19+
20+
before_action {
21+
fetch_keystore {
22+
keystore_resource {
23+
keystore_config_id: 73713
24+
keyname: "docuploader_service_account"
25+
}
26+
}
27+
}
28+
29+
# Downloads docfx doclet resource. This will be in ${KOKORO_GFILE_DIR}/<doclet name>
30+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/docfx"

.kokoro/release/publish_javadoc11.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
# Copyright 2021 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
if [[ -z "${CREDENTIALS}" ]]; then
19+
CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account
20+
fi
21+
22+
if [[ -z "${STAGING_BUCKET_V2}" ]]; then
23+
echo "Need to set STAGING_BUCKET_V2 environment variable"
24+
exit 1
25+
fi
26+
27+
# work from the git root directory
28+
pushd $(dirname "$0")/../../
29+
30+
# install docuploader package
31+
python3 -m pip install gcp-docuploader
32+
33+
# compile all packages
34+
mvn clean install -B -q -DskipTests=true
35+
36+
export NAME=google-http-client
37+
export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)
38+
39+
# V3 generates docfx yml from javadoc
40+
# generate yml
41+
mvn clean site -B -q -P docFX
42+
43+
pushd target/docfx-yml
44+
45+
# create metadata
46+
python3 -m docuploader create-metadata \
47+
--name ${NAME} \
48+
--version ${VERSION} \
49+
--language java
50+
51+
# upload yml
52+
python3 -m docuploader upload . \
53+
--credentials ${CREDENTIALS} \
54+
--staging-bucket ${STAGING_BUCKET_V2} \
55+
--destination-prefix docfx-

synth.metadata

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"git": {
1212
"name": "synthtool",
1313
"remote": "https://github.com/googleapis/synthtool.git",
14-
"sha": "d1bb9173100f62c0cfc8f3138b62241e7f47ca6a"
14+
"sha": "5de29e9434b63ea6d7e46dc348521c62969af1a1"
1515
}
1616
}
1717
],
@@ -72,6 +72,8 @@
7272
".kokoro/release/promote.sh",
7373
".kokoro/release/publish_javadoc.cfg",
7474
".kokoro/release/publish_javadoc.sh",
75+
".kokoro/release/publish_javadoc11.cfg",
76+
".kokoro/release/publish_javadoc11.sh",
7577
".kokoro/release/snapshot.cfg",
7678
".kokoro/release/snapshot.sh",
7779
".kokoro/release/stage.cfg",

0 commit comments

Comments
 (0)