Skip to content

Commit ebdd3ef

Browse files
authored
Smaller and better Docker images (#16)
1 parent 0010f60 commit ebdd3ef

File tree

6 files changed

+32
-99
lines changed

6 files changed

+32
-99
lines changed

.circleci/config.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
version: 2
22
jobs:
3-
test:
3+
build:
44
docker:
55
- image: dataworld/pyenv-tox
66

@@ -22,27 +22,28 @@ jobs:
2222
name: tox
2323
command: tox --pre
2424

25-
- persist_to_workspace:
26-
root: .
27-
paths:
28-
- ./*
29-
3025
- save_cache:
3126
key: tox_cache-{{ checksum "tox.ini" }}
3227
paths:
3328
- .eggs
3429
- .tox
3530

36-
pypi-release:
31+
- run:
32+
name: build dist
33+
command: python setup.py sdist bdist_wheel --universal
34+
35+
- store_artifacts:
36+
path: ./dist
37+
destination: dist
3738

39+
pypi-release:
3840
docker:
3941
- image: dataworld/pyenv-tox
4042

4143
working_directory: /root/target-datadotworld
4244

4345
steps:
44-
- attach_workspace:
45-
at: /root/target-datadotworld
46+
- checkout
4647

4748
- run:
4849
name: build dist
@@ -59,21 +60,17 @@ jobs:
5960
working_directory: /root/target-datadotworld
6061

6162
steps:
62-
- attach_workspace:
63-
at: /root/target-datadotworld
64-
65-
- run:
66-
name: define PACKAGE_VERSION
67-
command: |
68-
echo "export PACKAGE_VERSION=$(python -c "import pkg_resources; print(pkg_resources.get_distribution('target-datadotworld').version)")" >> $BASH_ENV
69-
source $BASH_ENV
63+
- checkout
7064

7165
- setup_remote_docker:
7266
docker_layer_caching: true
7367

7468
- run:
75-
name: docker setup
76-
command: curl -sSL https://get.docker.com/ | sh
69+
name: define PACKAGE_VERSION
70+
command: |
71+
PACKAGE_VERSION=$(python setup.py -V)
72+
echo "export PACKAGE_VERSION=$PACKAGE_VERSION" >> $BASH_ENV
73+
source $BASH_ENV
7774
7875
- run:
7976
name: docker build
@@ -88,20 +85,20 @@ jobs:
8885
8986
workflows:
9087
version: 2
91-
test-double-release:
88+
build-and-release:
9289
jobs:
93-
- test
90+
- build
9491
- pypi-release:
9592
filters:
9693
branches:
9794
only:
9895
- release
9996
requires:
100-
- test
97+
- build
10198
- docker-release:
10299
filters:
103100
branches:
104101
only:
105102
- release
106103
requires:
107-
- test
104+
- build

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.cache
2+
.circleci
3+
.eggs
4+
.idea
5+
.pytest_cache
6+
.tox
7+
dist
8+
*.egg-info

.pytest_cache/v/cache/lastfailed

Lines changed: 0 additions & 3 deletions
This file was deleted.

.pytest_cache/v/cache/nodeids

Lines changed: 0 additions & 69 deletions
This file was deleted.

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM python:latest
1+
FROM python:3.6-alpine
22

3-
ADD . /code
4-
WORKDIR /code
3+
ADD . /app
4+
WORKDIR /app
55

66
RUN pip install .
77
CMD ["target-datadotworld"]

target_datadotworld/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121

2222
import singer
2323

24-
__version__ = '1.0.0'
24+
__version__ = '1.0.1'
2525

2626
logger = copy(singer.get_logger()) # copy needed in order to set level

0 commit comments

Comments
 (0)