Skip to content

wheatandcat/dotstamp_server

Repository files navigation

dotstamp_server

Build Status DB Document API Document API Testing MIT License

概要

.stampのサーバーサイド 
webサービス:.stamp

projectリポジトリ一覧

必要なもの

  • golang
  • MariaDB
  • Redis

環境構築

実行手順

リポジトリをclone

cd $GOPATH/src/
git clone git@github.com:wheatandcat/dotstamp_server.git
cd dotstamp_server

ライブラリ導入

glide install

DBマイグレーション

goose up
goose -env test up

実行 & 監視

bee run

バイナリ実行

./dotstamp_server

アクセス(vagrantから実行した場合)

http://192.168.33.10:8080/

その他コマンド

全体テスト

go test -p 1 $(glide novendor)

指定部分のみテスト

go test -p 1 ./models/ -cover TestModel

テスト & 監視

goconvey -packages 1

全体カバレッジ出力 & 出力

sh scripts/coverage.sh
go tool cover -func=coverage/all.coverage.out

db確認

dbweb -home=$GOPATH/src/github.com/go-xorm/dbweb/

db定義書生成

mysqldump --no-data --xml -uroot stamp_test > db/stamp_test.xml
xsltproc -o db/stamp_test.html db/style.xsl db/stamp_test.xml

APIドキュメント生成

aglio -i apiary.apib -o apiary.html

dredd

sh scripts/dredd.sh && ENV_CONF=test dredd

バッチ

ファイルパス:tasks/

ファイル名 内容 備考
contributionSearch       投稿の検索テーブルを一括更新する 新しい検索処理を追加時の再設定用
contributionTotalFollows       フォロー数の総数を設定する crontabで15分毎に実行
makeMovie       動画ファイルを作成する
removeContribution       不要ファイルを削除する 1日1回実行

License

MIT