This repository has been archived by the owner on Aug 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
64 additions
and
41 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,13 @@ | ||
FROM registry.opensource.zalan.do/stups/python AS builder | ||
ARG VERSION | ||
RUN apt-get update && \ | ||
apt-get install -q -y python3-pip && \ | ||
pip3 install -U setuptools black | ||
COPY . /build | ||
WORKDIR /build | ||
RUN sed -i "s/__version__ = .*/__version__ = \"${VERSION}\"/" */__init__.py | ||
RUN python3 setup.py sdist bdist_wheel | ||
RUN tar xf /build/dist/*.tar.gz -C /tmp && cat /tmp/stups-piu*/PKG-INFO | egrep '^Version: ' | sed 's/Version: //' > /build/dist/.version | ||
|
||
FROM pierone.stups.zalan.do/teapot/python-cdp-release:latest | ||
COPY --from=builder /build/dist /pydist |
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,51 @@ | ||
version: "2017-09-20" | ||
pipeline: | ||
- id: build | ||
type: script | ||
overlay: ci/python | ||
commands: | ||
- desc: Check formatting | ||
cmd: | | ||
pip3 install black rstvalidator | ||
python3 -m rstvalidator README.rst | ||
black --check . | ||
- desc: Test | ||
cmd: python3 setup.py test | ||
- desc: Build the package | ||
cmd: | | ||
if [[ -z "${CDP_PULL_REQUEST_NUMBER}" ]]; then | ||
VERSION="1.2.${CDP_TARGET_BRANCH_COUNTER}" | ||
else | ||
VERSION="0.0.1-dev" | ||
fi | ||
DOCKER_IMAGE="pierone.stups.zalan.do/teapot/stups-piu-release:${CDP_TARGET_REPOSITORY_COUNTER}" | ||
docker build --build-arg VERSION="${VERSION}" -t "$DOCKER_IMAGE" . | ||
VERSION="$(docker run --entrypoint cat --rm "$DOCKER_IMAGE" /pydist/.version)" | ||
if [[ "${CDP_TARGET_BRANCH}" = "master" && -z "${CDP_PULL_REQUEST_NUMBER}" ]]; then | ||
docker push "$DOCKER_IMAGE" | ||
git gh-tag "$VERSION" | ||
fi | ||
- id: release | ||
type: process | ||
desc: Release to TestPyPI | ||
target: stups | ||
process: microservice_standard_deployment | ||
config: | ||
apply_permanent_resources: | ||
image: pierone.stups.zalan.do/teapot/stups-piu-release:#{CDP_TARGET_REPOSITORY_COUNTER} | ||
env: | ||
- name: USERNAME | ||
valueFrom: | ||
secretKeyRef: | ||
name: teapot-pypi-credentials | ||
key: username | ||
- name: PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: teapot-pypi-credentials | ||
key: password | ||
|
This file was deleted.
Oops, something went wrong.