From 233f3135f292409214941225ccee904d746e57b3 Mon Sep 17 00:00:00 2001 From: Egor Chupin Date: Wed, 15 May 2024 11:41:37 +0700 Subject: [PATCH] added Jenkinsfile and files for creating Jenkins container with seed job --- Jenkinsfile | 38 +++++++++++++++++++++++++++++++++++++ jenkins-image/Dockerfile | 6 ++++++ jenkins-image/casc.yaml | 40 +++++++++++++++++++++++++++++++++++++++ jenkins-image/plugins.txt | 21 ++++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 Jenkinsfile create mode 100644 jenkins-image/Dockerfile create mode 100644 jenkins-image/casc.yaml create mode 100644 jenkins-image/plugins.txt diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..d274cea --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,38 @@ +pipeline { + agent any + + environment { + JAVA_HOME = "/usr/lib/jvm/java-17-openjdk-amd64" + } + + stages { + + stage('Checkout') { + steps { + sh 'git submodule update --init --recursive' + } + } + + stage('Build') { + steps { + sh 'mvn install' + dir('base/scripts') { + sh './lwr-ant-gen-all' + sh './lwr-build' + } + } + } + + stage('Generate dist') { + steps { + sh './lwr-dist-linux /tmp/lwr' + } + } + + stage('Generate deb') { + steps { + + } + } + } +} \ No newline at end of file diff --git a/jenkins-image/Dockerfile b/jenkins-image/Dockerfile new file mode 100644 index 0000000..4c16010 --- /dev/null +++ b/jenkins-image/Dockerfile @@ -0,0 +1,6 @@ +FROM jenkins/jenkins:latest +ENV JAVA_OPTS -Djenkins.install.runSetupWizard=false +ENV CASC_JENKINS_CONFIG /var/jenkins_home/casc.yaml +COPY --chown=jenkins:jenkins plugins.txt /usr/share/jenkins/ref/plugins.txt +RUN jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.txt +COPY casc.yaml /var/jenkins_home/casc.yaml diff --git a/jenkins-image/casc.yaml b/jenkins-image/casc.yaml new file mode 100644 index 0000000..26070f3 --- /dev/null +++ b/jenkins-image/casc.yaml @@ -0,0 +1,40 @@ +jenkins: + securityRealm: + local: + allowsSignup: false + users: + - id: "admin" + password: "admin" + - id: "dev" + password: "dev" + authorizationStrategy: + globalMatrix: + permissions: + - "Job/Build:dev" + - "Job/Cancel:dev" + - "Job/Read:dev" + - "Job/Workspace:dev" + - "Overall/Administer:admin" + - "Overall/Read:authenticated" + - "Run/Replay:dev" + - "Run/Update:dev" + +unclassified: +jobs: + - script: > + folder('testjobs') + - script: > + pipelineJob('testjobs/default-agent') { + definition { + cpsScm { + scm { + git { + remote { + url('https://github.com/egusator/parent.git') + branch('*/master') + } + } + } + } + } + } diff --git a/jenkins-image/plugins.txt b/jenkins-image/plugins.txt new file mode 100644 index 0000000..a189773 --- /dev/null +++ b/jenkins-image/plugins.txt @@ -0,0 +1,21 @@ +ant:latest +antisamy-markup-formatter:latest +build-timeout:latest +cloudbees-folder:latest +configuration-as-code:latest +credentials-binding:latest +email-ext:latest +git:latest +github-branch-source:latest +gradle:latest +job-dsl:latest +ldap:latest +mailer:latest +matrix-auth:latest +pam-auth:latest +pipeline-github-lib:latest +pipeline-stage-view:latest +ssh-slaves:latest +timestamper:latest +workflow-aggregator:latest +ws-cleanup:latest