2016-12-08 13:42:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-12-11 09:05:29 +00:00
|
|
|
install_dependencies() {
|
|
|
|
go get "github.com/gorilla/sessions"
|
|
|
|
go get "golang.org/x/crypto/bcrypt"
|
|
|
|
go get "github.com/mssola/user_agent"
|
|
|
|
go get "github.com/gorilla/mux"
|
|
|
|
go get "github.com/Pallinder/go-randomdata"
|
|
|
|
go get "github.com/gorilla/handlers"
|
|
|
|
go get "github.com/go-sql-driver/mysql"
|
2016-12-11 10:53:03 +00:00
|
|
|
go get -u "github.com/mattes/migrate"
|
2016-12-11 09:05:29 +00:00
|
|
|
}
|
|
|
|
|
2016-12-08 13:42:03 +00:00
|
|
|
bin() {
|
2016-12-11 09:05:29 +00:00
|
|
|
go build
|
2016-12-08 13:42:03 +00:00
|
|
|
}
|
|
|
|
|
2016-12-11 09:05:29 +00:00
|
|
|
database_migrate() {
|
2016-12-08 21:20:40 +00:00
|
|
|
export $(cat .env | xargs)
|
|
|
|
$GOPATH/bin/migrate -url mysql://$ANA_DATABASE_USER:$ANA_DATABASE_PASSWORD@$ANA_DATABSE_HOST/$ANA_DATABASE_NAME -path ./db/migrations $1 $2 $3
|
2016-12-08 13:42:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# call first argument
|
|
|
|
$1 $2 $3 $4
|