Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
69971f7
updating jenkins master/agent images
kottoson-bah Jul 19, 2019
62bb363
adding jenkins-agent license info
kottoson-bah Jul 19, 2019
1899104
fixing permissions issue in jenkins-master Dockerfile
kottoson-bah Jul 19, 2019
b653fdb
Modify jenkins-master's configure.groovy
kottoson Jul 22, 2019
df8addd
Update Dockerfile
kottoson Jul 22, 2019
c689f0f
adding openshift util to jenkins-master
kottoson-bah Jul 22, 2019
aa3fbb9
reverting changes; need to reevaluate
kottoson-bah Jul 22, 2019
9686114
adding this back to jenkins-master Dockerfile
kottoson-bah Jul 22, 2019
60796ba
adding to jenkins-master config script Openshift settings
kottoson-bah Jul 24, 2019
0e560b5
importing to jenkins-master config "OpenShiftTokenCredentials"
kottoson-bah Jul 24, 2019
a847cdd
aligning jenkins-master w/ our common image
kottoson-bah Jul 24, 2019
39d7aa8
adding oc client to jenkins master
kottoson-bah Jul 24, 2019
1de5bb2
using scl in jenkins-agent startup command
kottoson-bah Jul 24, 2019
760e47d
fixing typo(?) in jenkins-agent supervisord.conf
kottoson-bah Jul 24, 2019
e9cf7da
updating jenkins-agent.sh
kottoson-bah Jul 24, 2019
1e591a1
adding hostname cmd to jenkins-agent
kottoson-bah Jul 24, 2019
060d8f6
adding hostname cmd to jenkins-agent
kottoson-bah Jul 24, 2019
25e62e4
refactoring jenkins-agent Dockerfile
kottoson-bah Jul 24, 2019
3b17f7a
updating Sonarqube image
kottoson-bah Jul 25, 2019
687206f
updating sonar-scanner image
kottoson-bah Jul 25, 2019
1b0ce97
updating sonarqube bc to set git ref
kottoson-bah Jul 25, 2019
b923b7f
updating permissions in Sonarqube image for Openshift
kottoson-bah Jul 25, 2019
97283b5
updating zap image to use ubi
kottoson-bah Jul 25, 2019
3cffbfa
updating openshift-helm image to use ubi
kottoson-bah Jul 25, 2019
7092865
forgot to add licenses folder...
kottoson-bah Jul 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion charts/sonarqube/templates/bc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spec:
source:
type: "Git"
git:
ref: {{ $.Values.sourceRepositoryBranch | default "master" }}
{{- if .Values.sourceRepositoryUrl }}
uri: {{ .Values.sourceRepositoryUrl }}
{{- else }}
Expand All @@ -31,4 +32,4 @@ spec:
name: "sonarqube:{{ .Values.imageTag | default .Chart.Version }}"
triggers:
- type: ConfigChange
{{- end }}
{{- end }}
64 changes: 45 additions & 19 deletions resources/jenkins-agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,57 @@
# Copyright © 2018 Booz Allen Hamilton. All Rights Reserved.
# This software package is licensed under the Booz Allen Public License. The license can be found in the License file or at http://boozallen.github.io/licenses/bapl
## Note: Pulling container will require logging into Red Hat's registry using `docker login registry.redhat.io` .
#FROM registry.redhat.io/ubi7-dev-preview/ubi
#FROM docker-registry-default.apps.ocp-dev.microcaas.net/ubi/ubi7-hardened
FROM registry.access.redhat.com/ubi7:7.6
MAINTAINER Steven Terrana <terrana_steven@bah.com>

FROM docker:dind
### Required Atomic/OpenShift Labels - https://github.com/projectatomic/ContainerApplicationGenericLabels
LABEL name="Solutions Delivery Platform: Jenkins Agent" \
maintainer="terrana_steven@bah.com" \
vendor="Booz Allen Hamilton" \
version="1.0" \
release="1.0" \
summary="A Jenkins Build Agent container" \
description="The Jenkins Build Agent container image for the Solutions Delivery Platform"

### add licenses to this directory
COPY licenses /licenses

### Add necessary Red Hat repos and packages here
RUN INSTALL_PKGS="yum-utils device-mapper-persistent-data lvm2 java-1.8.0-openjdk git openssl python27-python-pip" && \
yum --disableplugin=subscription-manager -y update-minimal --setopt=tsflags=nodocs \
--security --sec-severity=Important --sec-severity=Critical && \
yum --disableplugin=subscription-manager -y install --setopt=tsflags=nodocs ${INSTALL_PKGS}

### Install your application here -- add all other necessary items to build your image
ENV JENKINS_SWARM_VERSION 3.9
ENV JNLP_SLAVE_VERSION 3.9
ENV HOME /root
ENV JAVA_HOME /usr/lib/jvm/java

RUN mkdir -p /opt/jenkins-slave/bin ${HOME} && \
apk add --no-cache curl openjdk8 git device-mapper openssl-dev build-base nss && \
# install docker-compose
apk add --no-cache py-pip curl supervisor libffi-dev python-dev && \
pip install docker-compose && \
# set PID max to 99999
# bc of docker bug w/ 6 character pid
echo "kernel.pid_max=99999" >> /etc/sysctl.d/00-alpine.conf
# this container must run as privileged
USER root

# install docker
RUN yum install --disableplugin=subscription-manager -y \
http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.74-1.el7.noarch.rpm \
http://mirror.centos.org/centos/7/os/x86_64/Packages/libseccomp-2.3.1-3.el7.x86_64.rpm && \
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
yum-config-manager --enable docker-ce-edge && \
yum install --disableplugin=subscription-manager -y docker-ce hostname

RUN printf 'pip install --upgrade pip && pip install supervisor docker-compose' | scl enable python27 -
RUN mkdir -p /opt/jenkins-agent/bin ${HOME}

# Copy script
COPY jenkins-agent.sh /opt/jenkins-slave/bin/jenkins-slave
RUN chmod 777 /opt/jenkins-slave/bin/jenkins-slave && \
chmod +x /opt/jenkins-slave/bin/jenkins-slave && \
# Download plugin and modify permissions
curl --create-dirs -sSLo /opt/jenkins-slave/bin/swarm-client-$JENKINS_SWARM_VERSION.jar http://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/$JENKINS_SWARM_VERSION/swarm-client-$JENKINS_SWARM_VERSION.jar && \
curl --create-dirs -sSLo /opt/jenkins-slave/bin/slave.jar http://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/$JNLP_SLAVE_VERSION/remoting-$JNLP_SLAVE_VERSION.jar
COPY jenkins-agent.sh /opt/jenkins-agent/bin/jenkins-agent
RUN chmod 777 /opt/jenkins-agent/bin/jenkins-agent
RUN chmod +x /opt/jenkins-agent/bin/jenkins-agent

# Download plugin and modify permissions
RUN curl --create-dirs -sSLo /opt/jenkins-agent/bin/swarm-client-$JENKINS_SWARM_VERSION.jar http://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/$JENKINS_SWARM_VERSION/swarm-client-$JENKINS_SWARM_VERSION.jar && \
curl --create-dirs -sSLo /opt/jenkins-agent/bin/agent.jar http://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/$JNLP_SLAVE_VERSION/remoting-$JNLP_SLAVE_VERSION.jar

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

ENTRYPOINT ["/bin/sh", "-c"]
CMD ["/usr/bin/supervisord --configuration /etc/supervisor/conf.d/supervisord.conf"]
ENTRYPOINT []
CMD printf 'supervisord --configuration /etc/supervisor/conf.d/supervisord.conf' | scl enable python27 -
4 changes: 2 additions & 2 deletions resources/jenkins-agent/jenkins-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# oc whoami -t | docker login docker-registry.default.svc:5000 -u $REGISTRY_USERNAME --password-stdin

