Skip to content

Commit

Permalink
feat: Install a local .tar.gz in docker to allow testing and more rel…
Browse files Browse the repository at this point in the history
…iable releases.
  • Loading branch information
andrewjw committed Jul 9, 2024
1 parent fde0a0b commit 380a5ff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jobs:
- name: Test
run: |
./run_tests.sh
- name: Build Docker
run: |
python setup.py sdist
FILE=`ls dist/glowprom-*.tar.gz | cut -d- -f2`
TAG=${FILE%.tar.gz} ./docker_build.sh
release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -66,5 +71,5 @@ jobs:
twine check dist/*
TWINE_USERNAME=__token__ TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }} twine upload dist/*
GH_TOKEN=${{ secrets.GITHUB_TOKEN }} semantic-release publish
DOCKER_TOKEN=${{ secrets.DOCKER_TOKEN }} TAG=$VERSION ./docker_push.sh
DOCKER_TOKEN=${{ secrets.DOCKER_TOKEN }} TAG=$VERSION ./docker_build.sh --push
fi
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ FROM python:3.12

ARG VERSION

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh && rustup toolchain install -y stable
COPY dist/glowprom-$VERSION.tar.gz /

RUN pip install glowprom==$VERSION
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

RUN pip install /glowprom-$VERSION.tar.gz

ENTRYPOINT ["glowprom"]
CMD []
4 changes: 2 additions & 2 deletions docker_push.sh → docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -e

sudo docker login --username andrewjw --password $DOCKER_TOKEN
#sudo docker login --username andrewjw --password $DOCKER_TOKEN

sudo docker buildx create --use

sudo docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 \
--build-arg VERSION=$TAG \
-t andrewjw/glowprom:$TAG \
-t andrewjw/glowprom:latest \
--push .
$1 .

0 comments on commit 380a5ff

Please sign in to comment.