Skip to content
Permalink
Browse files

Merge pull request #77 from halkeye/new-docker-image

INFRA-2408 - Move plugin-site-api to plugin-site-api image
  • Loading branch information
halkeye committed Jan 6, 2020
2 parents bd2a5fe + bf13340 commit b6e652e8733fab2c12348cc578569f0cc90770b4
Showing with 18 additions and 61 deletions.
  1. +11 −11 Jenkinsfile
  2. +3 −6 Makefile
  3. +2 −2 README.adoc
  4. +2 −26 deploy/Dockerfile
  5. +0 −16 deploy/supervisord.conf
@@ -19,13 +19,6 @@ node('docker&&linux') {
checkout scm
sh 'git rev-parse HEAD > GIT_COMMIT'
shortCommit = readFile('GIT_COMMIT').take(6)

dir('deploy/plugin-site') {
def branch = env.BRANCH_NAME != 'master' ? 'develop' : 'master'
echo 'Cloning the latest front-end site for baking our container'
git url: 'https://github.com/jenkins-infra/plugin-site.git', branch: branch
sh 'git rev-parse HEAD > GIT_COMMIT'
}
}

timestamps {
@@ -51,7 +44,14 @@ node('docker&&linux') {
withEnv([
'DATA_FILE_URL=http://nginx/plugins.json.gzip',
]) {
sh 'mvn -B -Dmaven.test.failure.ignore verify'
List<String> mvnOptions = ['-Dmaven.test.failure.ignore','verify']
infra.runMaven(
mvnOptions,
/*jdk*/ "8",
/*extraEnv*/ null,
/*settingsFile*/ null,
/*addToolEnv*/ false
)
/* Copy our war file into the deploy directory for easy
* COPYing into our container
*/
@@ -70,10 +70,10 @@ node('docker&&linux') {
*/
def container
stage('Containerize') {
container = docker.build("jenkinsciinfra/plugin-site:${env.BUILD_ID}-${shortCommit}",
container = docker.build("jenkinsciinfra/plugin-site-api:${env.BUILD_ID}-${shortCommit}",
'--no-cache --rm deploy')
if (pushToDocker) {
echo "Pushing container jenkinsciinfra/plugin-site:${env.BUILD_ID}-${shortCommit}"
echo "Pushing container jenkinsciinfra/plugin-site-api:${env.BUILD_ID}-${shortCommit}"
infra.withDockerCredentials {
container.push()
}
@@ -97,7 +97,7 @@ node('docker&&linux') {

stage('Tag container as latest') {
if (pushToDocker) {
echo "Tagging jenkinsciinfra/plugin-site:${env.BUILD_ID}-${shortCommit} as latest"
echo "Tagging jenkinsciinfra/plugin-site-api:${env.BUILD_ID}-${shortCommit} as latest"
infra.withDockerCredentials {
container.push('latest')
}
@@ -1,6 +1,6 @@
# Basic Makefile just to make creating containers a bit easier outside of
# Jenkins itself (see also: Jenkinsfile)
IMAGE_NAME=jenkinsciinfra/plugin-site
IMAGE_NAME=jenkinsciinfra/plugin-site-api
ARTIFACT=plugin-site-api-1.0-SNAPSHOT.war
DATA_FILE=plugins.json.gzip

@@ -9,7 +9,7 @@ DATA_FILE=plugins.json.gzip
#################
all: check container

container: plugindata target/$(ARTIFACT) deploy/plugin-site
container: plugindata target/$(ARTIFACT)
docker build -t $(IMAGE_NAME) deploy

plugindata: target/$(DATA_FILE)
@@ -26,7 +26,7 @@ clean:
docker-compose down || true
mvn -B clean
rm -f $(DATA_FILE)
rm -rf target deploy/plugin-site
rm -rf target
docker rmi $$(docker images -q -f "reference=$(IMAGE_NAME)") || true

#################
@@ -39,9 +39,6 @@ target/plugins.json.gzip: pom.xml

target/$(ARTIFACT): plugindata check
mvn -B -Dmaven.test.skip=true package

deploy/plugin-site:
(cd deploy && git clone https://github.com/jenkins-infra/plugin-site.git)
###################

.PHONY: all container plugindata check clean run
@@ -2,7 +2,7 @@

image:https://badges.gitter.im/jenkinsci/docs.svg[link="https://gitter.im/jenkinsci/docs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]
image:https://img.shields.io/github/release/jenkins-infra/plugin-site-api.svg?label=release[link="https://github.com/jenkins-infra/plugin-site-api/releases/latest"]
image:https://img.shields.io/docker/pulls/jenkinsciinfra/plugin-site?label=jenkinsciinfra%2Fplugin-site&logo=docker&logoColor=white[link="https://hub.docker.com/r/jenkinsciinfra/plugin-site"]
image:https://img.shields.io/docker/pulls/jenkinsciinfra/plugin-site-api?label=jenkinsciinfra%2Fplugin-site-api&logo=docker&logoColor=white[link="https://hub.docker.com/r/jenkinsciinfra/plugin-site-api"]

:toc:
:toc-placement: preamble
@@ -730,7 +730,7 @@ Deploying:
. Have code merged to the master branch of this repository
. Wait pateiently 10-15 minutes (coffee time!)
. Verify that a new container tag has been published
link:https://hub.docker.com/r/jenkinsciinfra/plugin-site/tags/[here].
link:https://hub.docker.com/r/jenkinsciinfra/plugin-site-api/tags/[here].
. Submit a pull request to the
link:https://github.com/jenkins-infra/jenkins-infra[jenkins-infra/jenkins-infra]
repository updating the `profile::pluginsite::image_tag` value to the latest
@@ -2,36 +2,12 @@ FROM jetty:9-alpine

USER root

# Adds yarn. Worked before but was in testing. Now in community.Add main to ensure
# it keeps working
#RUN echo -e 'http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories
#RUN echo -e 'http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories
#RUN echo -e 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories


# Add our system dependencies for running jetty and node services inside the
# container
RUN apk add -U supervisor nodejs yarn

# Bring our Java backend app over for Jetty
COPY *.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 yarn

RUN mkdir -p /home/jetty/.yarn
RUN chown -R jetty /home/jetty /plugins
RUN chown -R jetty /home/jetty

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
CMD /docker-entrypoint.sh

This file was deleted.

0 comments on commit b6e652e

Please sign in to comment.
You can’t perform that action at this time.