# jenkins swarm slave
JAR=`ls -1 /opt/jenkins-slave/bin/swarm-client-*.jar | tail -n 1`
JAR=`ls -1 /opt/jenkins-agent/bin/swarm-client-*.jar | tail -n 1`
PARAMS="-master $JENKINS_URL -tunnel $JENKINS_TUNNEL -username ${JENKINS_USERNAME} -password ${JENKINS_PASSWORD} -executors ${EXECUTORS} -name $(hostname)"
exec java $JAVA_OPTS -jar $JAR -fsroot $HOME $PARAMS "$@"
exec java $JAVA_OPTS -jar $JAR -fsroot $HOME $PARAMS "$@"
49 changes: 49 additions & 0 deletions resources/jenkins-agent/licenses/bapl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Booz Allen Public License v1.0


### INTRODUCTION
The Booz Allen Public License allows government, non-profit academic, other non-profit, and commercial entities access to distinctive, disruptive, and robust code with the goal of Empowering People to Change the World&#8480;. Products licensed under the Booz Allen Public License are founded on the basis that collective ingenuity can make the largest impact in the community.

### DEFINITIONS
* **Commercial Entity.** “Commercial Entity” means any individual or entity other than a government, non-profit academic, or other non-profit entity.
* **Derivative.** “Derivative” means any work of authorship in Source Code or Object Code form that results from an addition to, deletion from, or modification of the Source Code of the Product.
* **License.** “License” means this Booz Allen Public License.
* **Object Code.** “Object Code” means the form resulting from transformation or translation of Source Code into machine readable code, including but not limited to, compiled object code.
* **Originator.** “Originator” means each individual or legal entity that creates, contributes to the creation of, or owns the Product.
* **Patent Claims.** “Patent Claims” means any patent claim(s) in any patent to which Originator has a right to grant a license that would be infringed by Your making, using, selling, offering for sale, having made, or importing of the Product, but for the grant of this License.
* **Product.** “Product” means the Source Code of the software which the initial Originator made available under this License, and any Derivative of such Source Code.
* **Source Code.** “Source Code” means software in human-readable form.
* **You.** “You” means either an individual or an entity (if you are taking this license on behalf of an entity) that exercises the rights granted under this License.

### LICENSE
**Government/Non-Profit Academic/Other Non-Profit.**
This Section applies if You are not a Commercial Entity.

* **License.** Subject to the terms and conditions of this License, each Originator hereby grants You a perpetual, worldwide, non-exclusive, royalty-free license to reproduce, display, perform, modify, distribute and otherwise use the Product and Derivatives, in Source Code and Object Code form, in accordance with the terms and conditions of this License in order to support the general public good and for your internal business purposes.
* **Distribution.** You may distribute to third parties copies of the Product, including any Derivative that You create, in Source Code or Object Code form. If You distribute copies of the Product, including any Derivative that You create, in Source Code form, such distribution must be under the terms of this License and You must inform recipients of the Source Code that the Product is governed under this License and how they can obtain a copy of this License. You may distribute to third parties copies of the Product, including any Derivative that You create, in Object Code form, or allow third parties to access or use the Product, including any Derivative that You create, under a license of Your choice.
* **Commercial Sales.** You may not distribute, or allow third parties to access or use, the Product or any Derivative for a fee, unless You first obtain permission from the Originator. If Booz Allen Hamilton is the Originator, please contact Booz Allen Hamilton at <opensource@bah.com>.

**Commercial Entities**.
This Section applies if You are a Commercial Entity.

