Skip to content

Commit

Permalink
feat/connected by arrows,config (#11)
Browse files Browse the repository at this point in the history
* feat(core): add initial arrow implementation
* chore: remove unused code, simplify skip-deps logic
* feat(excalidraw): add ids and binding/bound structs
* feat(core): add group for the port, add naive arrow binding
* feat(core): add initial binding implementation
* fix(core): binding connections
* docs(core): update readme, add temp release
* fix(gh-actions): update version
* feat(core): add initial config support
* feat(core): enhance configuration file handling
* docs(readme): add info about config file
* feat(ci): add default config to image
* fix(ci): temp change for config file
* fix(ci): add config cli option
* fix(ci): minor adjustments
* fix(ci): restore commented steps
  • Loading branch information
etolbakov committed Jun 9, 2023
1 parent 060c43c commit 99459d0
Show file tree
Hide file tree
Showing 9 changed files with 422 additions and 147 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

env:
RUST_TOOLCHAIN: nightly-2023-05-03
BUILD_VERSION_PREFIX: v0.1.3
BUILD_VERSION_PREFIX: v0.1.4
CARGO_PROFILE: release

permissions:
Expand Down Expand Up @@ -194,6 +194,7 @@ jobs:
run: |
tar xvf amd64/excalidocker-linux-amd64.tgz -C amd64/ && rm amd64/excalidocker-linux-amd64.tgz
cp -r amd64 docker/ci
cp excalidocker-config.yaml docker/ci/amd64
- name: Download arm64 binary
id: download-arm64
Expand All @@ -207,6 +208,7 @@ jobs:
run: |
tar xvf arm64/excalidocker-linux-arm64.tgz -C arm64/ && rm arm64/excalidocker-linux-arm64.tgz
cp -r arm64 docker/ci
cp excalidocker-config.yaml docker/ci/arm64
- name: Build and push all
uses: docker/build-push-action@v3
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "excalidocker"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
authors = ["Evgeny Tolbakov"]
description = "Utility to convert your docker-compose into excalidraw"
Expand All @@ -18,6 +18,7 @@ serde_json = "^1.0"
serde_yaml = "0.9.21"
clap = {version = "4.0.32", features = ["derive"]}
thiserror = "1.0.40"
rand = "0.8.5"

[profile.release]
debug = false
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ clippy:
## 'i' - provided '--input-path' argument
## 'o' - provided '--output-path' argument
## 's' - provided '--skip-dependencies' argument
## 'c' - provided '--config-path' argument

e1i:
./target/release/excalidocker --input-path ./data/compose/docker-compose.yaml
Expand All @@ -55,3 +56,5 @@ d5i:
docker run --rm -v "$(current_dir)/data/compose/:/tmp/" -e INPUT_PATH=/tmp/docker-compose.yaml etolbakov/excalidocker:latest > produced-by-image.excalidraw
d5is:
docker run --rm -v "$(current_dir)/data/compose/:/tmp/" -e INPUT_PATH=/tmp/docker-compose.yaml -e SKIP_DEPS=true etolbakov/excalidocker:latest > produced-by-image-no-deps.excalidraw
d5ic:
docker run --rm -v "$(current_dir)/data/compose/:/tmp/" -v "$(current_dir)/excalidocker-config.yaml:/tmp/excalidocker-config.yaml" -e INPUT_PATH=/tmp/docker-compose.yaml -e CONFIG_PATH=/tmp/excalidocker-config.yaml etolbakov/excalidocker:latest > produced-by-image-config-deps.excalidraw
42 changes: 26 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
# excalidocker-rs
![GitHub release (latest by date)](https://img.shields.io/github/v/release/etolbakov/excalidocker-rs)

Rust-based utility to convert docker-compose.yaml files into [excalidraw](https://excalidraw.com/) files.
![excalidocker](./data/img/excalidocker.png)
![excalidocker](./data/img/excalidocker-colour.png)

# Table of Contents
1. [Motivation](#motivation)
2. [Usage](#usage)
3. [Installation](#installation)
4. [Contributing](#contributing)
5. [Roadmap](#roadmap)
Table of contents
=================
<!--ts-->
* [Motivation](#motivation)
* [Usage](#usage)
* [Docker image](#docker-image)
* [Artefact](#artefact)
* [Config file](#config-file)
* [Installation](#installation)
* [Contributing](#contributing)
* [Roadmap](#roadmap)
<!--te-->

## Motivation
An idea of writing this utility originates from Robin Moffatt's [tweet](https://twitter.com/rmoff/status/1659214185220423685).
![motivation](./data/img/motivation.png)

## Usage
### 🐳 Docker image
`excalidocker` is available as a [docker image](https://hub.docker.com/r/etolbakov/excalidocker/tags).
Convert docker-compose files without installing/building. Use it in Github actions for auto documentation.
The sky is the limit.Get the latest image from [docker hub](https://hub.docker.com/r/etolbakov/excalidocker):
### Docker image
🐳 `excalidocker` is available as a [docker image](https://hub.docker.com/r/etolbakov/excalidocker/tags).
Convert docker-compose files without hassle. Use it in Github actions for documentation, presentations, ADRs what have you
The sky is the limit. Get the latest image from [docker hub](https://hub.docker.com/r/etolbakov/excalidocker):
```sh
docker pull etolbakov/excalidocker
```
Usage example:
```sh
docker run --rm -v "$(pwd)/data/compose/:/tmp/" -e INPUT_PATH=/tmp/docker-compose.yaml etolbakov/excalidocker:latest > produced-by-image.excalidraw
```
The `produced-by-image.excalidraw` file could be opened in [excalidraw](https://excalidraw.com/) and.... hopefully it won't be too scary 👻 😅.
The `produced-by-image.excalidraw` file could be opened in [excalidraw](https://excalidraw.com/) and .... hopefully it won't be too scary 👻 😅.
More command examples are in the [Makefile](/Makefile).

### 📚Artifact
Download the latest artifact from [releases](https://github.com/etolbakov/excalidocker-rs/releases) and ungzip it.
### Artefact
📚 Download the latest artifact from [releases](https://github.com/etolbakov/excalidocker-rs/releases) and ungzip it.

To get the `help` menu use:
```sh
Expand All @@ -45,6 +53,7 @@ Options:
-i, --input-path <INPUT_PATH> file path to the docker-compose.yaml
-s, --skip-dependencies display connecting lines between services; if `true` then only service without the lines are rendered
-o, --output-path <OUTPUT_PATH> file path for the output excalidraw file. By default the file content is sent to console output
-c, --config-path <CONFIG_PATH> config file path for the excalidraw. [default: excalidocker-config.yaml]
-h, --help Print help
-V, --version Print version
```
Expand All @@ -62,6 +71,9 @@ Usage example:
> and you can open it in the future by double-clicking it just as you can any registered app.
>
> ![mac-warning](./data/img/mac-warning.png)
### Config file
`excalidocker` supports basic customization provided via file, for example [excalidocker-config.yaml](./excalidocker-config.yaml).
At the moment it's possible to customize font, fill type ("hachure","cross-hatch", "solid") and backgroud colours for services and ports.
## Installation
To build `excalidocker` locally, please follow these steps:
Expand All @@ -80,8 +92,6 @@ There is the `make r` command available in the [Makefile](/Makefile) along with
## Roadmap
These are the features that I would like to add at some point:
- 📊 visualize more data from a docker-compose file - volumes, network, etc
- 📜 [config file support](https://github.com/etolbakov/excalidocker-rs/issues/7)
- ↔️ [use arrows to connect boxes](https://github.com/etolbakov/excalidocker-rs/issues/6)
- 🦀 various code improvements/enhancements. Feel free to review/suggest if anything could be done better!
- 👨‍💻 etc
Expand Down
Binary file added data/img/excalidocker-colour.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions docker/ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
FROM ubuntu:22.04

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates && \
apt-get clean && \
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* && \
apt-get -y autoremove

# apt-get remove -y gcc && \

ARG TARGETARCH

ADD $TARGETARCH/excalidocker /excalidocker/bin/
COPY $TARGETARCH/excalidocker-config.yaml $TARGETARCH/excalidocker /excalidocker/bin/

ENV PATH /excalidocker/bin/:$PATH

CMD ["sh", "-c", "excalidocker --input-path ${INPUT_PATH} ${SKIP_DEPS:+ --skip-dependencies}"]
CMD ["sh", "-c", "excalidocker --input-path ${INPUT_PATH} ${SKIP_DEPS:+ --skip-dependencies} --config-path ${CONFIG_PATH:-/excalidocker/bin/excalidocker-config.yaml}"]
9 changes: 9 additions & 0 deletions excalidocker-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
font:
size: 16 # recommended S - 16,M - 20,L - 28, XL - 36
family: 1 # 1 - hand-drawn,2 - normal, 3- code
services:
background_color: "#b2f2bb"
fill: "hachure" # "hachure","cross-hatch", "solid"
ports:
background_color: "#a5d8ff"
fill: "hachure" # "hachure","cross-hatch", "solid"

0 comments on commit 99459d0

Please sign in to comment.