From 418ebb52ed07d25acc7519fcf868db6dbe2079dd Mon Sep 17 00:00:00 2001 From: s00ner Date: Fri, 18 Feb 2022 14:01:49 -0500 Subject: [PATCH] First attempt at the build --- Jenkinsfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..81b0e38 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,28 @@ +/* Do not edit this file. This is how the site gets built and deployed. + Are there better/cheaper/different ways to build and host a static site? + Yes. I'm aware. I have my reasons. Don't bug me about it. +*/ +pipeline { + agent any + + stages { + stage('Upload') { + steps { + sshagent(credentials: ['baltimore-wiki']) { + sh ''' + [ -d ~/.ssh ] || mkdir ~/.ssh && chmod 0700 ~/.ssh + ssh-keyscan -t rsa,dsa baltimore-wiki.lxd >> ~/.ssh/known_hosts + ssh mdbook@baltimore-wiki.lxd << EOF + cd $(mktemp -d) + wget https://git.doublehack.me/s00ner/Baltimore-hackthebox-knowledgebase/archive/main.tar.gz + tar -xf main.tar.gz + rsync --recursive --exclude 'Jenkinsfile' --delete ./baltimore-hackthebox-knowledgebase/ /home/mdbook/wiki/src/ + rm -rf $(pwd) +EOF + ''' + + } + } + } + } +} \ No newline at end of file