Skip to content

Commit

Permalink
⚡️(circleci) use base python docker img to push pkgs
Browse files Browse the repository at this point in the history
Similarily to previous improvement, publishing a package to PyPI only
requires twine and configured environment variables. Let's make things
faster and simpler for such a simple task.
  • Loading branch information
jmaupetit committed Apr 11, 2019
1 parent 3815465 commit 17a9e13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
26 changes: 6 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -454,37 +454,23 @@ jobs:
# * you have define both the TWINE_USERNAME & TWINE_PASSWORD secret
# environment variables in CircleCI UI (with your PyPI credentials)
pypi:
machine: true
docker:
- image: circleci/python:3.7-stretch
working_directory: ~/fun
steps:
- checkout
- restore_cache:
keys:
- docker-debian-images-ci-{{ .Revision }}
- run:
name: Load images to docker engine
command: |
docker load < docker/images/dev/richie.tar
# Restore built python packages
- attach_workspace:
at: ~/fun
- run:
name: List built packages
command: ls dist/*
- run:
name: Install base requirements (twine)
command: pip install .[ci]
- run:
name: Upload built packages to PyPI
command: |
docker-compose \
-p richie-ci \
-f docker/compose/ci/postgresql/docker-compose.yml \
--project-directory . \
run --rm --no-deps \
--user="$(id -u)" \
--volume="$PWD:/app" \
-e TWINE_USERNAME \
-e TWINE_PASSWORD \
app \
twine upload dist/*
command: twine upload dist/*

# ---- DockerHub publication job ----
hub:
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ dev =
pytest-cov==2.6.1
pytest-django==3.4.8
responses==0.10.6
ci =
twine==1.13.0
sandbox =
django-configurations==2.1
Expand Down

0 comments on commit 17a9e13

Please sign in to comment.