Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
Add build process improvements and fixes (#221)
Browse files Browse the repository at this point in the history
* Add maximum versions for all dependencies

Add maximum supported versions for pytest-cov and cryptography
packages to ensure no build breakages in the future.

* move tests to separate Makefile target

* remove tests execution from regular image build
* add new Makefile target for tests, to execute run `make test`
* update Travis job configuration to reflect this change
  • Loading branch information
przemeklal authored and lmdaly committed Jan 10, 2019
1 parent 501c698 commit 77f784d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
.cache/*
.tox/*
cmk.egg-info/*
*.pyc
*/__pycache__/*
**/*.pyc
**/__pycache__/*
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
jobs:
include:
- stage: "Build and test"
script: make docker
script: make test
- stage: "Release"
before_script:
# Set up git user name and update remote origin
Expand Down
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ WORKDIR /cmk

RUN chmod +x /cmk/cmk.py

RUN tox -e lint
RUN tox -e unit
RUN tox -e integration
RUN tox -e coverage

RUN /cmk/cmk.py --help && echo ""

ENTRYPOINT [ "/cmk/cmk.py" ]
CMD [ "/cmk/cmk.py" ]
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

.PHONY: docker docs release
.PHONY: docker docs release test

all: docker

Expand All @@ -23,11 +23,15 @@ version=v1.3.0
jenkins: docker

docker:
docker build --no-cache -t cmk:$(version) .
docker build -t cmk:$(version) .
@echo ""
@echo "To run the docker image, run command:"
@echo "docker run -it cmk:$(version) ..."

test: docker
docker run --rm cmk:$(version) tox -e lint,unit,integration,coverage


# Output neatly formatted HTML docs to `docs/html`.
#
# This target uses `grip` (see https://github.com/joeyespo/grip).
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ pyinstaller>=3.2, <4.0
kubernetes==8.0.0
requests>=2.12, <3.0
pytest<=3.3.2
pytest-cov>=2.4.0
cryptography>=2.3
pytest-cov>=2.4.0, <2.6.1
cryptography>=2.3, <=2.4.2
yamlreader==3.0.4
pluggy>=0.5, <0.7
packaging==17.1

0 comments on commit 77f784d

Please sign in to comment.