Skip to content

Instantly share code, notes, and snippets.

View danielalejandrohc's full-sized avatar
🙂

danielalejandrohc

🙂
  • El Salvador, América central
View GitHub Profile
pipeline {
agent {
label "master"
}
tools {
// Note: This should match with the tool name configured in your jenkins instance (JENKINS_URL/configureTools/)
maven "Maven 3.6.0"
}
pipeline {
agent {
label "master"
}
environment {
// This can be nexus3 or nexus2
NEXUS_VERSION = "nexus3"
// This can be http or https
credentials:
system:
domainCredentials:
- credentials:
# Credential to use with Rest API operations and Nexus Jenkins plugin
- usernamePassword:
description: "Nexus credential"
id: "nexus-credentials"
password: "admin123"
scope: GLOBAL
FROM jenkins/jenkins:2.204.1-jdk11
# This will skip the wizard UI configuration so you can use Jenkins straight.
ENV JAVA_OPTS=-Djenkins.install.runSetupWizard=false
# This will install the plugins from "plugins.txt"
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/plugins.txt
# This will copy the Configuration as Code file - init.groovy:/var/jenkins_home/init.groovy.d/init.groovy
FROM jenkins/jenkins:2.204.1-jdk11
# This will skip the wizard UI configuration so you can use Jenkins straight.
ENV JAVA_OPTS=-Djenkins.install.runSetupWizard=false
# This will install the plugins from "plugins.txt"
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/plugins.txt
# This will copy the Configuration as Code file - init.groovy:/var/jenkins_home/init.groovy.d/init.groovy
docker-compose up
git clone https://github.com/danielalejandrohc/jenkins-examples.git
cd jenkins-examples/nexus