Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Test CI setting

Akiko Takano edited this page Apr 5, 2020 · 2 revisions

CI setting

Redmine Issue Templates plugin uses CircleCI for its automated testing. (As of June 24, 2019) You can see some related files under .circleci/ directory and script/ directory.

To run the test locally with using the same Docker image on CircleCI, you can use these files.

Dockerfile

FROM circleci/ruby:2.6-browsers-legacy
LABEL maintainer="AKIKO TAKANO / (Twitter: @akiko_pusu)" \
  description="Image to run Redmine simply with sqlite to try/review plugin."

RUN sudo apt-get update
RUN sudo apt-get install -qq -y \
    git vim        \
    sqlite3 default-libmysqlclient-dev
RUN sudo apt-get install -qq -y build-essential libc6-dev

RUN cd /tmp && svn co http://svn.redmine.org/redmine/trunk redmine
WORKDIR /tmp/redmine


# add database.yml (for development, development with mysql, test)
RUN echo 'test:\n\
  adapter: sqlite3\n\
  database: /tmp/data/redmine_test.sqlite3\n\
  encoding: utf8mb4\n\
development:\n\
  adapter: sqlite3\n\
  database: /tmp/data/redmine_development.sqlite3\n\
  encoding: utf8mb4\n\
development_mysql:\n\
  adapter: mysql2\n\
  host: mysql\n\
  password: pasword\n\
  database: redemine_development\n\
  username: root\n'\
>> config/database.yml

RUN gem update bundler
RUN bundle install --without postgresql rmagick
RUN bundle exec rake db:migrate

docker-compose

version: '3.2'
services:
  # start service for redmine with plugin
  # 1. $ docker-compose build --force-rm --no-cache
  # 2. $ docker-compose up -d web
  #
  #
  web:
    build:
      context: .
      dockerfile: Dockerfile_circleci
    image: circleci_redmine_sqlite3
    container_name: circleci_redmine_sqlite3
    command: >
      bash -c "bundle &&
           bundle exec rake db:migrate &&
           bundle exec rake redmine:plugins:migrate &&
           bundle exec rake generate_secret_token &&
           bundle exec rails s -p 3000 -b '0.0.0.0'"
    environment:
      RAILS_ENV: development
    volumes:
      - .:/tmp/redmine/plugins/redmine_issue_templates
    ports:
      - "3000:3000"
  mysql:
    image: mysql
    environment:
      MYSQL_ROOT_PASSWORD: pasword
    ports:
      - "3306:3306"
Clone this wiki locally