EEA & Eionet documentation hub

Browse documentation for IT-systems used by the European Environment Agency and the Eionet network.

EEA Taskman docker setup

eea.docker.taskman

Taskman is a web application based on Redmine that facilitates Agile project management for EEA and Eionet software projects. It comes with some plugins and specific Eionet redmine theme.

Prerequisites

Setting up Taskman development replica

  1. Clone repository

    $ cd /var/local/deploy
    $ git clone https://github.com/eea/eea.docker.taskman
    $ cd eea.docker.taskman
    
  2. Copy the .zip archives containing the paid plugins into the eea.docker.taskman/plugins directory

  3. Update *.secret files - ask techlead for development values

* change TASKMAN_URL to your dev domain ( .email.secret )
* change SYNC_REDMINE_URL to your dev domain ( .redmine.secret )
* add a blank value for now for the HELPDESK_EMAIL_KEY   4. Start the dev containers using the folowing command:



    $ docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
  1. Sync data from production:
* Redmine files [Import Taskman files](https://github.com/eea/eea.docker.taskman#import-taskman-files)
* MySQL database [Import Taskman database](https://github.com/eea/eea.docker.taskman#import-taskman-database)   6. Re-build stack



    $ docker-compose -f docker-compose.yml -f docker-compose.dev.yml stop
    $ docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
  1. Give user administrator rights, if necessary:

    $ docker exec -it eeadockertaskman_mysql_1 bash $ mysql -u<MYSQL_ROOT_USER> -p<MYSQL_ROOT_PASSWORD> <MYSQL_DB_NAME>            $ update users set admin=1 where login=<USER_NAME>; $ exit
    
  2. Disable helpdesk email accounts from the following Taskman projects ( needs to be done only if database was copied from production):

* check via Redmine REST API where Helpdesk module is enabled

  * http://YOUR_TASKMAN_DEV_HOST/projects.xml?include=enabled_modules&amp;limit=1000 
    * &lt;enabled_module id="111" name="contacts"/&gt;
    * &lt;enabled_module id="222" name="contacts_helpdesk"/&gt;
  * currentlly the projects REST API is not showing all the projects. This are the known projects where the Helpdesk module is enabled: 
    * zope (IDM2 A-Team)
    * it-helpdesk (IT Helpdesk)
    * ied (CWS support)
  * alternativelly you can connect to the MySQL server and do the following queries: 
    * select * from enabled_modules where name='contacts_helpdesk';
    * select * from enabled_modules where name='contacts';
    * select identifier, name, id from projects where id in ( select project_id from enabled_modules where name='contacts_helpdesk' union all select project_id from enabled_modules where name='contacts_helpdesk');
* delete _Incoming mail server_ settings ( from _Mail server settings_ ) from all projects excluding zope found in previous step using the following url: http://YOUR_TASKMAN_DEV_HOST:8080/projects/&lt;PROJECT_IDENTIFIER&gt;/settings/helpdesk
  1. If the database was copied from production, change the following settings to set-up the development mail account :
* http://YOUR_TASKMAN_DEV_HOST/projects/zope/settings/helpdesk :

  * From address: support.taskmannt AT eea.europa.eu
  * User name: support.taskmannt AT eea.europa.eu
  * Password
* http://YOUR_TASKMAN_DEV_HOST/settings/plugin/redmine_contacts_helpdesk?tab=general ( From address: support.taskmannt AT eea.europa.eu )

* http://YOUR_TASKMAN_DEV_HOST/settings?tab=notifications ( Emission email address: taskmannt AT eionet.europa.eu )
  1. If the database was copied from production, set the banner to development message
* http://YOUR_TASKMAN_DEV_HOST/settings/plugin/redmine_banner ( Banner message: This is a Taskman development replica, please do not use/login if you are not part of the development team.)   11. Setup network and firewall to allow access of the devel host on the EEA email accounts.

* Get &lt;H_EMAIL_HOST&gt; and &lt;H_EMAIL_PORT&gt; values from .email.secret file
* Check

    $ telnet <H_EMAIL_HOST> <H_EMAIL_PORT>


* If telnet command unsuccesfull, create issue in Infrastructure project to solve this   12. Change the following settings:

* http://YOUR_TASKMAN_DEV_HOST/settings?tab=general ( Host name and path: YOUR_TASKMAN_DEV_HOST )   13. Update .email.secret file with API key:

* add value from http://YOUR_TASKMAN_DEV_HOST/settings?tab=mail_handler, "API key" to HELPDESK_EMAIL_KEY   14. Test e-mails using mailtrap on the folowing address: http://YOUR_TASKMAN_DEV_HOST:8081

First time installation of the Taskman frontend stack on Production

Copy the certificates

$ cd /var/local/deploy
$ mkdir www-eea-certs
$ cp bundle-eionet.crt ./www-eea-certs
$ cp server-eionet.key ./www-eea-certs

Clone the repository

$ cd /var/local/deploy
$ git clone https://github.com/eea/eea.docker.taskman
$ cd eea.docker.taskman

Start the Apache service

$ docker-compose -f frontend-compose.yml up -d

First time installation of the Taskman backend stack on Production

Clone the repository

$ cd /var/local/deploy
$ git clone https://github.com/eea/eea.docker.taskman
$ cd eea.docker.taskman

During the first time deployment, create the secret environment files

$ cp .mysql.secret.example .mysql.secret
$ cp .redmine.secret.example .redmine.secret
$ cp .postfix.secret.example .postfix.secret
$ cp .email.secret.example .email.secret

Edit the secret files with real settings, email settings will be setup at the end

$ vim .mysql.secret
$ vim .redmine.secret

Follow import existing data if you need to import existing data

Start Taskman servicies

$ docker-compose up -d

Start updating Taskman if you updated the Redmine version or if you updated the Redmine’s plugins.

Import existing data

If you already have a Taskman installation than follow the steps below to import the files and mysql db into the data containers.

Import Taskman files

Copy Taskman files from one instance ( ex. production ) to another ( ex. replica) .

  1. Start rsync client on host from where do you want to migrate data (ex. production)

    $ docker run -it –rm –name=r-client \ –volumes-from=eeadockertaskman_redmine_1 \ eeacms/rsync sh

  2. Start rsync server on host from where do you want to migrate data (ex. devel)

    $ docker run -it –rm –name=r-server -p 2222:22 \ –volumes-from=eeadockertaskman_redmine_1 \ -e SSH_AUTH_KEY=”" \ eeacms/rsync server

  3. Within rsync client container from step 1 run:

    $ rsync -e ‘ssh -p 2222’ -avz /usr/src/redmine/files/ root@:/usr/src/redmine/files/

  4. Close rsync client

    $ CTRL+d

  5. Close rsync server

    $ docker kill r-server

Import Taskman database

Replace the < MYSQL_ROOT_USER > and < MYSQL_ROOT_PASSWORD > with your values.

  1. Make a dump of the database from source server.

    $ docker exec -it eeadockertaskman_mysql_1 bash $ mysqldump -u -p --add-drop-table > /var/local/backup/taskman.sql

    $ exit
  2. Start rsync client on source server

    $ docker run -it –rm –name=r-client \ –volumes-from=eeadockertaskman_mysql_1 \ eeacms/rsync sh

  3. Start mysql and the rsync server on destination server

The eeadockertaskman_mysql_1 container must be started, check documentation for start command

must contain “ssh-rsa …”

  $ docker run -it --rm --name=r-server -p 2222:22 \
               --volumes-from=eeadockertaskman_mysql_1 \
               -e SSH_AUTH_KEY="<SSH-KEY-FROM-R-CLIENT-ABOVE>" \
           eeacms/rsync server
  1. Sync mysql dump. Within rsync client container from step 2 (source server) run:

    $ scp -P 2222 /var/local/backup/taskman.sql root@:/var/local/backup/ $ exit

  2. Close rsync client

    $ CTRL+d

  3. Import the dump file (on destination server)

    $ docker exec -it eeadockertaskman_mysql_1 bash $ mysql -u -p < /var/local/backup/taskman.sql

    $ exit
  4. Close rsync server

    $ docker kill r-server

Email settings

IMPORTANT: test first if the email notification are sent! Use first time the email accounts marked as email configuration without affecting production from the .email.secret file.

Features to be tested:

  • create ticket via email
  • create ticket for Helpdesk
  • receive email notification on content update
  • email issue reminder notification

Edit email configuration for helpdesk and taskman accounts

$ vim .email.secret

Edit email configuration for redmine

$ vim .postfix.secret

Restart postfix container

$ docker-compose stop postfix
$ docker-compose rm -v postfix
$ docker-compose up -d postfix

Upgrade procedure

Only for upgrade to 3.2.4 ( 09.10.2017 )

Uninstall redmine_mail_reminder plugin using Uninstall plugins

Cleanup & Backup before upgrade

  1. Make a backup of database

    $ docker exec -it eeadockertaskman_mysql_1 sh -c “mysqldump -u -p --add-drop-table > /var/local/backup/taskman.sql"

  2. Pull latest version of redmine to minimize waiting time during the next step

    $ docker pull eeacms/redmine:

  3. Update repository

    $ git pull

  4. Backup existing plugins and remove them from plugins directory

    $ docker exec -it eeadockertaskman_redmine_1 sh -c “rm -rf /usr/src/redmine/plugins/*”

  5. Stop all services

    $ docker-compose stop

  6. Remove redmine container to be able to recreate plugins from image

    $ docker-compose rm redmine

  7. Start all

    $ docker-compose up -d

Upgrade Redmine version

Start updating Taskman

$ docker exec -it eeadockertaskman_redmine_1 bash
$ bundle exec rake db:migrate RAILS_ENV=production

If required by the migrate, run

$ bundle install

Finish upgrade

$ bundle exec rake tmp:cache:clear tmp:sessions:clear RAILS_ENV=production
$ exit
$ docker-compose stop redmine
$ docker-compose start redmine

Upgrade premium plugins

Update premium plugins ( .zip archives ) located in eea.docker.taskman/plugins directory

$ docker exec -it eeadockertaskman_redmine_1 bash
$ ./install_plugins.sh
$ docker-compose stop redmine
$ docker-compose start redmine

Upgrade Redmine’s plugins

Does not need to be run if install_plugins.sh was executed

$ bundle install --without development test
$ bundle exec rake redmine:plugins:migrate RAILS_ENV=production

End of install/upgrade procedure(s)

For this final steps you will need help from a sys admin.

  • close current production, follow wiki here
  • re-run rsync files
  • re-take mysql dump
  • re-import mysql dump
  • run upgrade commands if there is a new Redmine version
  • start the new installation
  • switch floating IP

Finally go to “Administration -> Roles & permissions” to check/set permissions for the new features, if any.

Follow any other manual steps via redmine UI needed e.g. when adding new plugins.

How-tos

How to add repository to redmine

Prerequisites: You have “Manager”/”Product Owner”-role in your .

  1. Within Redmine Web Interface of your project: Settings > Repositories > Add new repository
* SCM: Git
* Identifier: eea-mypackage
* Path to repository: /var/local/redmine/github/eea.mypackage.git



All local repositories within */var/local/redmine/github* folder are synced automatically
from https://github.com/eea every 5 minutes (see */etc/chaperone.d/chaperone.conf* and
*/var/local/redmine/crons/redmine_github_sync.sh*) so you don't have to add them manually on server side.
  1. Update users mapping for your new repository:
* Within Redmine Web Interface &gt; Projects &gt; &gt; Settings &gt; Repositories click on _Users_ link available for your new repository and Update missing users

If it still doesn’t update automatically after a while:

  • login to the docker host and become root
  • enter the redmine container (docker exec -it eeadockertaskman_redmine_1 bash)
  • cd /var/local/redmine/github
  • git clone –mirror https://github.com/eea/eea.mypackage.git
  • cd eea.mypackage.git
  • git fetch –all
  • chown -R apache.apache .

You can “read more”:http://www.redmine.org/projects/redmine/wiki/HowTo_keep_in_sync_your_git_repository_for_redmine

How to add check Redmine’s logs

$ docker-compose logs redmine

or

$ docker exec -it eeadockertaskman_redmine_1 bash
$ tail -f /usr/src/redmine/log/production.log

How to manually sync LDAP users/groups

If you want to manually sync LDAP users and/or groups you need to run the following rake command inside the redmine container:

$ docker exec -it eeadockertaskman_redmine_1 bash
redmine@76547b4110ab:~/redmine$ bundle exec rake -T redmine:plugins:ldap_sync

For more info see the LDAP sync documentation

How to install Redmine Premium plugins

$ cd /var/local/deploy/eea.docker.taskman/plugins
$ docker-compose stop
$ wget <URL-TO-DOWNLOAD-ZIPPED-PLUGIN>
$ docker-compose up -d

Follow instructions from Start updating Taskman

How to uninstall Redmine Premium plugins

$ docker exec -it eeadockertaskman_redmine_1 bash
$ bundle exec rake redmine:plugins:migrate NAME=redmine_plugin-name VERSION=0 RAILS_ENV=production
$ exit
$ cd /var/local/deploy/eea.docker.taskman/plugins
$ rm -rf <redmine_plugin-name>.zip
$ docker-compose stop
$ docker-compose up -d

How to uninstall Redmine plugins

  1. Uninstall plugin

    $ docker exec -it eeadockertaskman_redmine_1 bash $ bundle exec rake redmine:plugins:migrate NAME=redmine_plugin-name VERSION=0 RAILS_ENV=production $ cd plugins $ rm -rf $ exit $ docker-compose stop $ docker-compose up -d

  2. Make sure the plugin is removed from docker image

Specific plugins documentation

Edit this page