Skip to content

Commit

Permalink
Merge pull request #1 from cloudbees-oss/dockerkub-and-kiss
Browse files Browse the repository at this point in the history
Adjust documentation to the new Docker Hub location and simplify the demo
  • Loading branch information
oleg-nenashev authored Jul 30, 2019
2 parents 2e78efa + fc9d5a3 commit 45f6cc4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 23 deletions.
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contributing

## Proposing changes

If you want to improve the image, please submit a pull request to the repository.

## Building the image

* Ensure that Docker and Make are installed on your machine
* Checkout the repository
* Run `make build`

It will produce a local `cloudbees/cjd-jcasc-demo:rolling` image.

## Testing the local image

Use the `make run-devel` command.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ USER root
RUN mkdir -p /usr/share/jenkins/ && ln -s /usr/share/cloudbees-jenkins-distribution/cloudbees-jenkins-distribution.war /usr/share/jenkins/jenkins.war
USER cloudbees-jenkins-distribution

# Startup all plugins included into the CloudBees Jenkins Distribution bundle
ENV JAVA_OPTS "-Dcom.cloudbees.jenkins.cjp.installmanager.CJPPluginManager.allRequired=true"

# Install extra plugins
# REF_ROOT is consumed by jenkins-support in the https://github.com/jenkinsci/docker/issues/861 workaround
ENV REF_ROOT=/usr/share/cloudbees-jenkins-distribution/ref
Expand Down
24 changes: 10 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
IMAGE_TAG=cloudbees/cjd-jcasc-demo:rolling
INCLUDE_ALL_BUNDLED_PLUGINS?=true
IMAGE_TAG=cloudbees/cjd-jcasc-demo
DEVEL_SUFFIX=devel
IMAGE_DEVEL_TAG=${IMAGE_TAG}:${DEVEL_SUFFIX}
DOCKER_BUILD_FLAGS?=

clean:
@if docker images cloudbees/cjd-jcasc-demo | awk '{ print $$2 }' | grep -q -F rolling; then docker image rm --force ${IMAGE_TAG} ; false; fi
@if docker images ${IMAGE_TAG} | awk '{ print $$2 }' | grep -q -F ${IMAGE_DEVEL_TAG}; then docker image rm --force ${IMAGE_DEVEL_TAG} ; false; fi

build:
docker build -t ${IMAGE_TAG} ${DOCKER_BUILD_FLAGS} .
docker build -t ${IMAGE_DEVEL_TAG} ${DOCKER_BUILD_FLAGS} .

run:
docker run -u root --rm -p 8080:8080 -p 50000:50000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-e JAVA_OPTS="-Dcom.cloudbees.jenkins.cjp.installmanager.CJPPluginManager.allRequired=${INCLUDE_ALL_BUNDLED_PLUGINS}" \
${IMAGE_TAG}
docker run --rm -p 8080:8080 ${IMAGE_TAG}

run-devel:
@if ls work ; then rm -rf work ; false; fi
rm -rf work
mkdir work
docker run -u root --rm -p 8080:8080 -p 50000:50000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-e JAVA_OPTS="-Dcom.cloudbees.jenkins.cjp.installmanager.CJPPluginManager.allRequired=${INCLUDE_ALL_BUNDLED_PLUGINS}" \
docker run --rm -p 8080:8080 \
-e VERBOSE=true \
-v $(CURDIR)/work:/var/jenkins_home/ \
${IMAGE_TAG}
-v $(CURDIR)/work:/var/cloudbees-jenkins-distribution/ \
${IMAGE_DEVEL_TAG}
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# JCasC Demo on CloudBees Jenkins Distribution

![Docker Pulls](https://img.shields.io/docker/pulls/cloudbees/cjd-jcasc-demo?logo=cloudbees)

| WARNING: This is a demo repository and image, it is not supported by CloudBees for production use |
| --- |

Expand All @@ -14,17 +16,9 @@ Note, this is a demo only and it doesn't configure a full production instance of

## Usage

### Building the image

* Ensure that Docker and Make are installed on your machine
* Checkout the repository
* Run `make build`

It will produce a local `cloudbees/cjd-jcasc-demo:rolling` image.

### Running

* Run the image using the `make run` command
* Run the image using the `docker run --rm -p 8080:8080 cloudbees/cjd-jcasc-demo` command
* Navigate to `http://localhost:8080`
* Login with the _admin/admin_ username/password pair
* **Register CloudBees Jenkins Distribution** screen.
Expand Down

0 comments on commit 45f6cc4

Please sign in to comment.