Browse Source

Change base image to jenkins official (fix for nodeJS plugin), Fix plugins.txt, Add extranal jobs support, Add job for apella staging

master
Apostolos Fanakis 5 years ago
parent
commit
1d83a49c56
  1. 9
      jenkins/Dockerfile
  2. 3
      jenkins/plugins.txt
  3. 120
      jobs/apella-staging/config.xml

9
jenkins/Dockerfile

@ -1,4 +1,4 @@
FROM jenkinsci/blueocean
FROM jenkins/jenkins:lts
LABEL maintainer="apotwohd@gmail.com"
# Preps Jenkins directories
@ -10,8 +10,8 @@ RUN chown -R jenkins:jenkins /var/cache/jenkins
# Installs docker inside container
# ATENTION: version MUST be the same as host's docker installation!
ARG VERSION=18.09
RUN curl -fsSL https://get.docker.com -o get-docker.sh | sh
# ARG VERSION=18.09
# RUN curl -fsSL https://get.docker.com -o get-docker.sh | sh
# Generates an SSH key-pair to use with Gitlab
# TODO: replace placeholder email (note that this is not really necessary)
@ -30,6 +30,9 @@ RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt
# Adds scripts for tool installation
COPY groovy/* /usr/share/jenkins/ref/init.groovy.d/
# Adds job configurations for apella
COPY jobs/* /var/jenkins_home/jobs/
# Sets defaults
# Gets rid of admin password setup
ENV JAVA_OPTS="-Djenkins.install.runSetupWizard=false -Xmx8192m"

3
jenkins/plugins.txt

@ -24,12 +24,10 @@ blueocean-rest
blueocean-rest-impl
blueocean-web
bouncycastle-api
bouncycastle-api.bak
branch-api
cloudbees-bitbucket-branch-source
cloudbees-folder
command-launcher
command-launcher.bak
config-file-provider
credentials
credentials-binding
@ -51,7 +49,6 @@ handy-uri-templates-2-api
htmlpublisher
jackson2-api
jdk-tool
jdk-tool.bak
jenkins-design-language
jira
jquery-detached

120
jobs/apella-staging/config.xml

@ -0,0 +1,120 @@
<?xml version='1.1' encoding='UTF-8'?>
<project>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.jira.JiraProjectProperty plugin="jira@3.0.13"/>
<com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty plugin="gitlab-plugin@1.5.13">
<gitLabConnection>apella</gitLabConnection>
</com.dabsquared.gitlabjenkins.connection.GitLabConnectionProperty>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>gitlabSourceBranch</name>
<description></description>
<defaultValue>master</defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>gitlabTargetBranch</name>
<description></description>
<defaultValue>master</defaultValue>
<trim>false</trim>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
<EnvInjectJobProperty plugin="envinject@2.3.0">
<info>
<secureGroovyScript plugin="script-security@1.71">
<script>import hudson.model.*
def env = Thread.currentThread()?.executable.parent.builds[0].properties.get(&apos;envVars&apos;)
def map = [:]
if (env[&apos;gitlabSourceBranch&apos;] != null) {
map[&apos;sourceBranch&apos;] = env[&apos;gitlabSourceBranch&apos;]
}
if (env[&apos;gitlabTargetBranch&apos;] != null) {
def gitlabTargetBranchIsEmpty = !(true &amp;&amp; (env[&apos;gitlabTargetBranch&apos;]))
if (gitlabTargetBranchIsEmpty &amp;&amp; env[&apos;gitlabSourceBranch&apos;] != null) {
// User left the option empty, try to use the gitlabSourceBranch instead
map[&apos;gitlabTargetBranch&apos;] = env[&apos;gitlabSourceBranch&apos;]
map[&apos;targetBranch&apos;] = env[&apos;gitlabSourceBranch&apos;]
} else {
map[&apos;targetBranch&apos;] = env[&apos;gitlabTargetBranch&apos;]
}
}
return map</script>
<sandbox>false</sandbox>
</secureGroovyScript>
<loadFilesFromMaster>false</loadFilesFromMaster>
</info>
<on>true</on>
<keepJenkinsSystemVariables>true</keepJenkinsSystemVariables>
<keepBuildVariables>true</keepBuildVariables>
<overrideBuildParameters>true</overrideBuildParameters>
</EnvInjectJobProperty>
</properties>
<scm class="hudson.plugins.git.GitSCM" plugin="git@4.2.2">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>git@gitlab.com:Apostolof/testapella.git</url>
<credentialsId>gitlab-ssh-key</credentialsId>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>origin/${gitlabSourceBranch}</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions>
<hudson.plugins.git.extensions.impl.PreBuildMerge>
<options>
<mergeRemote>origin</mergeRemote>
<mergeTarget>${gitlabTargetBranch}</mergeTarget>
<mergeStrategy>default</mergeStrategy>
<fastForwardMode>FF</fastForwardMode>
</options>
</hudson.plugins.git.extensions.impl.PreBuildMerge>
</extensions>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers>
<com.dabsquared.gitlabjenkins.GitLabPushTrigger plugin="gitlab-plugin@1.5.13">
<spec></spec>
<triggerOnPush>true</triggerOnPush>
<triggerOnMergeRequest>true</triggerOnMergeRequest>
<triggerOnPipelineEvent>false</triggerOnPipelineEvent>
<triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
<triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
<triggerOnApprovedMergeRequest>false</triggerOnApprovedMergeRequest>
<triggerOpenMergeRequestOnPush>never</triggerOpenMergeRequestOnPush>
<triggerOnNoteRequest>false</triggerOnNoteRequest>
<noteRegex>Jenkins please retry a build</noteRegex>
<ciSkip>true</ciSkip>
<skipWorkInProgressMergeRequest>true</skipWorkInProgressMergeRequest>
<setBuildDescription>true</setBuildDescription>
<branchFilterType>All</branchFilterType>
<includeBranchesSpec></includeBranchesSpec>
<excludeBranchesSpec></excludeBranchesSpec>
<sourceBranchRegex></sourceBranchRegex>
<targetBranchRegex></targetBranchRegex>
<secretToken>{AQAAABAAAAAQaN91UOqWLcMzvwxv5X3jhRSWceLHBxXjS/TMSxzNclQ=}</secretToken>
<pendingBuildName></pendingBuildName>
<cancelPendingBuildsOnUpdate>false</cancelPendingBuildsOnUpdate>
</com.dabsquared.gitlabjenkins.GitLabPushTrigger>
</triggers>
<concurrentBuild>false</concurrentBuild>
<builders/>
<publishers/>
<buildWrappers/>
</project>
Loading…
Cancel
Save