Skip to content

Commit

Permalink
ci/tools: Add tarball unpacker
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>

Signed-off-by: phlax <[email protected]>
  • Loading branch information
phlax committed Oct 2, 2023
1 parent d3a226c commit 27b19f8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
6 changes: 3 additions & 3 deletions api/bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "envoy_toolshed",
project_desc = "Tooling, libraries, runners and checkers for Envoy proxy's CI",
project_url = "https://github.com/envoyproxy/toolshed",
version = "0.0.9",
sha256 = "f1a2169d271efbf4de2b24207136c5009c5453fba62ba8dc3497cba204d092aa",
version = "0.0.10",
sha256 = "bdfcf0a23c18a99887ac25761aa56d85bedb6eda77c89f9f19e6142b812749b9",
strip_prefix = "toolshed-bazel-v{version}/bazel",
urls = ["https://github.com/envoyproxy/toolshed/archive/bazel-v{version}.tar.gz"],
use_category = ["build"],
release_date = "2023-09-28",
release_date = "2023-10-02",
cpe = "N/A",
license = "Apache-2.0",
license_url = "https://github.com/envoyproxy/envoy/blob/bazel-v{version}/LICENSE",
Expand Down
10 changes: 6 additions & 4 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,6 @@ case $CI_TARGET in
setup_clang_toolchain
echo "generating docs..."
# Build docs.
# We want the binary at the end
BAZEL_BUILD_OPTIONS+=(--remote_download_toplevel)
[[ -z "${DOCS_OUTPUT_DIR}" ]] && DOCS_OUTPUT_DIR=generated/docs
rm -rf "${DOCS_OUTPUT_DIR}"
mkdir -p "${DOCS_OUTPUT_DIR}"
Expand All @@ -661,8 +659,12 @@ case $CI_TARGET in
bazel "${BAZEL_STARTUP_OPTIONS[@]}" build "${BAZEL_BUILD_OPTIONS[@]}" //docs:rst
cp bazel-bin/docs/rst.tar.gz "$DOCS_OUTPUT_DIR"/envoy-docs-rst.tar.gz
fi
bazel "${BAZEL_STARTUP_OPTIONS[@]}" build "${BAZEL_BUILD_OPTIONS[@]}" //docs:html
tar -xzf bazel-bin/docs/html.tar.gz -C "$DOCS_OUTPUT_DIR"
DOCS_OUTPUT_DIR="$(realpath "$DOCS_OUTPUT_DIR")"
bazel "${BAZEL_STARTUP_OPTIONS[@]}" run \
"${BAZEL_BUILD_OPTIONS[@]}" \
--//tools/tarball:target=//docs:html \
//tools/tarball:unpack \
"$DOCS_OUTPUT_DIR"
;;

docs-upload)
Expand Down
7 changes: 4 additions & 3 deletions mobile/docs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ rm -rf "${DOCS_OUTPUT_DIR}"
mkdir -p "${DOCS_OUTPUT_DIR}"
DOCS_OUTPUT_DIR="$(realpath "$DOCS_OUTPUT_DIR")"

./bazelw build "$DOCS_TARGET"

tar xf bazel-bin/docs/html.tar.gz -C "$DOCS_OUTPUT_DIR" .
./bazelw run \
"--@envoy//tools/tarball:target=$DOCS_TARGET" \
@envoy//tools/tarball:unpack \
"$DOCS_OUTPUT_DIR"
7 changes: 5 additions & 2 deletions mobile/docs/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ git -C "${MOBILE_DOCS_CHECKOUT_DIR}" config user.name "envoy-mobile-docs(ci)"
git -C "${MOBILE_DOCS_CHECKOUT_DIR}" config user.email [email protected]
echo 'add'
git -C "${MOBILE_DOCS_CHECKOUT_DIR}" add .
echo 'commit'
git -C "${MOBILE_DOCS_CHECKOUT_DIR}" commit -m "docs envoy-mobile@$BUILD_SHA"

if [[ "$(git -C "${MOBILE_DOCS_CHECKOUT_DIR}" status --porcelain)" ]]; then
echo 'commit'
git -C "${MOBILE_DOCS_CHECKOUT_DIR}" commit -m "docs envoy-mobile@$BUILD_SHA"
fi
8 changes: 8 additions & 0 deletions tools/tarball/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@envoy_toolshed//tarball:macros.bzl", "unpacker")

licenses(["notice"]) # Apache 2

unpacker(
name = "unpack",
zstd = "//tools/zstd",
)

0 comments on commit 27b19f8

Please sign in to comment.