Skip to content

Commit

Permalink
Merge branch 'release/v4.0.5-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbehlendorf committed Dec 2, 2019
2 parents fb17c29 + dfe5644 commit d1c93d7
Show file tree
Hide file tree
Showing 17 changed files with 675 additions and 96 deletions.
75 changes: 75 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]


## [v4.0.5-1] - 2019-12-02
### Changed
- Upgrade to Redmine 4.0.5
- Switch from WEBrick to Puma web server
- Update [redmine_cas plugin](https://github.com/cloudogu/redmine_cas) to v1.2.14
- Update [redmine_activerecord_session_store plugin](https://github.com/cloudogu/redmine_activerecord_session_store) to v0.1.0
- Update [rubycas-client plugin](https://github.com/cloudogu/rubycas-client) to v2.3.15

### Removed
- Gem activerecord-deprecated_finders was removed as it is not maintained in Rails 5 any more. See https://github.com/rails/activerecord-deprecated_finders

## [v3.4.11-1] - 2019-09-04
### Changed
- Update to Redmine 3.4.11

## [v3.4.10-2] - 2019-05-27
### Fixed
- Fix bug "Thumbnails not visible any more" #20

## [v3.4.10-1] - 2019-05-23
### Changed
- Upgrade to Redmine 3.4.10

## [v3.4.8-2] - 2019-01-30
### Fixed
- Fix glitch during the release of v3.4.8-1

## [v3.4.8-1] - 2019-01-30
### Changed
- Upgrade to Redmine 3.4.8

## [v3.4.2-6] - 2018-11-16
### Added
- Introduces the NeedsBackup flag:
- included volumes: plugins, volumes
- not included volumes: logs

## [v3.4.2-5] - 2018-05-27
### Added
- Add option for configurable mail address #9

## [v3.4.2-4] - 2017-11-30
### Fixed
- Completes fix for bug regarding links to issues in generated mails #3

## [v3.4.2-3] - 2017-11-23
### Fixed
- Fix for bug regarding links to issues in generated mails #3

## [v3.4.2-2] - 2017-09-28
### Changed
- Update cas plugin to 1.2.13

## [v3.4.2-1] - 2017-08-08
### Changed
- improve installation of core plugins
- Core plugins are now backed into the image and only manual installed plugins are installed durring startup.

## [v3.3.2-4] - 2017-08-03
### Changed
- enabled gravatar and markdown by default
- improve plugin and theme installation

### Fixed
- fix wrong url in notifications
- fix group synchronization on api login
87 changes: 53 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
# registry.cloudogu.com/official/redmine
FROM registry.cloudogu.com/official/base:3.9.4-1
FROM registry.cloudogu.com/official/base:3.9.4-2

LABEL NAME="official/redmine" \
VERSION="3.4.11-1" \
VERSION="4.0.5-1" \
maintainer="[email protected]"

# This Dockerfile is based on https://github.com/docker-library/redmine/blob/master/4.0/alpine/Dockerfile

# set environment variables
ENV REDMINE_VERSION=3.4.11 \
CAS_PLUGIN_VERSION=1.2.13 \
ACTIVERECORD_SESSION_STORE_PLUGIN_VERSION=0.0.1 \
RUBYCASVERSION=2.3.13 \
ENV REDMINE_VERSION=4.0.5 \
CAS_PLUGIN_VERSION=1.2.14 \
ACTIVERECORD_SESSION_STORE_PLUGIN_VERSION=0.1.0 \
RUBYCASVERSION=2.3.15 \
USER=redmine \
BASEDIR=/usr/share/webapps \
WORKDIR=/usr/share/webapps/redmine \
SERVICE_TAGS=webapp
SERVICE_TAGS=webapp \
RAILS_ENV=production \
REDMINE_TARGZ_SHA256=64eabe6867fd5d14d1b4c584417b9b71fbb9b68a019400eeb03e1f2147c369e8 \
CAS_PLUGIN_TARGZ_SHA256=184cbb41abde38e85aae1f4f0117adf2f1eff061ccfe377c91c3545428c5ad46 \
ACTIVERECORD_TARGZ_SHA256=a5d3a5ac6c5329212621bab128a2f94b0ad6bb59084f3cc714786a297bcdc7ee \
RUBYCAS_TARGZ_SHA256=9ca9b2e020c4f12c3c7e87565b9aa19dda130912138d80ad6775e5bdc2d4ca66 \
RAILS_RELATIVE_URL_ROOT=/redmine \
CLOUDOGU_THEME_VERSION=2.8.0-1 \
THEME_TARGZ_SHA256=4bd81861bafecf27ed41316697c011dbf73b7379f547b1993b8898e210cff0db

# copy resource files
COPY resources/ /

# install theme, before the ownership is changed
ADD packages/cloudogu.tar.gz ${WORKDIR}/public/themes

RUN set -x \
RUN set -eux -o pipefail \
# add user and group
&& addgroup -S "${USER}" -g 1000 \
&& adduser -S -h "${WORKDIR}" -G "${USER}" -u 1000 -s /bin/bash "${USER}" \
Expand Down Expand Up @@ -58,43 +65,55 @@ RUN set -x \
&& 2>/dev/null 1>&2 gem update --system --quiet \
# install redmine
&& mkdir -p ${WORKDIR} \
&& curl -L http://www.redmine.org/releases/redmine-${REDMINE_VERSION}.tar.gz | tar xfz - --strip-components=1 -C ${WORKDIR} \
&& mkdir -p /redmine_source \
&& wget "https://www.redmine.org/releases/redmine-${REDMINE_VERSION}.tar.gz" \
&& echo "${REDMINE_TARGZ_SHA256} *redmine-${REDMINE_VERSION}.tar.gz" | sha256sum -c - \
&& tar -xf redmine-${REDMINE_VERSION}.tar.gz --strip-components=1 -C ${WORKDIR} \
&& mv redmine-${REDMINE_VERSION}.tar.gz /redmine_source/redmine-${REDMINE_VERSION}.tar.gz \
&& mkdir -p ${WORKDIR}/app/assets/config && touch ${WORKDIR}/app/assets/config/manifest.js \
# set temporary database configuration for bundle install
&& DATABASE_TYPE=postgresql \
DATABASE_IP=localhost \
DATABASE_DB=redmine \
DATABASE_USER=redmine \
DATABASE_USER_PASSWORD=redmine \
eval "echo \"$(cat ${WORKDIR}/config/database.yml.tpl)\"" > ${WORKDIR}/config/database.yml \
# Install (available) rubycas-client version
&& git clone https://github.com/cloudogu/rubycas-client.git \
&& cp ${WORKDIR}/config/database.yml.tpl ${WORKDIR}/config/database.yml \
# Install rubycas-client
&& wget -O v${RUBYCASVERSION}.tar.gz "https://github.com/cloudogu/rubycas-client/archive/v${RUBYCASVERSION}.tar.gz" \
&& echo "${RUBYCAS_TARGZ_SHA256} *v${RUBYCASVERSION}.tar.gz" | sha256sum -c - \
&& mkdir rubycas-client \
&& tar xfz v${RUBYCASVERSION}.tar.gz --strip-components=1 -C rubycas-client \
&& rm v${RUBYCASVERSION}.tar.gz \
&& cd rubycas-client \
&& gem build rubycas-client.gemspec \
&& gem install rubycas-client-${RUBYCASVERSION}.gem \
&& cd ..; rm -rf rubycas-client \
&& cd .. \
&& rm -rf rubycas-client \
# install redmine required gems
&& echo 'gem "activerecord-session_store"' >> ${WORKDIR}/Gemfile \
&& echo 'gem "activerecord-deprecated_finders", require: "active_record/deprecated_finders"' >> ${WORKDIR}/Gemfile \
# json gem missing in default installation?
&& echo 'gem "json"' >> ${WORKDIR}/Gemfile \
# install required gems
&& cd ${WORKDIR}; RAILS_ENV="production" bundle install --without development test \
# override environment to run redmine with a context path "/redmine"
&& mv ${WORKDIR}/config/environment.ces.rb ${WORKDIR}/config/environment.rb \
# install core plugins
&& mkdir -p "${WORKDIR}/plugins" \
# install cas plugin
&& mkdir "${WORKDIR}/plugins/redmine_cas" \
&& curl -sL \
https://github.com/cloudogu/redmine_cas/archive/${CAS_PLUGIN_VERSION}.tar.gz \
| tar xfz - --strip-components=1 -C "${WORKDIR}/plugins/redmine_cas" \
&& wget -O v${CAS_PLUGIN_VERSION}.tar.gz "https://github.com/cloudogu/redmine_cas/archive/v${CAS_PLUGIN_VERSION}.tar.gz" \
&& echo "${CAS_PLUGIN_TARGZ_SHA256} *v${CAS_PLUGIN_VERSION}.tar.gz" | sha256sum -c - \
&& tar xfz v${CAS_PLUGIN_VERSION}.tar.gz --strip-components=1 -C "${WORKDIR}/plugins/redmine_cas" \
&& rm v${CAS_PLUGIN_VERSION}.tar.gz \
# install Cloudogu theme
&& mkdir -p "${WORKDIR}/public/themes/Cloudogu" \
&& wget -O v${CLOUDOGU_THEME_VERSION}.tar.gz "https://github.com/cloudogu/PurpleMine2/releases/download/v${CLOUDOGU_THEME_VERSION}/CloudoguRedmineTheme-${CLOUDOGU_THEME_VERSION}.tar.gz" \
&& echo "${THEME_TARGZ_SHA256} *v${CLOUDOGU_THEME_VERSION}.tar.gz" | sha256sum -c - \
&& tar xfz v${CLOUDOGU_THEME_VERSION}.tar.gz --strip-components=1 -C "${WORKDIR}/public/themes/Cloudogu" \
&& rm v${CLOUDOGU_THEME_VERSION}.tar.gz \
# install redmine_activerecord_session_store to be able to invalidate sessions after cas logout
&& mkdir "${WORKDIR}/plugins/redmine_activerecord_session_store" \
&& curl -sL \
https://github.com/pencil/redmine_activerecord_session_store/archive/v${ACTIVERECORD_SESSION_STORE_PLUGIN_VERSION}.tar.gz \
| tar xfz - --strip-components=1 -C "${WORKDIR}/plugins/redmine_activerecord_session_store" \
# install plugin gems
&& cd ${WORKDIR}; RAILS_ENV="production" bundle install --without development test \
&& wget -O v${ACTIVERECORD_SESSION_STORE_PLUGIN_VERSION}.tar.gz "https://github.com/cloudogu/redmine_activerecord_session_store/archive/v${ACTIVERECORD_SESSION_STORE_PLUGIN_VERSION}.tar.gz" \
&& echo "${ACTIVERECORD_TARGZ_SHA256} *v${ACTIVERECORD_SESSION_STORE_PLUGIN_VERSION}.tar.gz" | sha256sum -c - \
&& tar xfz v${ACTIVERECORD_SESSION_STORE_PLUGIN_VERSION}.tar.gz --strip-components=1 -C "${WORKDIR}/plugins/redmine_activerecord_session_store" \
&& rm v${ACTIVERECORD_SESSION_STORE_PLUGIN_VERSION}.tar.gz \
# install required and plugin gems
&& cd ${WORKDIR} \
&& bundle install --without development test \
&& gem install puma \
# cleanup
&& gem cleanup all \
&& rm -rf /root/* /tmp/* $(gem env gemdir)/cache \
Expand All @@ -107,7 +126,7 @@ WORKDIR ${WORKDIR}
# expose application port
EXPOSE 3000

HEALTHCHECK CMD [ $(doguctl healthy redmine; EXIT_CODE=$?; echo ${EXIT_CODE}) == 0 ]
HEALTHCHECK CMD [ $(doguctl healthy redmine; echo $?) == 0 ]

# start
CMD /startup.sh
CMD ["/startup.sh"]
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ node('vagrant') {

stage('Lint') {
lintDockerfile()
shellCheck("./resources/pre-upgrade.sh ./resources/startup.sh ./resources/post-upgrade.sh")
shellCheck("./resources/startup.sh ./resources/post-upgrade.sh ./resources/pre-upgrade.sh ./resources/util.sh")
}

try {
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Cloudogu
Copyright (c) 2019 Cloudogu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 8 additions & 6 deletions dogu.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Name": "official/redmine",
"Version": "3.4.11-1",
"Version": "4.0.5-1",
"DisplayName": "Redmine",
"Description": "Redmine is a flexible project management web application",
"Category": "Development Apps",
Expand Down Expand Up @@ -35,15 +35,17 @@
"ServiceAccounts": [{
"Type": "postgresql"
}],
"HealthCheck": {
"HealthChecks": [{
"Type": "tcp",
"Port": 3000
},
"ExposedCommands": [{
"Name": "pre-upgrade",
"Command": "/pre-upgrade.sh"
},{
"Type": "state"
}],
"ExposedCommands": [{
"Name": "post-upgrade",
"Command": "/post-upgrade.sh"
},{
"Name": "pre-upgrade",
"Command": "/pre-upgrade.sh"
}]
}
4 changes: 2 additions & 2 deletions integrationTests/expectations.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ exports.expectState = function(state) {
}

exports.expectCasLogin = function(url) {
expect(url).toBe(config.baseUrl + '/cas/login?service=https%3A%2F%2F' + config.fqdn + '%2Fredmine%2Fcas%3Fref%3D%252Fredmine');
expect(url).toBe(config.baseUrl + '/cas/login?service=https%3A%2F%2F' + config.fqdn + '%2Fredmine%2Fcas%3Fref%3D%252Fredmine%252F');
}

exports.expectCasLogout = function(url) {
expect(url).toBe(config.baseUrl + '/cas/logout?destination=https%3A%2F%2F' + config.fqdn + '%2Fredmine&gateway=true');
expect(url).toBe(config.baseUrl + '/cas/logout?destination=https%3A%2F%2F' + config.fqdn + '%2Fredmine%2F&gateway=true');
}
Binary file removed packages/cloudogu.tar.gz
Binary file not shown.
21 changes: 21 additions & 0 deletions resources/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Cloudogu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
43 changes: 37 additions & 6 deletions resources/post-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,52 @@ set -o errexit
set -o nounset
set -o pipefail

# import util functions:
# - create_secrets_yml
# - render_config_ru_template
# - render_database_yml_template
# - render_configuration_yml_template
# - exec_rake
#
# import util variables:
# - RAILS_ENV
# - REDMINE_LANG
#
# shellcheck disable=SC1091
source /util.sh

FROM_VERSION="${1}"
TO_VERSION="${2}"

echo "Executing Redmine post-upgrade from ${FROM_VERSION} to ${TO_VERSION}"

if [ "${FROM_VERSION}" = "${TO_VERSION}" ]; then
echo "FROM and TO versions are the same; Exiting..."
exit 0
fi

function exec_rake() {
RAILS_ENV="production" REDMINE_LANG="en" rake --trace -f "${WORKDIR}"/Rakefile "$*"
}
echo "Making sure config/secrets.yml exists..."
create_secrets_yml

echo "Rendering config.ru template..."
render_config_ru_template

echo "Rendering database.yml template..."
render_database_yml_template

echo "executing update ${FROM_VERSION} to ${TO_VERSION}"
echo "Generating configuration.yml from template..."
render_configuration_yml_template

echo "migrate database ..."
echo "Migrating database..."
exec_rake db:migrate

echo "migrate plugins ..."
echo "Migrating plugins..."
exec_rake redmine:plugins:migrate

echo "Clearing cache..."
exec_rake tmp:cache:clear

echo "Set registry flag so startup script can start afterwards..."
doguctl state "upgrade done"

echo "Redmine post-upgrade done"
27 changes: 13 additions & 14 deletions resources/pre-upgrade.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
#!/bin/bash

# older installation of redmine exposed the core plugins to the
# plugin volume, these exposed plugin could be old and must be
# removed.

set -o errexit
set -o nounset
set -o pipefail

PLUGIN_DIRECTORY="${WORKDIR}/plugins"
CORE_PLUGINS="redmine_activerecord_session_store redmine_cas"
FROM_VERSION="${1}"
TO_VERSION="${2}"

echo "Executing Redmine pre-upgrade from ${FROM_VERSION} to ${TO_VERSION}"

if [ "${FROM_VERSION}" = "${TO_VERSION}" ]; then
echo "FROM and TO versions are the same; Exiting..."
exit 0
fi

echo "Set registry flag so startup script waits for post-upgrade to finish..."
doguctl state "upgrading"

for CP in ${CORE_PLUGINS}; do
CP_DIR="${PLUGIN_DIRECTORY}/${CP}"
if [ -d "${CP_DIR}" ]; then
echo "remove old installation of ${CP}"
rm -rf "${CP_DIR}"
fi
done
echo "Redmine pre-upgrade done"
Loading

0 comments on commit d1c93d7

Please sign in to comment.