Support building a single container for jenkins.io deployment

This commit is contained in:
R. Tyler Croy 2016-11-02 03:54:13 -07:00
parent 223a012621
commit 869ba75226
No known key found for this signature in database
GPG Key ID: 1426C7DC3F51E16F
4 changed files with 57 additions and 1 deletions

2
Jenkinsfile vendored
View File

@ -53,7 +53,7 @@ node('docker') {
def container
stage('Containerize') {
container = docker.build("jenkinsciinfra/plugin-site:${shortCommit}",
'--no-cache --rm .')
'--no-cache --rm deploy')
if (!isPullRequest) {
container.push()
}

14
Makefile Normal file
View File

@ -0,0 +1,14 @@
# Basic Makefile just to make creating containers a bit easier outside of
# Jenkins itself (see also: Jenkinsfile)
plugindata:
mvn -PgeneratePluginData
war: plugindata
mvn -B clean verify
build: war plugindata
docker build -t jenkinsciinfra/plugin-site deploy
.PHONY: build war plugindata

26
deploy/Dockerfile Normal file
View File

@ -0,0 +1,26 @@
FROM jetty:9-alpine
# Add our system dependencies for running jetty and node services inside the
# container
RUN apk update && apk add supervisor nodejs
# Bring our Java backend app over for Jetty
COPY ../target/*.war /var/lib/jetty/webapps/ROOT.war
# Bring our supervisor configuration for supervisord
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Prepare the front-end portion of the site
RUN mkdir /plugins
COPY plugin-site /plugins
WORKDIR /plugins
# Make sure all our node dependencies are present and accounted for
RUN npm install
WORKDIR $JETTY_BASE
# Expose the npm server's port while we're at it
EXPOSE 5000
CMD /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf

16
deploy/supervisord.conf Normal file
View File

@ -0,0 +1,16 @@
[supervisord]
nodaemon=true
[program:jetty]
command=/docker-entrypoint.sh
directory=/var/lib/jetty
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
[program:frontend]
command=/usr/bin/npm run server
directory=/plugins
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true