Fix the order of where sh commands are run.
Change-Id: I25c1cd59482869c0de5d0927c8609aa203fde78a
diff --git a/cicd/pipelines/tasks/task_update_mirrors.jenkins b/cicd/pipelines/tasks/task_update_mirrors.jenkins
index f2725a3..a5ab188 100644
--- a/cicd/pipelines/tasks/task_update_mirrors.jenkins
+++ b/cicd/pipelines/tasks/task_update_mirrors.jenkins
@@ -1,7 +1,5 @@
#!/usr/bin/env groovy
-library 'functions'
-
def workspacePath = "/home/jenkins/workspace"
def buildLabel = "task.update.mirrors-${UUID.randomUUID().toString()}"
def sourcePath = "${workspacePath}/src"
@@ -18,13 +16,14 @@
def aptlyVolume = persistentVolumeClaim(claimName: 'aptly-state', mountPath: '/var/lib/aptly')
podTemplate(label: buildLabel, containers: [jnlpContainer, debianContainer], volumes: [aptlyVolume], envVars: []) {
- def mirrorList = sh("aptly mirror list -raw").split('\n')
def date = new Date()
String stamp = date.format("yyyyMMdd-HHmmss")
node(buildLabel) {
dir(sourcePath) {
container('debian') {
+ def mirrorList = sh("aptly mirror list -raw").split('\n')
+
stage('Mirror') {
for (mirror in mirrorList) {
sh "aptly update ${mirror}"