From c8bd73c7cdcc91a79356729acc1474ce7cdcf949 Mon Sep 17 00:00:00 2001 From: Amber Date: Sat, 3 Sep 2022 23:28:54 -0400 Subject: [PATCH] Test --- .groovylintrc.json | 8 ++++++++ Jenkinsfile | 24 ++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 .groovylintrc.json diff --git a/.groovylintrc.json b/.groovylintrc.json new file mode 100644 index 0000000..dc773c8 --- /dev/null +++ b/.groovylintrc.json @@ -0,0 +1,8 @@ +{ + "extends": "recommended", + "rules": { + "NestedBlockDepth": { + "enabled": false + } + } +} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 395d004..0de18e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,9 +1,9 @@ pipeline { - agent none environment { HOME = "${env.WORKSPACE}" + CREDENTIALS_ID = 'digital-ocean-ailuridae-registry' DOCKER_REGISTRY = 'https://registry.digitalocean.com' DOCKER_IMAGE_NAME = 'registry.digitalocean.com/ailuridae-registry/ailuridae.io/everybodymov' DOCKER_IMAGE = '' @@ -48,15 +48,20 @@ pipeline { agent { label 'main' } - when { - branch 'main' - } + // when { + // branch 'main' + // } steps { script { - docker.withRegistry(env.DOCKER_REGISTRY, 'digital-ocean-ailuridae-registry') { - DOCKER_IMAGE.push("${BUILD_NUMBER}") - DOCKER_IMAGE.push('latest') - } + withCredentials( + credentialsId: env.CREDENTIALS_ID, + usernameVariable: 'JENKINS_USERNAME', + passwordVariable: 'JENKINS_PASSWORD') { + docker.withRegistry(env.DOCKER_REGISTRY, env.CREDENTIALS_ID) { + DOCKER_IMAGE.push("${BUILD_NUMBER}") + DOCKER_IMAGE.push('latest') + } + } } } } @@ -69,5 +74,4 @@ pipeline { } } } - -} \ No newline at end of file +}