Skip to content
codefirstPublic

About

A lightweight script and log management tool for DevOps

Resources

Stars

2 stars

Watchers

3 watching

Forks

Repository files navigation

Sunline

Install

Install dependencies:

$ BUNDLE_WITHOUT=development:test bundle install
$ npm install

Precompile assets:

$ bin/rails assets:precompile RAILS_ENV=production

Setup database:

$ bin/rails db:migrate RAILS_ENV=production

S3 settings

if you use S3 as storage, set several environment variables.

$ export ACTIVE_STORAGE_SERVICE=amazon
$ export AWS_BUCKET=bucket name
$ export AWS_ACCESS_KEY_ID=access key
$ export AWS_SECRET_ACCESS_KEY=secret access key
$ export AWS_REGION=ap-northeast-1

Slack integration

if you want to notify logs to a Slack channel.

$ export SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx/yyy/zzz

Run:

$ export SECRET_KEY_BASE=$(bin/rails secret)
$ export DEVISE_SECRET_KEY=$(bin/rails secret)
$ export OMNIAUTH_GITHUB_CLIENT_ID=Client ID
$ export OMNIAUTH_GITHUB_CLIENT_SECRET=Client Secret
$ export OMNIAUTH_GITHUB_ORGANIZATION="org1 org2" # optional, space-separated for multiple orgs
$ export SUNLINE_HOSTS="sunline.example.com" # recommended, space-separated for multiple hosts
$ bin/rails s -e production

SUNLINE_HOSTS limits the accepted Host / X-Forwarded-Host values. Sunline embeds the request host in the scripts that runners execute, so set it to the host name your runners use. If it is unset, any host is accepted.

and access to http://localhost:3000/

For developers

Setup database:

$ bin/rails db:migrate RAILS_ENV=test

Run server:

$ bin/dev

Run tests:

$ bin/rails spec

Run docker:

$ docker build -t sunline .
$ docker run -p 3000:3000 -e DATABASE_URL="postgresql://user:pass@localhost:5432/sunline_production?host=host.docker.internal" -e RAILS_FORCE_SSL=false -e RAILS_SERVE_STATIC_FILES=true -e SECRET_KEY_BASE=xxx -e DEVISE_SECRET_KEY=xxx -e OMNIAUTH_GITHUB_CLIENT_ID=xxx -e OMNIAUTH_GITHUB_CLIENT_SECRET=xxx sunline

About

A lightweight script and log management tool for DevOps

Resources

Stars

2 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages