diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..6809701 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,73 @@ +image: docker:latest + + +# When using dind, it's wise to use the overlayfs driver for +# improved performance. +variables: + DOCKER_DRIVER: overlay + DOCKERFILE: Dockerfile + +stages: + - test + - images + - release + +.test: &test_definition + variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.eggs" + cache: + paths: + - .eggs/ + key: "$CI_PROJECT_NAME" + stage: test + script: + - python setup.py test + +test-3.5: + <<: *test_definition + image: "python:3.5" + +test-3.4: + <<: *test_definition + image: "python:3.4" + +test-2.7: + <<: *test_definition + image: "python:2.7" + + +.image: &image_definition + variables: + PYTHON_VERSION: "3.5" + before_script: + - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY + script: + - docker build -f Dockerfile-3.5 . -t $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG-$PYTHON_VERSION + - docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG-$PYTHON_VERSION + stage: images + only: + - tags + - triggers + +image-3.5: + <<: *image_definition + variables: + PYTHON_VERSION: "3.5" + +image-2.7: + <<: *image_definition + variables: + PYTHON_VERSION: "2.7" + +image-latest: + stage: release + before_script: + - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY + script: + - docker build -f Dockerfile . -t $CI_REGISTRY_IMAGE + - docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG + - docker push $CI_REGISTRY_IMAGE + - docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG + only: + - master + - triggers \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 10d2ca8..28b33b0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,6 @@ include requirements.txt include test-requirements.txt -include README.md -include senpy/context.jsonld +include README.rst include senpy/VERSION graft senpy/plugins graft senpy/schemas diff --git a/Makefile b/Makefile index b86fcd9..802bc29 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ REPO=gsiupm VERSION=$(shell cat $(NAME)/VERSION) TARNAME=$(NAME)-$(subst -,.,$(VERSION)).tar.gz IMAGENAME=$(REPO)/$(NAME):$(VERSION) +TEST_COMMAND=gitlab-runner exec docker --cache-dir=/tmp/gitlabrunner --docker-volumes /tmp/gitlabrunner:/tmp/gitlabrunner --env CI_PROJECT_NAME=$(NAME) all: build run @@ -39,8 +40,8 @@ debug-%: debug: debug-$(PYMAIN) -test-%: build-% - docker run --rm -w /usr/src/app/ --entrypoint=/usr/local/bin/python -ti '$(IMAGENAME)-python$*' setup.py test --addopts "-vvv -s" ; +test-%: + $(TEST_COMMAND) test-$* dist/$(TARNAME): docker run --rm -ti -v $$PWD:/usr/src/app/ -w /usr/src/app/ python:$(PYMAIN) python setup.py sdist; diff --git a/senpy/VERSION b/senpy/VERSION index faef31a..967e82c 100644 --- a/senpy/VERSION +++ b/senpy/VERSION @@ -1 +1 @@ -0.7.0 +0.7.1-dev1