Support building a single container for jenkins.io deployment
This commit is contained in:
parent
223a012621
commit
869ba75226
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue