diff --git a/atlassian/fisheye-crucible/latest/Dockerfile b/atlassian/fisheye-crucible/latest/Dockerfile new file mode 100644 index 000000000..64f1fc496 --- /dev/null +++ b/atlassian/fisheye-crucible/latest/Dockerfile @@ -0,0 +1,52 @@ +FROM epicmorg/prod:jdk8 +LABEL maintainer="Atlassian Jira Server Team; EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +################################################################## +# ARGuments +################################################################## +ARG FECRU_VERSION=4.8.1 +ARG DOWNLOAD_URL=https://product-downloads.atlassian.com/software/fisheye/downloads/fisheye-${FECRU_VERSION}.zip + +ARG P4_VERSION=r19.2 +ARG P4_DOWNLOAD_URL=http://www.perforce.com/downloads/perforce/${P4_VERSION}/bin.linux26x86_64/p4 + +################################################################## +# Setup +################################################################## +ENV RUN_USER daemon +ENV RUN_GROUP daemon + +# https://confluence.atlassian.com/fisheye/fisheye-folder-layout-298976940.html +ENV FISHEYE_INST /opt/atlassian/fecru +ENV FISHEYE_HOME /var/atlassian/application-data/fecru + +VOLUME ["${FISHEYE_HOME}"] +WORKDIR $FISHEYE_HOME + +# Expose HTTP port +EXPOSE 8060 + +################################################################## +# Installing +################################################################## +RUN mkdir -p ${FISHEYE_INST} \ + && wget -nv --random-wait -c -P /usr/bin ${P4_DOWNLOAD_URL} \ + && wget -nv --random-wait -c ${DOWNLOAD_URL} -O /tmp/fisheye-${FECRU_VERSION}.zip \ + && unzip -q /tmp/fisheye-${FECRU_VERSION}.zip -d /tmp \ + && mv /tmp/fecru-${FECRU_VERSION}/* ${FISHEYE_INST} \ + && chown -R ${RUN_USER}:${RUN_GROUP} ${FISHEYE_INST} \ + && chmod +x /usr/bin/p4 \ + && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \ + && apt-get clean -y \ + && apt-get autoclean -y \ + && rm -rfv /tmp/fisheye-${FECRU_VERSION}.zip \ + && rm -rfv /tmp/fecru-${FECRU_VERSION} \ + && rm -rfv /var/lib/apt/lists/* \ + && rm -rfv /var/cache/apt/archives/*.deb + +COPY entrypoint.sh /entrypoint.sh +COPY . /tmp + +CMD ["/entrypoint.sh", "run"] +ENTRYPOINT ["/sbin/tini", "--"] diff --git a/atlassian/fisheye-crucible/latest/Makefile b/atlassian/fisheye-crucible/latest/Makefile new file mode 100644 index 000000000..973415421 --- /dev/null +++ b/atlassian/fisheye-crucible/latest/Makefile @@ -0,0 +1,5 @@ +all: fisheye-crucible + +fisheye-crucible: + docker build --compress -t epicmorg/fisheye-crucible:latest . + docker push epicmorg/fisheye-crucible:latest \ No newline at end of file diff --git a/atlassian/fisheye-crucible/latest/README.md b/atlassian/fisheye-crucible/latest/README.md new file mode 100644 index 000000000..e06bb6d22 --- /dev/null +++ b/atlassian/fisheye-crucible/latest/README.md @@ -0,0 +1,110 @@ +![Atlassian Fisheye](https://wac-cdn.atlassian.com/dam/jcr:0785bca2-a166-47ef-aeec-c657e7627af0/Fisheye@2x-blue.png?cdnVersion=363) +![Atlassian Crucible](https://wac-cdn.atlassian.com/dam/jcr:b601a46c-ece6-4cda-94ae-d95b1d94cbfd/Crucible@2x-blue.png?cdnVersion=363) + +With FishEye you can search code, visualize and report on activity and find for commits, files, revisions, or teammates across SVN, Git, Mercurial, CVS and Perforce. + +Atlassian Crucible takes the pain out of code review. Find bugs and improve code quality through peer code review from JIRA or your workflow. + +Learn more about Fisheye: [https://www.atlassian.com/software/fisheye](https://www.atlassian.com/software/fisheye) + +Learn more about Crucible: [https://www.atlassian.com/software/crucible](https://www.atlassian.com/software/crucible) + +# Overview + +This Docker container makes it easy to get an instance of Fisheye/Crucible up and running. + +# Quick Start + +For the `FISHEYE_INST` directory that is used to store the application data (amongst other things) we recommend mounting a host directory as a [data volume](https://docs.docker.com/engine/tutorials/dockervolumes/#/data-volumes), or via a named volume if using a docker version >= 1.9. + +To get started you can use a data volume, or named volumes. In this example we'll use named volumes. + + $> docker volume create --name fecruVolume + $> docker run -v fecruVolume:/var/atlassian/application-data/fecru --name="fecru" -d -p 8060:8060 epicmorg/fisheye-crucible + + +**Success**. Fisheye/Crucible is now available on [http://localhost:8060](http://localhost:8060)* + +Please ensure your container has the necessary resources allocated to it. We recommend 1GiB of memory allocated to accommodate the application server. See [Supported Platforms](https://confluence.atlassian.com/fisheye/supported-platforms-298976955.html) for further information. + + +_* Note: If you are using `docker-machine` on Mac OS X, please use `open http://$(docker-machine ip default):8060` instead._ + +## Memory / Heap Size + +If you need to override Fisheye/Crucible's default memory allocation, you can control the minimum heap (Xms) and maximum heap (Xmx) via the below environment variables. + +* `JVM_MINIMUM_MEMORY` (default: NONE) + + The minimum heap size of the JVM + +* `JVM_MAXIMUM_MEMORY` (default: 1024m) + + The maximum heap size of the JVM + + +## JVM configuration + +If you need to pass additional JVM arguments to Fisheye/Crucible, such as specifying a custom trust store, you can add them via the below environment variable + +* `FISHEYE_OPTS` + + Additional JVM arguments for Fisheye/Crucible + +* `JVM_SUPPORT_RECOMMENDED_ARGS` + + Additional JVM arguments for Fisheye/Crucible. These are appended to `FISHEYE_OPTS`; this option exists only for consistency with other Atlassian Docker images. + + +## Other configuration + +Additional configuration options are available to Fisheye/Crucible: + +* `FISHEYE_ARGS` + + The arguments which will be passed to Fisheye when it is started. You can set this to --debug, for example, or --debug-perf if you always want to have Fisheye debugging put into the Fisheye log files. See also [Command line options](https://confluence.atlassian.com/fisheye/command-line-options-298976950.html) + +* `FISHEYE_LIBRARY_PATH` + + Used to tell Fisheye where it should look to load any additional native libraries + + +Example: + + $> docker run -e JVM_SUPPORT_RECOMMENDED_ARGS=-Djavax.net.ssl.trustStore=/var/atlassian/application-data/fecru/cacerts -v fecruVolume:/var/atlassian/application-data/fecru --name="fecru" -d -p 8060:8060 epicmorg/fisheye-crucible + +# Upgrade + +To upgrade to a more recent version of Fisheye/Crucible you can simply stop the `fecru` container and start a new one based on a more recent image: + + $> docker stop fecru + $> docker rm fecru + $> docker run ... (See above) + +As your data is stored in the data volume directory on the host it will still be available after the upgrade. + +_Note: Please make sure that you **don't** accidentally remove the `fecru` container and its volumes using the `-v` option._ + +# Backup + +For evaluations you can use the built-in database that will store its files in the Fisheye/Crucible home directory. In that case it is sufficient to create a backup archive of the docker volume. + +If you're using an external database, you can configure Fisheye/Crucible to make a backup automatically each night. This will back up the current state, including the database to the `fecruVolume` docker volume, which can then be archived. Alternatively you can backup the database separately, and continue to create a backup archive of the docker volume to back up the `FISHEYE_INST` directory. + +Read more about data recovery and backups: [https://confluence.atlassian.com/fisheye/backing-up-and-restoring-fisheye-data-298976928.html](https://confluence.atlassian.com/fisheye/backing-up-and-restoring-fisheye-data-298976928.html) + +# Versioning + +The `latest` tag matches the most recent release of Atlassian Fisheye/Crucible. Thus `epicmorg/fisheye-crucible:latest` will use the newest version of Fisheye/Crucible available. + +Alternatively you can use a specific major, major.minor, or major.minor.patch version of Fisheye/Crucible by using a version number tag: + +* `epicmorg/fisheye-crucible:4` +* `epicmorg/fisheye-crucible:4.6` +* `epicmorg/fisheye-crucible:4.6.1` + +All versions from 4.0+ are available + +# Support + +This Docker container is unsupported and is intended for illustration purposes only. diff --git a/atlassian/fisheye-crucible/latest/entrypoint.sh b/atlassian/fisheye-crucible/latest/entrypoint.sh new file mode 100755 index 000000000..79505af8f --- /dev/null +++ b/atlassian/fisheye-crucible/latest/entrypoint.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -euo pipefail + +# Set up FISHEYE_OPTS +: ${JVM_MINIMUM_MEMORY:=} +: ${JVM_MAXIMUM_MEMORY:=} +: ${JVM_SUPPORT_RECOMMENDED_ARGS:=} + +: ${FISHEYE_OPTS:=} + +if [ "${JVM_MINIMUM_MEMORY}" != "" ]; then + FISHEYE_OPTS="${FISHEYE_OPTS} -Xms${JVM_MINIMUM_MEMORY}" +fi +if [ "${JVM_MAXIMUM_MEMORY}" != "" ]; then + FISHEYE_OPTS="${FISHEYE_OPTS} -Xmx${JVM_MAXIMUM_MEMORY}" +fi + +export FISHEYE_OPTS="${FISHEYE_OPTS} ${JVM_SUPPORT_RECOMMENDED_ARGS}" + +# Start Bamboo as the correct user +if [ "${UID}" -eq 0 ]; then + echo "User is currently root. Will change directory ownership to ${RUN_USER}:${RUN_GROUP}, then downgrade permission to ${RUN_USER}" + PERMISSIONS_SIGNATURE=$(stat -c "%u:%U:%a" "${FISHEYE_HOME}") + EXPECTED_PERMISSIONS=$(id -u ${RUN_USER}):${RUN_USER}:700 + if [ "${PERMISSIONS_SIGNATURE}" != "${EXPECTED_PERMISSIONS}" ]; then + chmod -R 700 "${FISHEYE_HOME}" && + chown -R "${RUN_USER}:${RUN_GROUP}" "${FISHEYE_HOME}" + fi + # Now drop privileges + exec su -s /bin/bash "${RUN_USER}" -c "$FISHEYE_INST/bin/fisheyectl.sh $@" +else + exec "$FISHEYE_INST/bin/fisheyectl.sh" "$@" +fi + diff --git a/epicmorg/prod/main/Dockerfile b/epicmorg/prod/main/Dockerfile index c64d463df..db6d3504e 100644 --- a/epicmorg/prod/main/Dockerfile +++ b/epicmorg/prod/main/Dockerfile @@ -21,6 +21,7 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio apt-transport-https \ apt-utils \ bash \ + binutils \ ca-certificates \ cmatrix \ cmatrix-xfont \ @@ -42,6 +43,7 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio lsof \ lynx \ mc \ + mercurial \ nano \ nmap \ openssl \ @@ -50,6 +52,7 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio rsync \ screenfetch \ smbclient \ + subversion \ sudo \ telnet \ tini \