-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from DontShaveTheYak/develop
Release v0.8.0
- Loading branch information
Showing
15 changed files
with
493 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ on: | |
- 'jobs/**' | ||
- 'src/**' | ||
- 'tests/**' | ||
- 'docker/**' | ||
|
||
jobs: | ||
linting: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,23 @@ | ||
FROM jenkins/jenkinsfile-runner:build-mvncache as jfr-mvncache | ||
FROM jenkins/jenkinsfile-runner:latest | ||
|
||
### | ||
# Build stage | ||
### | ||
FROM maven:3.5.4 as jfr-build | ||
ENV MAVEN_OPTS=-Dmaven.repo.local=/mavenrepo | ||
COPY --from=jfr-mvncache /mavenrepo /mavenrepo | ||
ADD pom.xml /jenkinsfile-runner/pom.xml | ||
RUN cd /jenkinsfile-runner && mvn clean package | ||
RUN mkdir /app && unzip /jenkinsfile-runner/target/war/jenkins.war -d /app/jenkins && \ | ||
rm -rf /app/jenkins/scripts /app/jenkins/jsbundles /app/jenkins/css /app/jenkins/images /app/jenkins/help /app/jenkins/WEB-INF/detached-plugins /app/jenkins/winstone.jar /app/jenkins/WEB-INF/jenkins-cli.jar /app/jenkins/WEB-INF/lib/jna-4.5.2.jar | ||
|
||
#### | ||
# Production image | ||
#### | ||
FROM adoptopenjdk:8u262-b10-jdk-hotspot | ||
|
||
LABEL Description="This is a base image for a single-shot ci.jenkins.io demo" Vendor="Oleg Nenashev" Version="0.3" | ||
|
||
# Packages | ||
RUN apt-get update && apt-get install -y wget git curl sudo && rm -rf /var/lib/apt/lists/* && curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh | ||
|
||
COPY --from=jfr-build /jenkinsfile-runner/target/appassembler /app | ||
COPY --from=jfr-build /jenkinsfile-runner/target/plugins /usr/share/jenkins/ref/plugins | ||
COPY --from=jenkins/jenkinsfile-runner:1.0-beta-15 /app/bin/jenkinsfile-runner-launcher /app/bin/jenkinsfile-runner-launcher | ||
# /app/jenkins is a location of the WAR file. It can be empty in the current packaging | ||
RUN mkdir /app/jenkins | ||
## Plugins | ||
COPY *-plugins.txt /usr/share/jenkins/ref/ | ||
RUN cd /app/jenkins && jar -cvf jenkins.war * && cat /usr/share/jenkins/ref/lib-plugins.txt >> /usr/share/jenkins/ref/runner-plugins.txt | ||
RUN java -jar /app/bin/jenkins-plugin-manager.jar --war /app/jenkins/jenkins.war --plugin-file /usr/share/jenkins/ref/runner-plugins.txt && rm /app/jenkins/jenkins.war | ||
|
||
VOLUME /usr/share/jenkins/ref/casc | ||
|
||
COPY jenkins.yaml /usr/share/jenkins/ref/jenkins.yaml | ||
COPY init_scripts/src/main/groovy/* /usr/share/jenkins/ref/init.groovy.d/ | ||
|
||
ENV JENKINS_HOME="/usr/share/jenkins/ref/" | ||
ENV JAVA_OPTS="-Djenkins.model.Jenkins.slaveAgentPort=50000 -Djenkins.model.Jenkins.slaveAgentPortEnforce=true -Dhudson.model.LoadStatistics.clock=1000" | ||
ENV CASC_JENKINS_CONFIG /usr/share/jenkins/ref/jenkins.yaml | ||
COPY jenkins.yaml /usr/share/jenkins/ref/jenkins.yaml | ||
COPY init_scripts/src/main/groovy/* /usr/share/jenkins/ref/init.groovy.d/ | ||
|
||
ENTRYPOINT ["/app/bin/jenkinsfile-runner",\ | ||
"-w", "/app/jenkins",\ | ||
"-p", "/usr/share/jenkins/ref/plugins",\ | ||
"-f", "/workspace/Jenkinsfile"] | ||
"-w", "/usr/share/jenkins/",\ | ||
"-p", "/usr/share/jenkins/ref/plugins"] | ||
|
||
CMD ["-f /workspace/Jenkinsfile"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
git:4.7.2 | ||
sshd:3.0.3 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
configuration-as-code-groovy:1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* groovylint-disable DuplicateMapLiteral, DuplicateStringLiteral, UnusedVariable */ | ||
@Library('jenkins-std-lib') | ||
|
||
import org.dsty.scm.Generic | ||
|
||
node() { | ||
String cps = sh(script: '#!/bin/bash\nset +x; > /dev/null 2>&1\necho Test for CPS issue', returnStdout: true) | ||
|
||
// If you are not sure if you are dealing with git or svn then Generic is a good choice. | ||
Generic scmClient = new Generic(this) | ||
|
||
// These are the same options you would pass to the checkout step | ||
// https://www.jenkins.io/doc/pipeline/steps/workflow-scm-step/ | ||
|
||
String defaultBranch = 'master' | ||
|
||
Map options = [ | ||
changelog: false, | ||
poll: false, | ||
scm: [ | ||
$class: 'GitSCM', | ||
branches: [[name: defaultBranch]], | ||
extensions: [], | ||
userRemoteConfigs: [[url: 'https://github.com/DontShaveTheYak/jenkins-std-lib.git']] | ||
] | ||
] | ||
|
||
scmClient.checkout(options) | ||
|
||
if (!env.GIT_BRANCH.contains(defaultBranch)) { | ||
error("${env.GIT_BRANCH} should be equal to ${defaultBranch}.") | ||
} | ||
|
||
options.scm.branches = [[name: 'develop']] | ||
|
||
dir('testing') { | ||
scmClient.withCheckout(options) { | ||
if (env.GIT_BRANCH.contains(defaultBranch)) { | ||
error("${env.GIT_BRANCH} should not equal ${defaultBranch}.") | ||
} | ||
} | ||
} | ||
|
||
if (!env.GIT_BRANCH.contains(defaultBranch)) { | ||
error("${env.GIT_BRANCH} should be equal to ${defaultBranch}.") | ||
} | ||
|
||
cps = sh(script: '#!/bin/bash\nset +x; > /dev/null 2>&1\necho Test for CPS issue', returnStdout: true) | ||
} |
Oops, something went wrong.