Skip to content

Commit

Permalink
#1 #2 package release tool
Browse files Browse the repository at this point in the history
  • Loading branch information
omenking committed May 16, 2022
1 parent 4cb85a0 commit 631448f
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
icons/png/*
build
build/*
.DS_STORE
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A K8s and Cloud-Native icon set for building cloud-native architecture diagrams
# Included Tools

- How to use the [SVG-to-PNG Conversion tool](docs/tools/svg-to-png.md) (supports any custom size)
- How to use the [Package Release tool](docs/tools/package-release.md) to aid in publishing new releases

# Icon Directory

Expand Down
34 changes: 34 additions & 0 deletions bin/package-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
set -e # stop the execution of a script if any of the steps fail

# This bash script expects a single argument which is the version name
# version names would be formatted as such eg. 1.0.1
if [ -z "$1" ]; then
echo "No version argument was supplied eg. 1.0.1"
echo "eg ./bin/package-release 1.0.1"
exit 1
fi

VERSION=$1

# Create a temporary build folder to store archives
mkdir -p build

echo "SVG — Package"
zip -j -r "build/k8s-icons-${VERSION}-svg.zip" icons/svg

echo "PNG 64px — Generate and Package"
./bin/svg-to-png.sh 64
zip -j -r "build/k8s-icons-${VERSION}-png-64px.zip" icons/png/64px

echo "PNG 128px — Generate and Package"
./bin/svg-to-png.sh 128
zip -j -r "build/k8s-icons-${VERSION}-png-128px.zip" icons/png/128px

echo "PNG 256px — Generate and Package"
./bin/svg-to-png.sh 256
zip -j -r "build/k8s-icons-${VERSION}-png-256px.zip" icons/png/256px

echo "PNG 512px — Generate and Package"
./bin/svg-to-png.sh 512
zip -j -r "build/k8s-icons-${VERSION}-png-512px.zip" icons/png/512px
36 changes: 36 additions & 0 deletions docs/tools/package-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Package Release Tool

The purpose of this tool is to help generate out common icon sizes and formats into downloadable archives which are then uploaded as releases on Github.

## How to run the tool

You need to supply a version number.

```
./bin/package-release 1.0.0
```

## Where to find the archives after running the tool

The icon archives will be generated in the `build` directory eg.

```
build/
k8s-icons-1.0.0-png64px.zip
k8s-icons-1.0.0-png128px.zip
k8s-icons-1.0.0-png256px.zip
k8s-icons-1.0.0-png512px.zip
k8s-icons-1.0.0-svg.zip
```

## Run in Gitpod

Gitpod is a Cloud Developer Environment (CDE) that allows you to quickly spin Visual Studio Code backed by a ephemeral container within your web-browser.

This repoistory contains a `.gitpod.yml' and it will automatically install the dependencies you need in order to run all tools for this repository.

Gitpod has a generous free tier.

You can follow this link in order to spin up a Gitpod environment for this repo:

[https://gitpod.io/#https://github.com/ExamProCo/Kubernetes-Architecture-Icons](https://github.com/ExamProCo/Kubernetes-Architecture-Icons)
2 changes: 1 addition & 1 deletion docs/tools/svg-to-png.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For example this will generate out all icons in 512px.
./bin/svg-to-png.sh 512
```

## Where to find the icons after runnign the tool
## Where to find the icons after running the tool

The icons will be generated in the follow directory `icons/png/${PIXEL_SIZE}px/`

Expand Down

0 comments on commit 631448f

Please sign in to comment.