diff --git a/ci/Dockerfile b/ci/Dockerfile new file mode 100644 index 0000000..54fe1ee --- /dev/null +++ b/ci/Dockerfile @@ -0,0 +1,9 @@ +FROM fedora:28 + +RUN dnf install -y \ + openssh-clients \ + python3-pip \ + python3-wheel \ + rsync + +RUN useradd -l -u 3000018 -d /var/lib/jenkins jenkins diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile new file mode 100644 index 0000000..ff331c5 --- /dev/null +++ b/ci/Jenkinsfile @@ -0,0 +1,28 @@ +pipeline { + agent { + dockerfile { + dir 'ci' + } + } + + triggers { + pollSCM '' + } + + environment { + PUBLISH_HOST = 'web0.pyrocufflink.blue' + PUBLISH_USER = 'webapp.dcow' + } + + stages { + stage('Publish') { + steps { + sh 'pip3 wheel -w dist .' + sshagent(['jenkins-web']) { + sh "ssh -oStrictHostKeyChecking=no ${PUBLISH_USER}@${PUBLISH_HOST} :" + sh '. ci/publish.sh' + } + } + } + } +} diff --git a/ci/publish.sh b/ci/publish.sh new file mode 100644 index 0000000..9ddb387 --- /dev/null +++ b/ci/publish.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +rsync -rti dist/ ${PUBLISH_USER}@${PUBLISH_HOST}:wheelhouse \ + --include '*.whl' --exclude '**' +ssh ${PUBLISH_USER}@${PUBLISH_HOST} \ + venv/bin/pip install --no-index -f wheelhouse DarkChestOfWonders