Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ task/target/
task/src/main/resources/
build/target/
standalone-build/
standalone-docker-build/

*.ser
*.class
Expand Down Expand Up @@ -72,4 +73,4 @@ sharedocsEnv.bat

terraform.tfvars
*.tfstate
*.tfstate.backup
*.tfstate.backup
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
language: scala
sudo: false
sudo: required
services:
- docker
scala:
- 2.12.1
- 2.12.1
jdk:
- oraclejdk8
- oraclejdk8
cache:
directories:
- $HOME/.ivy2/cache
Expand All @@ -13,3 +15,7 @@ script:
- ./sharedocs test
- find $HOME/.sbt -name "*.lock" | xargs rm -f
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm -f
after_success:
- echo $TRAVIS_PULL_REQUEST
- echo $TRAVIS_BRANCH
- ./deployment/docker/deploy.sh
38 changes: 25 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,44 @@ or

## Setup for Development Environment

### Setup PostgreSQL
### Setup in one go

#### mac/*unix

$ ./sharedocs setup

#### Windows

*Currently not supported*

### Setup in steps

#### Setup PostgreSQL

Setup PostgreSQL server on your machine and create database.

$ createuser -P sharedocs
$ createdb -E UTF8 -T template0 --lc-collate=ja_JP.UTF-8 --lc-ctype=ja_JP.UTF-8 sharedocs

### Prepare Tables
#### Prepare Tables

#### mac/*nix
##### mac/*nix

./sharedocs db:migrate

#### Windows
##### Windows

./sharedocs.bat db:migrate
sharedocs.bat db:migrate

### Set Environment Variables to sharedocsEnv script
#### Set Environment Variables to sharedocsEnv script

#### mac/*nix
##### mac/*nix

cp sharedocsEnv-template sharedocsEnv

#### Windows
##### Windows

cp sharedocsEnv-template.bat sharedocsEnv.bat
copy sharedocsEnv-template.bat sharedocsEnv.bat

##### Environment Variables

Expand Down Expand Up @@ -80,15 +92,15 @@ Setup PostgreSQL server on your machine and create database.
| AWS_S3_BASE_DIR | (if UPLOAD_DESTINATION==s3)<br />base pash to upload image file | "images/" |
| AWS_S3_BASE_URL | (if UPLOAD_DESTINATION==s3)<br />base url to access uploaded image file | "https://xxxxxxxx.s3.amazonaws.com/" |

### Run Application
#### Run Application

#### mac/*nix
##### mac/*nix

./sharedocs run

#### Windows
##### Windows

./sharedocs.bat run
sharedocs.bat run


## Additional setup for Development Environment
Expand Down
9 changes: 9 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,12 @@ lazy val standaloneBuild = (project in file("standalone-build")).settings(packag
ideaIgnoreModule := true,
ivyXML := <dependencies><exclude org="org.eclipse.jetty.orbit" /></dependencies>
)
lazy val standaloneDockerBuild = (project in file("standalone-docker-build"))
.enablePlugins(DockerPlugin)
.settings(packagingBaseSettings)
.settings(
name := appName + "-standalone",
libraryDependencies += "org.skinny-framework" %% "skinny-standalone" % skinnyVersion,
ideaIgnoreModule := true,
ivyXML := <dependencies><exclude org="org.eclipse.jetty.orbit" /></dependencies>
)
7 changes: 7 additions & 0 deletions deployment/docker/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
./sharedocs package:docker &&
./sharedocs publish:docker
fi
37 changes: 37 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3'
services:
db:
build:
context: .
dockerfile: Dockerfile-db
volumes:
- sharedocs-db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: sharedocs
POSTGRES_PASSWORD: sharedocs
POSTGRES_DB: sharedocs
POSTGRES_INITDB_ARGS: "-E UTF8 -T template0 --lc-collate=ja_JP.UTF-8 --lc-ctype=ja_JP.UTF-8"
app:
build:
context: .
dockerfile: Dockerfile-app
ports:
- 8080:8080
links:
- db
volumes:
- sharedocs-app-upload:/var/sharedocs/upload
environment:
DATABASE_HOST: db:5432
DATABASE_DBNAME: sharedocs
DATABASE_USER: sharedocs
DATABASE_PASSWORD: sharedocs
SITE_NAME: Sharedocs:local
SITE_TITLE: Sharedocs
LOGIN_PROVIDOR: app
UPLOAD_DESTINATION: local
LOCAL_UPLOAD_BASE_DIR: /var/sharedocs/upload
LOCAL_UPLOAD_BASE_URL: /static/uploads
volumes:
sharedocs-db-data:
sharedocs-app-upload:
4 changes: 4 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.0")

// check the latest version of dependencies
// addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.10")

// --------
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.0")
addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.4.0")
Loading