diff --git a/icons/README.md b/icons/README.md index 20c8effbc..582e52b5e 100644 --- a/icons/README.md +++ b/icons/README.md @@ -2,7 +2,15 @@ These icons are a way to standardize Kubernetes architecture diagrams for presentation. Having uniform architecture diagrams improve understandibility. -## Generate png icons from svg +## Tools + +```shell +./tools/update-everything.sh +``` + +This script generates png from svg, and Visio Stencil from png. + +### Generate png icons from svg ```shell ./tools/rasterize.sh @@ -10,9 +18,19 @@ These icons are a way to standardize Kubernetes architecture diagrams for presen This script will convert all svg into png. It's based on a docker container defined [here](hack/svgconvertor/Dockefile) +### Generate Visio Stencil from png icons + +```shell +./tools/update-visio.sh +``` + +This script will convert png icons into Visio stencil using project from [here](https://github.com/hoveytechllc/visio-stencil-creator) + +A Docker image hosted on GCR (`k8s.gcr.io/visio-stencil-creator`), is used to generate the Visio stencil file. The script [./tools/build-visio-stencil-creator.sh](./tools/build-visio-stencil-creator.sh) can be used to update the Docker image if it needs to be built. + ## How to use these icons -Each icons can be found in differents formats +Each icon can be found in differents formats * [png](png) * [svg](svg) diff --git a/icons/tools/build-visio-stencil-creator.sh b/icons/tools/build-visio-stencil-creator.sh new file mode 100644 index 000000000..94e707a1c --- /dev/null +++ b/icons/tools/build-visio-stencil-creator.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +GITHUB_ORG="hoveytechllc" +REPO_NAME="visio-stencil-creator" +TAG_NAME="v1.0" + +GCR_REPO="gcr.k8s.io/${REPO_NAME}:${TAG_NAME}" + +rm -fdr ./tools/${REPO_NAME} + +# Clone repository in current path +git clone --branch release/${TAG_NAME} https://github.com/${GITHUB_ORG}/${REPO_NAME}.git ./tools/${REPO_NAME} + +# build image using Dockerfile from github repository +# Tag resulting image for pushing to k8s.gcr.io +docker build \ + -t ${GCR_REPO} \ + -f ./tools/${REPO_NAME}/Dockerfile \ + ./tools/${REPO_NAME} + +# Clean up source code +rm -fdr ./tools/${REPO_NAME} + +docker push ${GCR_REPO} \ No newline at end of file diff --git a/icons/tools/update-everything.sh b/icons/tools/update-everything.sh new file mode 100755 index 000000000..da7ed4d92 --- /dev/null +++ b/icons/tools/update-everything.sh @@ -0,0 +1,4 @@ +#/bin/bash + +./tools/rasterize.sh +./tools/update-visio.sh \ No newline at end of file diff --git a/icons/tools/update-visio.sh b/icons/tools/update-visio.sh new file mode 100755 index 000000000..05b50c14a --- /dev/null +++ b/icons/tools/update-visio.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +ICONS_PATH=${PWD} +DOCKER_IMAGE_REPO="k8s.gcr.io/visio-stencil-creator:v1.0" + +# Run docker image that generates Visio stencil +# using png images. +docker run \ + -v ${ICONS_PATH}:/app/content \ + ${DOCKER_IMAGE_REPO} \ + "--image-pattern=**/labeled/*-256.png" \ + "--image-path=/app/content/png" \ + "--output-filename=/app/content/visio/kubernetes-visio-stencil.vssx" diff --git a/icons/visio/kubernetes-visio-stencil.vssx b/icons/visio/kubernetes-visio-stencil.vssx new file mode 100644 index 000000000..eba36a703 Binary files /dev/null and b/icons/visio/kubernetes-visio-stencil.vssx differ