From 882687ce73c69fe153c91293642455a25ec784eb Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Tue, 5 Apr 2022 16:02:09 +0200 Subject: [PATCH] wip: migrate artifactory-users-report to infra.ci Signed-off-by: Damien Duportal --- artifactory-users-report/Dockerfile | 8 ----- artifactory-users-report/Jenkinsfile | 47 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 8 deletions(-) delete mode 100644 artifactory-users-report/Dockerfile create mode 100644 artifactory-users-report/Jenkinsfile diff --git a/artifactory-users-report/Dockerfile b/artifactory-users-report/Dockerfile deleted file mode 100644 index 90b1519..0000000 --- a/artifactory-users-report/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM debian:stable-slim - -RUN apt-get update -RUN apt-get install -y wget curl - -COPY user-report.sh / - -ENTRYPOINT ["sh", "/user-report.sh"] diff --git a/artifactory-users-report/Jenkinsfile b/artifactory-users-report/Jenkinsfile new file mode 100644 index 0000000..e7d7426 --- /dev/null +++ b/artifactory-users-report/Jenkinsfile @@ -0,0 +1,47 @@ +@Library('pipeline-library@pull/348/head') _ + +pipeline { + triggers { + cron('H * * * *') + } + options { + // 6 hours timeout combined with lock and inverse precedence to will properly gate the GitHub permissions report + timeout(time: 25, unit: 'HOURS') + } + agent { + kubernetes { + yaml ''' + apiVersion: v1 + kind: Pod + spec: + containers: + - image: "jenkinsciinfra/helmfile:2.3.20" + imagePullPolicy: "IfNotPresent" + name: "jnlp" + resources: + limits: + memory: "512Mi" + cpu: "1" + requests: + memory: "512Mi" + cpu: "1" + securityContext: + privileged: false + ''' + } + } + stages { + stage('Generate Artifactory Users Report') { + environment { + ARTIFACTORY_AUTH = credentials('artifactoryAdmin') + } + steps { + dir('artifactory-users-report') { + sh 'bash ./user-report.sh > artifactory-ldap-users-report.json' + archiveArtifacts 'artifactory-ldap-users-report.json' + publishReports ([ 'artifactory-ldap-users-report.json' ]) + } + } + } + } +}