From 6a4994b9e17ab512b8585fe655528f7b64929550 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 25 Mar 2020 08:22:10 -0500 Subject: [PATCH] Initial commit --- Containerfile | 10 ++++++++++ Jenkinsfile | 29 +++++++++++++++++++++++++++++ build.sh | 1 + publish.sh | 8 ++++++++ 4 files changed, 48 insertions(+) create mode 100644 Containerfile create mode 100644 Jenkinsfile create mode 100644 build.sh create mode 100644 publish.sh diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..057b6d1 --- /dev/null +++ b/Containerfile @@ -0,0 +1,10 @@ +FROM arm32v7/python:3.7-slim + +RUN apt-get update && apt-get install -y \ + gcc \ + libffi-dev \ + libssl-dev \ + openssh-client \ + procps \ + rsync \ + && rm -rf /var/lib/apt/lists/* diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..9b121e9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,29 @@ +pipeline { + agent { + dockerfile { + label 'arm' + filename 'Containerfile' + args '-u 0:0 -v /etc/ssh/ssh_known_hosts:/etc/ssh/ssh_known_hosts:ro' + + } + } + + environment { + XDG_CACHE_HOME = "${WORKSPACE}" + } + + stages { + stage('Build') { + steps { + sh '. ./build.sh' + } + } + stage('Publish') { + steps { + sshagent(['jenkins-sftp']) { + sh '. ./publish.sh' + } + } + } + } +} diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..718238f --- /dev/null +++ b/build.sh @@ -0,0 +1 @@ +python3.7 -m pip wheel -w dist/ homeassistant diff --git a/publish.sh b/publish.sh new file mode 100644 index 0000000..b033576 --- /dev/null +++ b/publish.sh @@ -0,0 +1,8 @@ +: ${PUBLISH_HOST:=jenkins@file0.pyrocufflink.blue} +: ${PUBLISH_PATH:=/var/lib/wheels/homeassistant} + +rsync -rtiO \ + --delete \ + --include '*.whl' \ + dist/ \ + ${PUBLISH_HOST}:${PUBLISH_PATH%/}/