* **License.** Subject to the terms and conditions of this License, each Originator hereby grants You a perpetual, worldwide, non-exclusive, royalty-free license to reproduce, display, perform, modify, distribute and otherwise use the Product and Derivatives, in Source Code and Object Code form, in accordance with the terms and conditions of this License for the sole purpose of Your internal business purposes and the provision of services to government, non-profit academic, and other non-profit entities.
* **Distribution and Derivatives.** You may distribute to third parties copies of the Product, including any Derivative that You create, in Source Code or Object Code form. If You distribute copies of the Product, including any Derivative that You create, in Source Code form, such distribution must be under the terms of this License and You must inform recipients of the Source Code that the Product is governed under this License and how they can obtain a copy of this License. You may distribute to third parties copies of the Product, including any Derivative that You create, in Object Code form, or allow third parties to access or use the Product, including any Derivative that You create, under a license of Your choice, provided that You make available, and inform the recipient of such distribution how they can obtain, a copy of the Source Code thereof, at no charge, and inform the recipient of the Source Code that the Product is governed under this License and how they can obtain a copy of this License.
* **Commercial Sales.** You may not distribute, or allow third parties to access or use, the Product or any Derivative for a fee, unless You first obtain permission from the Originator. If Booz Allen Hamilton, please contact Booz Allen Hamilton at <opensource@bah.com>.

**Patent Claim(s)**.
This Section applies regardless of whether You are a government, non-profit academic, or other non-profit entity or a Commercial Entity.

* **Patent License.** Subject to the limitations in the Sections above, each Originator hereby grants You a perpetual, worldwide, non-exclusive, royalty-free license under Patent Claims of such Originator to make, use, sell, offer for sale, have made, and import the Product. The foregoing patent license does not apply (a) to any code that an Originator has removed from the Product, or (b) for infringement caused by Your modifications of the Product or the combination of any Derivative created by You or on Your behalf with other software.

### GENERAL TERMS
This Section applies regardless of whether You are a government, non-profit academic, or other non-profit entity or a Commercial Entity.

* **Required Notices.** If You distribute the Product or a Derivative, in Object Code or Source Code form, You shall not remove or otherwise modify any proprietary markings or notices contained within or placed upon the Product or any Derivative. Any distribution of the Product or a Derivative, in Object Code or Source Code form, shall contain a clear and conspicuous Originator copyright and license reference in accordance with the below:
* *Unmodified Product Notice*: “This software package is licensed under the Booz Allen Public License. Copyright © 20__ [Copyright Holder Name]. All Rights Reserved.”
* *Derivative Notice*: “This software package is licensed under the Booz Allen Public License. Portions of this code are Copyright © 20__ [Copyright Holder Name]. All Rights Reserved.”
* **Compliance with Laws.** You agree that You shall not reproduce, display, perform, modify, distribute and otherwise use the Product in any way that violates applicable law or regulation or infringes or violates the rights of others, including, but not limited to, third party intellectual property, privacy, and publicity rights.
* **Disclaimer.** You understand that the Product is licensed to You, and not sold. The Product is provided on an “As Is” basis, without any warranties, representations, and guarantees, whether oral or written, express, implied or statutory, with regard to the Product, including without limitation, warranties of merchantability, fitness for a particular purpose, title, non-infringement, non-interference, and warranties arising from course of dealing or usage of trade, to the maximum extent permitted by applicable law. Originator does not warrant that (i) the Product will meet your needs; (ii) the Product will be error-free or accessible at all times; or (iii) the use or the results of the use of the Product will be correct, accurate, timely, or otherwise reliable. You acknowledge that the Product has not been prepared to meet Your individual requirements, whether or not such requirements have been communicated to Originator. You assume all responsibility for use of the Product.
* **Limitation of Liability.** Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Originator, or anyone who distributes the Product in accordance with this License, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if informed of the possibility of such damages.
* **Severability.** If the application of any provision of this License to any particular facts or circumstances shall be held to be invalid or unenforceable, then the validity and enforceability of other provisions of this License shall not in any way be affected or impaired thereby.


2 changes: 1 addition & 1 deletion resources/jenkins-agent/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:jenkins-agent]
command=sh /opt/jenkins-slave/bin/jenkins-slave
command=sh /opt/jenkins-agent/bin/jenkins-agent
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
Expand Down
Loading