-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STREAM-94: Add Pipenv support. Dockerize wheels. Push on tags.
- Loading branch information
Showing
11 changed files
with
506 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
venv/ | ||
.venv/ | ||
.idea/ | ||
build/ | ||
streamingcli.egg-info/ | ||
tmp_project/ | ||
requirements.txt | ||
docker-compose.yml | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ dist/ | |
build/ | ||
streamingcli.egg-info/ | ||
tmp_project/ | ||
requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,65 @@ | ||
image: python:latest | ||
variables: | ||
DOCKER_TAG: "${CI_COMMIT_SHA}" | ||
|
||
run: | ||
stages: | ||
- build | ||
- package | ||
- ship | ||
|
||
image: python:3.9 | ||
|
||
whl: | ||
stage: build | ||
before_script: | ||
- pip install pipenv | ||
- pipenv lock -r > requirements.txt | ||
script: | ||
- pip install twine | ||
- python setup.py sdist bdist_wheel | ||
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* | ||
artifacts: | ||
paths: | ||
- dist/* | ||
|
||
.dockerize: | ||
stage: package | ||
services: | ||
- docker:19.03.13-dind | ||
image: docker:19.03.13 | ||
needs: | ||
- whl | ||
|
||
dockerize: | ||
extends: | ||
.dockerize | ||
script: | ||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY | ||
- docker build --pull -t "$CI_REGISTRY_IMAGE:$DOCKER_TAG" . | ||
- docker push "$CI_REGISTRY_IMAGE:$DOCKER_TAG" | ||
only: | ||
- branches | ||
|
||
docker-sign: | ||
extends: | ||
.dockerize | ||
script: | ||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY | ||
- docker pull "$CI_REGISTRY_IMAGE:$DOCKER_TAG" | ||
- docker tag "$CI_REGISTRY_IMAGE:$DOCKER_TAG" "$CI_REGISTRY_IMAGE:${CI_COMMIT_TAG}" | ||
- docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_TAG}" | ||
- docker tag "$CI_REGISTRY_IMAGE:$DOCKER_TAG" "$CI_REGISTRY_IMAGE:latest" | ||
- docker push "$CI_REGISTRY_IMAGE:latest" | ||
only: | ||
- tags | ||
|
||
pypi: | ||
stage: ship | ||
before_script: | ||
- pip install pipenv twine | ||
- pipenv lock -r > requirements.txt | ||
script: | ||
- python setup.py verify | ||
- TWINE_USERNAME="gitlab-ci-token" TWINE_PASSWORD="${CI_JOB_TOKEN}" | ||
python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/* | ||
needs: | ||
- whl | ||
rules: | ||
- if: "$CI_COMMIT_TAG" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.9-alpine | ||
|
||
RUN set -ex && \ | ||
apk add --no-cache git | ||
|
||
COPY ./dist/*.whl . | ||
|
||
RUN set -ex && \ | ||
python3 -m pip install *.whl | ||
|
||
ENTRYPOINT ["scli"] | ||
|
||
WORKDIR /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
click = "*" | ||
kubernetes = "*" | ||
dataclasses-json = "*" | ||
GitPython = "*" | ||
PyYAML = "*" | ||
Jinja2 = "*" | ||
setuptools = "*" | ||
|
||
[dev-packages] | ||
|
||
[requires] | ||
python_version = "3.9" |
Oops, something went wrong.