class SmartCloud::Grids::Redmine

Public Class Methods

down() click to toggle source
# File lib/smart_cloud/grids/redmine.rb, line 42
def self.down
        if SmartCloud::Docker.running?
                # Stopping & Removing containers - in reverse order
                print "-----> Stopping container redmine ... "
                if system("docker stop 'redmine'", out: File::NULL)
                        puts "done"
                        print "-----> Removing container redmine ... "
                        if system("docker rm 'redmine'", out: File::NULL)
                                puts "done"
                        end
                end
        end
end
new() click to toggle source
# File lib/smart_cloud/grids/redmine.rb, line 5
def initialize
end
up() click to toggle source
# File lib/smart_cloud/grids/redmine.rb, line 8
def self.up
        if SmartCloud::Docker.running?
                # Creating & Starting containers
                print "-----> Creating container redmine ... "
                if system("docker create \
                        --name='redmine' \
                        --env VIRTUAL_HOST=redmine.#{SmartCloud.config.apps_domain} \
                        --env LETSENCRYPT_HOST=redmine.#{SmartCloud.config.apps_domain} \
                        --env LETSENCRYPT_EMAIL=#{SmartCloud.config.sysadmin_email} \
                        --env LETSENCRYPT_TEST=false \
                        --env REDMINE_SECRET_KEY_BASE=#{SmartCloud.credentials.redmine[:secret_key_base]} \
                        --env REDMINE_DB_MYSQL=#{SmartCloud.credentials.redmine[:database_host]} \
                        --env REDMINE_DB_PORT=#{SmartCloud.credentials.redmine[:database_port]} \
                        --env REDMINE_DB_USERNAME=#{SmartCloud.credentials.redmine[:database_username]} \
                        --env REDMINE_DB_PASSWORD=#{SmartCloud.credentials.redmine[:database_password]} \
                        --env REDMINE_DB_DATABASE=#{SmartCloud.credentials.redmine[:database_name]} \
                        --env REDMINE_PLUGINS_MIGRATE=#{SmartCloud.credentials.redmine[:plugins_migrate]} \
                        --volume='#{SmartCloud.config.user_home_path}/.smartcloud/apps/repositories:/repositories:ro' \
                        --volume='#{SmartCloud.config.user_home_path}/.smartcloud/grids/redmine/files:/usr/src/redmine/files' \
                        --restart='always' \
                        --network='nginx-network' \
                        redmine:4.0.5-alpine", out: File::NULL)

                        system("docker network connect mysql-network redmine")

                        puts "done"
                        print "-----> Starting container redmine ... "
                        if system("docker start redmine", out: File::NULL)
                                puts "done"
                        end
                end
        end
end