Skip to content

Commit

Permalink
Add Hacking documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
batmat committed Dec 12, 2018
1 parent 99b0ebb commit e921ebe
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 22 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -14,3 +14,5 @@ If after going through the previous checklist you still think you should create
* Have you tried a non-dockerized Jenkins and get the expected outcome?
* Output of `docker version`
* Other relevant information

If you are interested to provide fixes by yourself, you might want to check out the [dedicated documentation](HACKING.adoc).
43 changes: 43 additions & 0 deletions HACKING.adoc
@@ -0,0 +1,43 @@
# Hacking documentation

This document explains how to develop on this repository.

## Building

Build with the usual

docker build -t jenkins/jenkins .

Tests are written using [bats](https://github.com/sstephenson/bats) under the `tests` dir

DOCKERFILE=Dockerfile bats tests
DOCKERFILE=Dockerfile-alpine bats tests

Download the test helpers by updating the submodules

git submodule update --init --recursive

Bats can be easily installed with `brew install bats` on OS X



## Debugging

In order to debug the master, use the `-e DEBUG=true -p 5005:5005` when starting the container.
Jenkins will be suspended on the startup in such case,
and then it will be possible to attach a debugger from IDE to it.

## How to test the publishing using an overriden target repository on Docker Hub

Create a new dedicated target repository in your Docker Hub account, and use it like follows:

[source]
--
export DOCKERHUB_ORGANISATION=batmat
export DOCKERHUB_REPO=test-jenkins
# The log below will help confirm this override was taken in account:
./publish.sh --variant jdk11
Docker repository in Use:
* JENKINS_REPO: batmat/test-jenkins
...
--
24 changes: 2 additions & 22 deletions README.md
Expand Up @@ -261,29 +261,9 @@ By default, plugins will be upgraded if they haven't been upgraded manually and

The default behaviour when upgrading from a docker image that didn't write marker files is to leave existing plugins in place. If you want to upgrade existing plugins without marker you may run the docker image with `-e TRY_UPGRADE_IF_NO_MARKER=true`. Then plugins will be upgraded if the version provided by the docker image is newer.

# Building
## Hacking

Build with the usual

docker build -t jenkins/jenkins .

Tests are written using [bats](https://github.com/sstephenson/bats) under the `tests` dir

DOCKERFILE=Dockerfile bats tests
DOCKERFILE=Dockerfile-alpine bats tests

Download the test helpers by updating the submodules

git submodule update --init --recursive

Bats can be easily installed with `brew install bats` on OS X


# Debugging

In order to debug the master, use the `-e DEBUG=true -p 5005:5005` when starting the container.
Jenkins will be suspended on the startup in such case,
and then it will be possible to attach a debugger from IDE to it.
If you wish to contribute fixes to this repository, please refer to the [dedicated documentation](HACKING.adoc).

# Questions?

Expand Down

0 comments on commit e921ebe

Please sign in to comment.