ci: Add Jenkins pipeline

master
Dustin 2018-07-26 20:04:45 -05:00
parent c9ea4d2e77
commit 007a3e556a
3 changed files with 43 additions and 0 deletions

9
ci/Dockerfile Normal file
View File

@ -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

28
ci/Jenkinsfile vendored Normal file
View File

@ -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'
}
}
}
}
}

6
ci/publish.sh Normal file
View File

@ -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 --upgrade --force-reinstall --no-index -f wheelhouse DarkChestOfWonders