Skip to content

Commit

Permalink
feat: Production Ready Docker Image
Browse files Browse the repository at this point in the history
  • Loading branch information
achillesrasquinha committed Jan 14, 2019
1 parent 1774e2d commit 50fd1bd
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 20 deletions.
12 changes: 11 additions & 1 deletion .dockerignore
@@ -1,2 +1,12 @@
.git
.venv
.venv
.vscode
ci
docker/pipupgrade
.appveyor.yml
.env
.gitignore
.releasrc
.travis.yml
Makefile
tox.ini
20 changes: 15 additions & 5 deletions .travis.yml
Expand Up @@ -2,11 +2,15 @@ language: python

python:
- "2.7"
# - "3.3" # Too many problems with setuptools compatibility, try distutils instead?
- "3.4"
- "3.5"
- "3.6"
- "3.7-dev"

services:
- docker

env:
global:
- ENVIRONMENT=test
Expand All @@ -15,14 +19,14 @@ env:

install:
- sudo $TRAVIS_BUILD_DIR/ci/scripts/bash/install.sh
- VENVDIR=$VIRTUAL_ENV make install
- make install

script:
- VENVDIR=$VIRTUAL_ENV make test
- make test

after_success:
- VENVDIR=$VIRTUAL_ENV make coverage
- npx semantic-release
- make coverage
- $TRAVIS_BUILD_DIR/ci/scripts/bash/release.sh

deploy:
provider: pypi
Expand All @@ -31,4 +35,10 @@ deploy:
secure: DxyaBiRgMiAZDshCiERWpg/CEtGzqNDvBJPNUPWmapxkpsWFx/n9gLqJW9774q0GmcPim15HvwJ9Wu6QRmsKAZ2lAXb7dxU1UcJh2YJVZvnJFiUg4ycil9eSxyhIz6RwHzKVzHCbzHgxyVhVvdEKaeLqy7FojEbJ4EUyJnp1+0i2SEP0t1urM5yShosHyYX9wkXTsUJ2NnwM5onboJZq3WYLyPfSXLdk9ylbvh0cRiuMZl5irxBsdrz0pxQXiDWjfti93qToe6CisNUO5ImdBZAB4/sbG510CUoQHY1/AGSzysPNp88PMK4jrfNRwlKkopTOLswnfoJO7rmTsbB2R2CoBq7CpQW/GgsOwdHPODwOC9ionROYHBrNmeAWKtDlXZL757qZnCHRYP4CXBKPcDVZfpae25eezrwaISYKDlV3HDUaLODv0GqmvVNQaABrMt7kZ9zPDP0M7aXR/n+YFYkjQgW8LJUtWxhNrYXPmX+oNJA6os1Pet0w9iT+oC4QeYpTojO9dKuvFSglFuSqwVVbeK5CSKlsA5OBDgsYFK4PZK4+JxV+jnZ/Fb6AjEj7/4FR/bAeO/hkNfqmUsOLOKRp09soyJRtx0qw7BSwe9rEA7pL7TCa5aB0RAEDwYiNuf+JRe9sPUEE7fhcqA2zM7YP+sHpfgzm59ouDh4XLME=
on:
tags: true
skip_existing: true
skip_existing: true

deploy:
provider: script
script: $TRAVIS_BUILD_DIR/ci/scripts/bash/deploy.sh
on:
branch: master
9 changes: 9 additions & 0 deletions AUTHORS.md
@@ -0,0 +1,9 @@
### Authors

#### Maintainers

* Achilles Rasquinha <achillesrasquinha@gmail.com>

#### Contributors

* Achilles Rasquinha <achillesrasquinha@gmail.com>
4 changes: 1 addition & 3 deletions Dockerfile
Expand Up @@ -13,8 +13,6 @@ RUN pip install $PIPUPGRADEPATH

WORKDIR $PIPUPGRADEPATH

