From a4b5f69e5bf7281ca689dfaa8a76e45b11f9b34c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 18 Apr 2019 14:39:40 +0200 Subject: [PATCH] merge nix-cache build Jenkinsfiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- ...nsfile.nix.macos => Jenkinsfile.nix-cache} | 4 +- ci/Jenkinsfile.nix.linux | 51 ------------------- 2 files changed, 1 insertion(+), 54 deletions(-) rename ci/{Jenkinsfile.nix.macos => Jenkinsfile.nix-cache} (97%) delete mode 100644 ci/Jenkinsfile.nix.linux diff --git a/ci/Jenkinsfile.nix.macos b/ci/Jenkinsfile.nix-cache similarity index 97% rename from ci/Jenkinsfile.nix.macos rename to ci/Jenkinsfile.nix-cache index dab1680c82..1e956ba318 100644 --- a/ci/Jenkinsfile.nix.macos +++ b/ci/Jenkinsfile.nix-cache @@ -1,7 +1,5 @@ pipeline { - agent { - label 'macos' - } + agent { label params.AGENT_LABEL } environment { CI_ENVIRONMENT = 'jenkins' diff --git a/ci/Jenkinsfile.nix.linux b/ci/Jenkinsfile.nix.linux deleted file mode 100644 index aed2a115f8..0000000000 --- a/ci/Jenkinsfile.nix.linux +++ /dev/null @@ -1,51 +0,0 @@ -pipeline { - agent { label 'linux' } - - environment { - CI_ENVIRONMENT = 'jenkins' - /* we source .bash_profile to be able to use nix-store */ - NIX_SSHOPTS = "-o StrictHostKeyChecking=no source .bash_profile;" - /* where our /nix/store is hosted */ - NIX_CACHE_USER = 'nix-cache' - NIX_CACHE_HOST = 'master-01.do-ams3.ci.misc.statusim.net' - NIX_CONF_DIR = "${env.WORKSPACE}/nix" - } - - options { - timestamps() - disableConcurrentBuilds() - /* Prevent Jenkins jobs from running forever */ - timeout(time: 20, unit: 'MINUTES') - /* Limit builds retained */ - buildDiscarder(logRotator( - numToKeepStr: '20', - daysToKeepStr: '30', - )) - } - - stages { - stage('Setup') { - steps { - sh 'nix-env -i openssh' - } - } - stage('Build') { - steps { - sh """ - nix build -v --no-link && - nix-shell --pure --run echo - """ - } - } - stage('Upload') { - steps { - sshagent(credentials: ['nix-cache-ssh']) { - sh """ - find /nix/store/ -mindepth 1 -maxdepth 1 -not -name '.links' -and -not -name '*.lock' | \ - xargs nix-copy-closure -v --to ${NIX_CACHE_USER}@${NIX_CACHE_HOST} - """ - } - } - } - } -}