diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 00000000..9139d8e7 --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,10 @@ +FROM fedora + +RUN dnf install -y \ + libjpeg-devel \ + openssh-clients \ + python3-devel \ + redhat-rpm-config \ + rsync \ + zlib-devel \ + -- diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 00000000..961d9ca0 --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,33 @@ +pipeline { + agent { + dockerfile { + dir 'ci' + } + } + + triggers { + pollSCM '' + } + + environment { + PUBLISH_HOST = 'file0.pyrocufflink.blue' + XDG_CACHE_DIR = "${WORKSPACE}" + } + + stages { + stage('Build') { + steps { + sh '. ci/build.sh' + } + } + + stage('Publish') { + steps { + sshagent(['jenkins-sftp']) { + sh '. ci/publish.sh' + } + } + } + } + +} diff --git a/ci/build.sh b/ci/build.sh new file mode 100644 index 00000000..b4a8d070 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,5 @@ +rm -rf .venv +python3 -m venv .venv + +.venv/bin/pip install --upgrade pip setuptools wheel +.venv/bin/pip wheel -w dist -r requirements.txt diff --git a/ci/publish.sh b/ci/publish.sh new file mode 100644 index 00000000..7c32cdec --- /dev/null +++ b/ci/publish.sh @@ -0,0 +1,3 @@ +: ${PUBLISH_PATH:=/var/lib/wheels} + +rsync -aP --delete --include '*.whl' dist/ ${PUBLISH_HOST}:${PUBLISH_PATH%/}/