├── .github └── workflows │ └── default.yml ├── .gitignore ├── Makefile ├── README.md ├── hack └── converter.py.diff ├── scripts └── group.py └── snapshot.jpg /.github/workflows/default.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the main branch 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | schedule: 13 | - cron: "30 1 * * *" # run at 1:30 AM UTC 14 | 15 | # Allows you to run this workflow manually from the Actions tab 16 | workflow_dispatch: 17 | 18 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 19 | jobs: 20 | # This workflow contains a single job called "build" 21 | build: 22 | # The type of runner that the job will run on 23 | # matrix dosc: https://github.com/actions/runner-images/blob/ubuntu22/20221027.1/images/linux/Ubuntu2204-Readme.md 24 | runs-on: ubuntu-latest 25 | strategy: 26 | matrix: 27 | # python version docs: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json 28 | python-version: 29 | - 3.12.1 30 | 31 | # Steps represent a sequence of tasks that will be executed as part of the job 32 | steps: 33 | - name: Install packages 34 | run: sudo apt-get install -y moreutils librsvg2-bin 35 | 36 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 37 | - uses: actions/checkout@v2 38 | 39 | # python setup docs: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python 40 | - name: Set up Python ${{ matrix.python-version }} 41 | uses: actions/setup-python@v4 42 | with: 43 | python-version: ${{ matrix.python-version }} 44 | 45 | # Runs a single command using the runners shell 46 | - name: Run a one-line script 47 | run: | 48 | make install 49 | make patch 50 | make vendor 51 | make build 52 | 53 | - uses: actions/upload-artifact@v4 54 | with: 55 | name: cncf-stencil 56 | path: ./output/*.gstencil.zip 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | output 3 | build 4 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | source_git_url = "https://github.com/cncf/landscape.git" 2 | source_icons_version = "unknown" 3 | python_lib_path = $(shell pip3 show -f omnigraffle-stencil | grep Location | awk '{print $$2}') 4 | 5 | .PHONY: install 6 | install: 7 | pip3 install omnigraffle-stencil==1.1.0 8 | pip3 install pyyaml==6.0.1 9 | 10 | .PHONY: patch 11 | patch: 12 | patch $(python_lib_path)/omnigraffle_stencil/converter.py hack/converter.py.diff 13 | 14 | .PHONY: vendor 15 | vendor: 16 | mkdir -p vendor 17 | git clone --depth=1 $(source_git_url) vendor/landscape 18 | 19 | .PHONY: build 20 | build: source_icons_version=$(shell git -C vendor/landscape log --format="%h" hosted_logos | head -n 1) 21 | build: 22 | mkdir -p output 23 | mkdir -p build/hosted_logos 24 | mkdir -p build/final 25 | # height limits 26 | (cd vendor/landscape/hosted_logos && find . -name "*.svg" -exec rsvg-convert -h 96 -f svg {} -o ../../../build/hosted_logos/{} \;) 27 | # grouping 28 | python3 scripts/group.py 29 | # build stencil 30 | omnigraffle-stencil --svg build/final --stencil-file ./output/cncf-$(source_icons_version).gstencil 31 | zip -r ./output/cncf-$(source_icons_version).gstencil.zip ./output/cncf-$(source_icons_version).gstencil 32 | 33 | .PHONY: clean 34 | clean: 35 | rm -rf build 36 | rm -rf vendor 37 | pip3 uninstall -y omnigraffle-stencil 38 | pip3 install omnigraffle-stencil==1.1.0 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cncf-stencils 2 | 3 | Graffles stencils for CNCF projects. 4 | 5 | All icons comes from [cncf/landscape](https://github.com/cncf/landscape/) 6 | 7 | ![snapshot](https://github.com/alswl/cncf-stencils/blob/master/snapshot.jpg?raw=true) 8 | 9 | ## Downloads 10 | 11 | Latest artifacts in [Releases](https://github.com/alswl/cncf-stencils/releases). 12 | 13 | ## Build Required 14 | 15 | Python 3.9+ 16 | 17 | ## Build 18 | 19 | ``` 20 | make install patch vendor build 21 | ``` 22 | 23 | ## Change Logs 24 | 25 | - 2024-01-20 26 | - refactor for `cncf/landscape` l2 27 | - pyyaml version update 28 | - 2022-11-18 29 | - update CI for ubuntu 22.04 and python 3.10 30 | - 2022-01-28 31 | - resize all SVG images with height 96px limit(`96 = 12\*8`). 32 | - 2021-12-23 33 | - gropu logos with categories 34 | - add missing logos from `hosted_logos`, eg `dockerswarm.svg` 35 | - resize all SVG images with height 80px limit 36 | - 2021-12-21 37 | - resize all SVG images with height 120px limit 38 | - 2021-12-16 39 | - init this projects 40 | - it works 41 | -------------------------------------------------------------------------------- /hack/converter.py.diff: -------------------------------------------------------------------------------- 1 | @@ -43,7 +43,11 @@ 2 | 3 | for svg_path in images_in_group: 4 | image_idx += 1 5 | - pdf_image_path = save_image_as_pdf(svg_path, args.stencil_file, image_idx) 6 | + try: 7 | + pdf_image_path = save_image_as_pdf(svg_path, args.stencil_file, image_idx) 8 | + except: 9 | + print("convert error: " + svg_path) 10 | + continue 11 | stencil_name = create_name(svg_path, args.stencil_name_remove) 12 | sheet_image_bounds.append(calc_next_image_bounds(pdf_image_path, sheet_image_bounds)) 13 | image_pl = create_image_plist(image_pl_tpl, image_idx, stencil_name, sheet_image_bounds[-1], 14 | -------------------------------------------------------------------------------- /scripts/group.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | from shutil import copy2 3 | import os 4 | 5 | ROOT = '.' 6 | 7 | def copy(category, sub_category, logo): 8 | os.makedirs(os.path.join(ROOT, 'build', 'final', category + " > " + sub_category), exist_ok=True) 9 | 10 | src = os.path.join(ROOT, 'build/hosted_logos', logo) 11 | if not os.path.isfile(src): 12 | print('Not exist ' + src) 13 | return 14 | dest = os.path.join(ROOT, 'build', 'final', category + " > " + sub_category, logo) 15 | 16 | copy2(src, dest) 17 | 18 | def parse(): 19 | raw = '' 20 | with open('vendor/landscape/landscape.yml', 'r') as f: 21 | raw = f.read() 22 | config = yaml.load(raw, Loader=yaml.Loader) 23 | 24 | 25 | for c in config['landscape']: 26 | c_name = c['name'] 27 | print("processing " + c_name) 28 | for sub_c in c['subcategories']: 29 | sub_c_name = sub_c['name'] 30 | for i in sub_c['items']: 31 | logo = i['logo'] 32 | copy(c_name, sub_c_name, logo) 33 | 34 | 35 | if __name__ == '__main__': 36 | parse() 37 | -------------------------------------------------------------------------------- /snapshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alswl/cncf-stencils/7252480599943df86d32c90b8874ae1a321dae4d/snapshot.jpg --------------------------------------------------------------------------------