commit
c7b0aa4afa
4 changed files with 79 additions and 2 deletions
42
.github/workflows/release-docker-image.yml
vendored
Normal file
42
.github/workflows/release-docker-image.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
name: Release Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
-
|
||||||
|
name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract Tag Version
|
||||||
|
id: tag_version
|
||||||
|
run: |
|
||||||
|
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v}
|
||||||
|
|
||||||
|
- name: Echo Tag Version
|
||||||
|
run: echo ${{ steps.tag_version.outputs.VERSION }}
|
||||||
|
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ secrets.DOCKER_HUB_USERNAME }}/compose-viz:latest
|
||||||
|
${{ secrets.DOCKER_HUB_USERNAME }}/compose-viz:${{ steps.tag_version.outputs.VERSION }}
|
||||||
|
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/compose-viz:buildcache
|
||||||
|
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/compose-viz:buildcache,mode=max
|
35
Dockerfile
Normal file
35
Dockerfile
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
FROM python:alpine3.16 as builder
|
||||||
|
|
||||||
|
COPY ./ /compose-viz/
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apk update && \
|
||||||
|
pip install --upgrade pip
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apk add binutils alpine-sdk libffi-dev
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
pip install poetry && \
|
||||||
|
pip install pyinstaller
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
cd /compose-viz && \
|
||||||
|
poetry config virtualenvs.create false && \
|
||||||
|
poetry install --no-root
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
cd /compose-viz && \
|
||||||
|
pyinstaller --onefile --name cpv ./compose_viz/__main__.py
|
||||||
|
|
||||||
|
FROM alpine:3.16 as release
|
||||||
|
|
||||||
|
COPY --from=builder /compose-viz/dist/cpv /usr/local/bin/cpv
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apk add --no-cache graphviz ttf-droid
|
||||||
|
|
||||||
|
VOLUME [ "/in" ]
|
||||||
|
WORKDIR "/in"
|
||||||
|
|
||||||
|
ENTRYPOINT [ "cpv" ]
|
|
@ -1,2 +1,2 @@
|
||||||
__app_name__ = "compose_viz"
|
__app_name__ = "compose_viz"
|
||||||
__version__ = "0.2.0"
|
__version__ = "0.2.1"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "compose-viz"
|
name = "compose-viz"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
description = "A compose file visualization tool that supports compose-spec and allows you to gernerate graph in several formats."
|
description = "A compose file visualization tool that supports compose-spec and allows you to gernerate graph in several formats."
|
||||||
authors = ["Xyphuz Wu <xyphuzwu@gmail.com>"]
|
authors = ["Xyphuz Wu <xyphuzwu@gmail.com>"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
Loading…
Reference in a new issue