COPY ./docker/docker-entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
ENTRYPOINT ["/usr/local/src/pipupgrade/docker/entrypoint.sh"]

CMD ["pipupgrade"]
12 changes: 6 additions & 6 deletions Makefile
Expand Up @@ -10,10 +10,10 @@ PROJECT = pipupgrade
PROJDIR = ${BASEDIR}/src/pipupgrade
TESTDIR = ${BASEDIR}/tests

PYTHONPATH ?= $(shell command -v python)
PYTHONPATH ?= python

VENVDIR ?= ${BASEDIR}/.venv
VENVBIN = ${VENVDIR}/bin
VIRTUAL_ENV ?= ${BASEDIR}/.venv
VENVBIN = ${VIRTUAL_ENV}/bin

PYTHON = ${VENVBIN}/python
IPYTHON = ${VENVBIN}/ipython
Expand Down Expand Up @@ -58,8 +58,8 @@ ifneq (${VERBOSE},true)
$(eval OUT = > /dev/null)
endif

$(call log,INFO,Creating a Virtual Environment ${VENVDIR} with Python - ${PYTHONPATH})
@virtualenv $(VENVDIR) -p $(PYTHONPATH) $(OUT)
$(call log,INFO,Creating a Virtual Environment ${VIRTUAL_ENV} with Python - ${PYTHONPATH})
@virtualenv $(VIRTUAL_ENV) -p $(PYTHONPATH) $(OUT)

info: ## Display Information
@echo "Python Environment: ${PYTHON_ENVIRONMENT}"
Expand Down Expand Up @@ -136,7 +136,7 @@ bump: ## Bump Version
git add $(PROJDIR)/VERSION
git commit -m "Bumped to Version $(VERSION)"

release: test build ## Create a Release
release: test build ## Create a Release (DEPRECATED - Use auto-deploy using .travis.yml)
ifeq (${ENVIRONMENT},development)
$(call log,WARN,Ensure your environment is in production mode.)
$(TWINE) upload --repository-url https://test.pypi.org/legacy/ $(BASEDIR)/dist/*
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -42,7 +42,7 @@
* [Usage](#usage)
* [License](#license)

### Features
#### Features
* Updates system packages and local packages.
* Updates packages mentioned within a `requirements.txt` file (Also pins upto-date versions if mentioned).
* Detects semantic version to avoid updates that break changes.
Expand All @@ -55,7 +55,7 @@
$ pip install pipupgrade
```

### Usage
#### Usage

<div align="center">
<img src=".github/assets/demo.gif">
Expand Down Expand Up @@ -85,7 +85,7 @@ optional arguments:
-h, --help Show this help message and exit
```

### License
#### License

This repository has been released under the [MIT License](LICENSE).

Expand Down
3 changes: 3 additions & 0 deletions ci/scripts/bash/deploy.sh
@@ -0,0 +1,3 @@
if [[ "$TRAVIS_BRANCH" == "master" ]]; then
# do something
fi
3 changes: 3 additions & 0 deletions ci/scripts/bash/release.sh
@@ -0,0 +1,3 @@
if [[ "$TRAVIS_BRANCH" == "master" ]]; then
npx semantic-release
fi
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pipupgrade/__attr__.py
Expand Up @@ -63,7 +63,7 @@ def get_revision(path, short = False, raise_err = True):

__name__ = "pipupgrade"
__command__ = "pipupgrade"
__version__ = read(path["version"])
__version__ = strip(read(path["version"]))
__build__ = get_revision(pardir(path["base"], 2), short = True, raise_err = False)
__url__ = "https://github.com/achillesrasquinha/pipupgrade"
__author__ = "Achilles Rasquinha"
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -12,4 +12,4 @@ deps =
pip10: pip >= 10.0
pip18: pip >= 18.0
commands =
pytest {toxinidir}/tests
pytest {toxinidir}/tests --cov ${envsitepackagesdir}/pipupgrade

0 comments on commit 50fd1bd

Please sign in to comment.