diff --git a/README.md b/README.md index 0aed1fa..f3b4686 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,57 @@ ## Atlassian services + Version: 0.1.0 + This repository holds a dockerized orchestration of the Atlassian web apps Jira, Stash and Confluence. To simplify the usermangement Crowd is also included. For more information on the apps please refere to the offical Atlassian websites: -- [Jira](https://www.atlassian.com/software/jira) -- [Stash](https://www.atlassian.com/software/stash) -- [Confluence](https://www.atlassian.com/software/confluence) -- [Crowd](https://www.atlassian.com/software/crowd) +- [Jira][1] +- [Stash][2] +- [Confluence][3] +- [Crowd][4] ### Prerequisites In order to run this apps you need to make sure you're running at least -[docker 1.3.1](https://docker.com) and [fig 1.0.1](http://fig.sh). For -detailed installation instructions please refere to the origin websites: +[docker 1.6.0][5] and [docker-compose 1.2.0][6]. For detailed installation +instructions please refere to the origin websites: - - [http://docs.docker.com/installation](http://docs.docker.com/installation) - - [http://www.fig.sh/install.html](http://www.fig.sh/install.html) + - [https://docs.docker.com/installation][7] + - [https://docs.docker.com/compose][8] ### Deploy/Update the application # rebuild the docker images - $ fig build + $ docker-compose build - # restart the docker images - $ fig up -d + # start the docker images + $ docker-compose up -d # inspect the logs - $ fig logs + $ docker-compose logs If you deploy the apps for the first time you may need to restore the database from a backup for each app and adapt the database connection settings! -### Debug (aka. go inside) an image +### Develop Mode / Debug an image + + # start in development mode + $ docker-compose -f docker-compose-dev.yml up - # execute a bash shell + # execute a bash shell inside a running container $ docker exec -it atlassian_stash_1 bash + # add the following entrys to your `/etc/hosts` + $ boot2docker ip -> 192.168.59.103 + $ cat /etc/hosts + 192.168.59.103 boot2docker.local boot2docker + 192.168.59.103 stash.boot2docker.local stash + 192.168.59.103 jira.boot2docker.local jira + 192.168.59.103 docs.boot2docker.local docs + 192.168.59.103 crowd.boot2docker.local crowd + ### First run If you start this orchestration for the first time, a handy feature is to @@ -101,3 +115,13 @@ will pick them up automagically on the first run. postgres sh -c 'pg_restore -U crowd -h "$DB_PORT_5432_TCP_ADDR" \ -n public -w -d crowd /tmp/crowd.dump' +--- +[1]: https://www.atlassian.com/software/jira +[2]: https://www.atlassian.com/software/stash +[3]: https://www.atlassian.com/software/confluence +[4]: https://www.atlassian.com/software/crowd +[5]: https://docker.com +[6]: https://docs.docker.com/compose +[7]: https://docs.docker.com/installation +[8]: https://docs.docker.com/compose/#installation-and-set-up + diff --git a/bump-version.sh b/bump-version.sh new file mode 100755 index 0000000..2db6ed9 --- /dev/null +++ b/bump-version.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +VERSION_FILE='README.md' +VERSION_TEMP='README.tmp' + +function usage () { + echo "usage: bump-version " +} + +function update_version () { + sed -e "s/^ Version: .*$/ Version: $1/g" \ + $VERSION_FILE > $VERSION_TEMP +} + +function commit_version () { + git add $VERSION_FILE + git commit -m "Bumped version number to $1." +} + +if [ $# -ne 1 ]; then + usage + exit 1 +fi + +if ! update_version $1; then + echo "Could not bump the version!" >&2 + exit 2 +else + mv $VERSION_TEMP $VERSION_FILE +fi + +if ! commit_version $1; then + echo "Could not commit the version!" >&2 + exit 2 +fi diff --git a/fig.yml b/docker-compose-dev.yml similarity index 75% rename from fig.yml rename to docker-compose-dev.yml index 5525b43..750352d 100644 --- a/fig.yml +++ b/docker-compose-dev.yml @@ -1,6 +1,6 @@ nginx: - hostname: nginx build: docker/nginx + restart: no ports: - "80:80" - "443:443" @@ -11,8 +11,8 @@ nginx: - crowd stash: - hostname: stash build: docker/stash + restart: no ports: - "7990:7990" # no cache - "7999:7999" # ssh port @@ -22,8 +22,8 @@ stash: - stash-home:/opt/stash-home jira: - hostname: jira build: docker/jira + restart: no ports: - "8080:8080" # no cache links: @@ -32,8 +32,8 @@ jira: - jira-home:/opt/jira-home confluence: - hostname: confluence build: docker/confluence + restart: no ports: - "8090:8090" # no cache links: @@ -42,8 +42,8 @@ confluence: - confluence-home:/opt/confluence-home crowd: - hostname: crowd build: docker/crowd + restart: no ports: - "8095:8095" # no cache links: @@ -52,14 +52,8 @@ crowd: - crowd-home:/opt/crowd-home database: - hostname: database - build: docker/postgres + image: postgres:9.4 + restart: no volumes: + - docker/postgres:/docker-entrypoint-initdb.d - tmp:/tmp # import backups - volumes_from: - - persistent - -persistent: - image: busybox - volumes: - - /var/lib/postgresql/data diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..487d3f8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,60 @@ +nginx: + build: docker/nginx + restart: always + ports: + - "80:80" + - "443:443" + links: + - stash + - jira + - confluence + - crowd + +stash: + build: docker/stash + restart: always + ports: + - "7990:7990" # no cache + - "7999:7999" # ssh port + links: + - database + volumes: + - stash-home:/opt/stash-home + +jira: + build: docker/jira + restart: always + ports: + - "8080:8080" # no cache + links: + - database + volumes: + - jira-home:/opt/jira-home + +confluence: + build: docker/confluence + restart: always + ports: + - "8090:8090" # no cache + links: + - database + volumes: + - confluence-home:/opt/confluence-home + +crowd: + build: docker/crowd + restart: always + ports: + - "8095:8095" # no cache + links: + - database + volumes: + - crowd-home:/opt/crowd-home + +database: + image: postgres:9.4 + restart: always + volumes: + - data:/var/lib/postgresql/data + - docker/postgres:/docker-entrypoint-initdb.d + - tmp:/tmp # import backups diff --git a/docker/confluence/Dockerfile b/docker/confluence/Dockerfile index ef1f7b5..fabbf03 100644 --- a/docker/confluence/Dockerfile +++ b/docker/confluence/Dockerfile @@ -1,6 +1,6 @@ FROM dockerfile/java:oracle-java7 -ENV CONFLUENCE_VERSION 5.6.5 +ENV CONFLUENCE_VERSION 5.7.1 ENV CONFLUENCE_HOME /opt/confluence-home RUN useradd --create-home --home-dir /opt/confluence \ @@ -8,10 +8,13 @@ RUN useradd --create-home --home-dir /opt/confluence \ RUN mkdir /opt/confluence-home && \ chown -R confluence:confluence /opt/confluence-home RUN wget -O - \ - http://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz \ - | tar xzf - --strip=1 -C /opt/confluence \ + http://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz \ + | tar xzf - --strip=1 -C /opt/confluence \ + && perl -i -p -e 's/-Xms1024m/-Xms128m/' /opt/confluence/bin/setenv.sh \ + && perl -i -p -e 's/-Xmx1024m/-Xmx512m/' /opt/confluence/bin/setenv.sh \ + && perl -i -p -e 's/_%T//' /opt/confluence/bin/setenv.sh \ && echo "confluence.home = ${CONFLUENCE_HOME}" > \ - /opt/confluence/confluence/WEB-INF/classes/confluence-init.properties \ + /opt/confluence/confluence/WEB-INF/classes/confluence-init.properties \ && chown -R confluence:confluence /opt/confluence WORKDIR /opt/confluence diff --git a/docker/postgres/Dockerfile b/docker/postgres/Dockerfile deleted file mode 100644 index ece6bcc..0000000 --- a/docker/postgres/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM postgres:9.3 -ADD setup-jira-db.sh /docker-entrypoint-initdb.d/ -ADD setup-stash-db.sh /docker-entrypoint-initdb.d/ -ADD setup-crowd-db.sh /docker-entrypoint-initdb.d/ -ADD setup-confluence-db.sh /docker-entrypoint-initdb.d/ diff --git a/postgres-data/.gitignore b/postgres-data/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/postgres-data/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore