Skip to content

Commit 69cadd8

Browse files
authored
Dockerfile (#16)
* Dockerfile for deployment added
1 parent 0c34fae commit 69cadd8

7 files changed

Lines changed: 24 additions & 8 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ jobs:
3636
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3737
- name: Test with pytest
3838
env:
39-
TEST_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
39+
TEST_CONFIGURATION_ACCESS_TOKEN: ${{ secrets.TEST_CONFIGURATION_ACCESS_TOKEN }}
4040
run: |
4141
pytest

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Usage:
2+
# docker build github.com/aspose-barcode-cloud/aspose-barcode-cloud-python -t barcode-cloud-python:$(git describe --tags)
3+
# docker run barcode-cloud-python:$(git describe --tags) publish -e "TEST_CONFIGURATION_ACCESS_TOKEN=" -e "TWINE_PASSWORD="
4+
5+
FROM python:latest
6+
7+
WORKDIR /aspose-barcode-cloud-python
8+
COPY . .
9+
10+
RUN pip install -r publish-requirements.txt
11+
RUN echo '[pypi]\nusername = __token__\npassword = ${TWINE_PASSWORD}' > $HOME/.pypirc
12+
13+
ENTRYPOINT ["make"]
14+
CMD ["publish"]

example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
config = Configuration(
99
client_id="Client Id from https://dashboard.aspose.cloud/applications",
1010
client_secret="Client Secret from https://dashboard.aspose.cloud/applications",
11-
access_token=os.environ.get("TEST_ACCESS_TOKEN") # Only for testing in CI, remove this line
11+
access_token=os.environ.get("TEST_CONFIGURATION_ACCESS_TOKEN") # Only for testing in CI, remove this line
1212
)
1313

1414
api = BarcodeApi(ApiClient(config))

publish-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tox
2+
setuptools
3+
twine

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
certifi >= 14.05.14
1+
certifi >= 2017.4.17
2+
python-dateutil >= 2.1
23
six >= 1.10
3-
python_dateutil >= 2.5.3
4-
setuptools >= 21.0.0
5-
urllib3 >= 1.15.1
4+
urllib3 >= 1.23

tests/load_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
logger = logging.getLogger(__name__)
1111

1212
DEFAULT_CONFIG_FILENAME = os.path.join(os.path.split(os.path.abspath(__file__))[0], "configuration.json")
13-
DEFAULT_ENV_PREFIX = "TEST"
13+
DEFAULT_ENV_PREFIX = "TEST_CONFIGURATION"
1414

1515

1616
def from_file(filename):

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
envlist = py27, py3
33

44
[testenv]
5-
passenv = TEST_ACCESS_TOKEN
5+
passenv = TEST_CONFIGURATION_ACCESS_TOKEN
66
deps=-r{toxinidir}/requirements.txt
77
-r{toxinidir}/test-requirements.txt
88

0 commit comments

Comments
 (0)