Commit 010a1351 authored by Denis Arh's avatar Denis Arh
Browse files

Rename files & symbols

parent d5c5c9ff
......@@ -15,7 +15,7 @@ steps:
# GOARCH: amd64
# commands:
# - go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/crust-$GOOS-$GOARCH cmd/crust/*.go
# - go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/crm-$GOOS-$GOARCH cmd/crm/*.go
# - go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/compose-$GOOS-$GOARCH cmd/compose/*.go
# - go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/messaging-$GOOS-$GOARCH cmd/messaging/*.go
# - go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/system-$GOOS-$GOARCH cmd/system/*.go
# - go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/system-cli-$GOOS-$GOARCH cmd/system-cli/*.go
......@@ -32,12 +32,12 @@ steps:
from_secret: docker_hub_password
- name: api-crm
- name: api-compose
image: plugins/docker
settings:
repo: crusttech/api-crm
repo: crusttech/api-compose
auto_tag: true # generate tag names automatically based on git branch and git tag
dockerfile: Dockerfile.api-crm
dockerfile: Dockerfile.api-compose
username:
from_secret: docker_hub_username
password:
......@@ -97,17 +97,17 @@ steps:
- make mocks
- make codegen
- go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/crust-$GOOS-$GOARCH cmd/crust/*.go
- go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/crm-$GOOS-$GOARCH cmd/crm/*.go
- go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/compose-$GOOS-$GOARCH cmd/compose/*.go
- go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/messaging-$GOOS-$GOARCH cmd/messaging/*.go
- go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/system-$GOOS-$GOARCH cmd/system/*.go
- go build -ldflags "-X github.com/crusttech/crust/internal/version.BuildTime=`date +%FT%T%z` -X github.com/crusttech/crust/internal/version.Version=`git describe --always --tags`" -o build/system-cli-$GOOS-$GOARCH cmd/system-cli/*.go
# check all tests are able to build
- wait-for-it.sh -t 60 --strict crust-db:3306 -- echo "Crust DB1 is up"
- gotest -v --tags="migrations" ./system/db/...
- gotest -v --tags="migrations" ./crm/db/...
- gotest -v --tags="migrations" ./compose/db/...
- gotest -v --tags="migrations" ./messaging/db/...
- go test -run=^$ --tags="unit integration external" ./cmd/... ./internal/... ./crm/... ./messaging/... ./system/...
- gotest -failfast --coverprofile=coverage.txt -v --tags="unit integration" ./internal/... ./system/... ./crm/... ./messaging/...
- go test -run=^$ --tags="unit integration external" ./cmd/... ./internal/... ./compose/... ./messaging/... ./system/...
- gotest -failfast --coverprofile=coverage.txt -v --tags="unit integration" ./internal/... ./system/... ./compose/... ./messaging/...
- name: coverage
image: plugins/codecov
settings:
......
......@@ -4,11 +4,11 @@ MESSAGING_HTTP_ERROR_TRACING=1
MESSAGING_DB_DSN=crust:crust@tcp(localhost:3306)/crust?collation=utf8mb4_general_ci
MESSAGING_DB_PROFILER=stdout
CRM_HTTP_ADDR=:3001
CRM_HTTP_PRETTY_JSON=1
CRM_HTTP_ERROR_TRACING=1
CRM_DB_DSN=crust:crust@tcp(localhost:3306)/crust?collation=utf8mb4_general_ci
CRM_DB_PROFILER=stdout
COMPOSE_HTTP_ADDR=:3001
COMPOSE_HTTP_PRETTY_JSON=1
COMPOSE_HTTP_ERROR_TRACING=1
COMPOSE_DB_DSN=crust:crust@tcp(localhost:3306)/crust?collation=utf8mb4_general_ci
COMPOSE_DB_PROFILER=stdout
SYSTEM_HTTP_ADDR=:3002
SYSTEM_HTTP_PRETTY_JSON=1
......
......@@ -66,8 +66,8 @@ schema:
- ../../.git
# ######################################################################################################################
- name: crm
path: cmd/crm
- name: cmp
path: cmd/compose
commands:
vet:
status: false
......@@ -80,7 +80,7 @@ schema:
watcher:
paths:
- .
- ../../crm
- ../../compose
- ../../internal
extensions:
- go
......
......@@ -8,7 +8,7 @@ COPY . .
RUN mkdir /build; \
go build \
-ldflags "-X github.com/crusttech/crust/internal/version.BuildTime="`date +%FT%T%z`" -X github.com/crusttech/crust/internal/version.Version="`git describe --always --tags` \
-o /build/crm cmd/crm/*.go
-o /build/compose cmd/compose/*.go
## == target image ==
......@@ -23,4 +23,4 @@ WORKDIR /crust
EXPOSE 80
ENTRYPOINT /crust/crm
ENTRYPOINT /crust/compose
.PHONY: help docker docker-push realize dep dep.update test test.messaging test.crm qa critic vet codegen integration
.PHONY: help docker docker-push realize dep dep.update test test.messaging test.compose qa critic vet codegen integration
PKG = "github.com/$(shell cat .project)"
GO = go
GOGET = $(GO) get -u
BASEPKGS = system crm messaging
IMAGES = system crm messaging
BASEPKGS = system compose messaging
IMAGES = system compose messaging
########################################################################################################################
# Tool bins
......@@ -25,7 +25,7 @@ help:
@echo
@echo - vet - run go vet on all code
@echo - critic - run go critic on all code
@echo - test.crm - individual package unit tests
@echo - test.compose - individual package unit tests
@echo - test.messaging - individual package unit tests
@echo - test - run all available unit tests
@echo - qa - run vet, critic and test on code
......@@ -86,13 +86,13 @@ test.events: $(GOTEST)
perl -pi -e 's/command-line-arguments/.\/messaging\/repository/g' .cover.out
$(GO) tool cover -func=.cover.out | grep --color "^\|[^0-9]0.0%"
test.crm: $(GOTEST)
$(GOTEST) -covermode count -coverprofile .cover.out -v ./crm/service/...
test.compose: $(GOTEST)
$(GOTEST) -covermode count -coverprofile .cover.out -v ./compose/service/...
$(GO) tool cover -func=.cover.out | grep --color "^\|[^0-9]0.0%"
test.crm.db: $(GOTEST)
cd crm/db && $(GO) generate && cd ../..
$(GOTEST) -covermode count -coverprofile .cover.out -v ./crm/db/...
test.compose.db: $(GOTEST)
cd compose/db && $(GO) generate && cd ../..
$(GOTEST) -covermode count -coverprofile .cover.out -v ./compose/db/...
$(GO) tool cover -func=.cover.out | grep --color "^\|[^0-9]0.0%"
test.system: $(GOTEST)
......
......@@ -9,7 +9,7 @@ Crust brings your user ecosystem and essential applications together on one plat
**Crust CRM** is the highly flexible, scalable and open source Salesforce alternative, that enables you to sell faster and interact with leads, clients and team members easier then ever before. Seamless integration with Crust Messaging and Crust Identity and Access Management make it the most complete and flexible self-hosted CRM platform on the market.
**Crust Unify** manages user experience for Crust applications, such as CRM and Messaging, as well as providing an integrated interface for third party or other bespoke applications. 100% responsive and with an intuitive design, Crust Unify increases productivity and ease of access to all IT resources.
**Crust Unify** manages user experience for Crust applications, such as Compose and Messaging, as well as providing an integrated interface for third party or other bespoke applications. 100% responsive and with an intuitive design, Crust Unify increases productivity and ease of access to all IT resources.
## Contributing
......@@ -18,9 +18,7 @@ Crust brings your user ecosystem and essential applications together on one plat
Copy `.env.example` to `.env` and make proper modifications for your local environment.
An access to a (local) instance of MySQL must be available.
Configure access to your database with `SAM_DB_DSN` and `CRM_DB_DSN`.
Please check the options available with `./app -h`.
Configure access to your database with `SYSTEM_DB_DSN`, `MESSAGING_DB_DSN` and `COMPOSE_DB_DSN`.
The database will be populated with migrations at the start of each service. You don't need to pre-populate the database, just make sure that your permissions include CREATE and ALTER capabilities.
......
......@@ -26,7 +26,7 @@
},
{
"title": "Pages",
"description": "CRM module pages",
"description": "Compose module pages",
"entrypoint": "page",
"path": "/page",
"authentication": [],
......@@ -245,7 +245,7 @@
},
{
"title": "Modules",
"description": "CRM module definitions",
"description": "Compose module definitions",
"entrypoint": "module",
"path": "/module",
"authentication": [],
......@@ -253,7 +253,7 @@
{
"imports": [
"sqlxTypes github.com/jmoiron/sqlx/types",
"github.com/crusttech/crust/crm/types"
"github.com/crusttech/crust/compose/types"
]
}
],
......@@ -374,14 +374,14 @@
},
{
"title": "Records",
"description": "CRM records ",
"description": "Compose records ",
"entrypoint": "record",
"path": "/module/{moduleID}/record",
"authentication": [],
"struct": [
{
"imports": [
"github.com/crusttech/crust/crm/types"
"github.com/crusttech/crust/compose/types"
]
}
],
......@@ -669,7 +669,7 @@
},
{
"title": "Triggers",
"description": "CRM Triggers",
"description": "Compose Triggers",
"entrypoint": "trigger",
"path": "/trigger",
"authentication": [],
......@@ -814,7 +814,7 @@
},
{
"title": "Notifications",
"description": "CRM Notifications",
"description": "Compose Notifications",
"entrypoint": "notification",
"path": "/notification",
"authentication": [],
......@@ -829,7 +829,7 @@
{
"name": "email/send",
"method": "POST",
"title": "Send email from the CRM",
"title": "Send email from the Compose",
"path": "/email",
"parameters": {
"post": [
......
File moved
{
"Title": "Modules",
"Description": "CRM module definitions",
"Description": "Compose module definitions",
"Interface": "Module",
"Struct": [
{
"imports": [
"sqlxTypes github.com/jmoiron/sqlx/types",
"github.com/crusttech/crust/crm/types"
"github.com/crusttech/crust/compose/types"
]
}
],
......
{
"Title": "Notifications",
"Description": "CRM Notifications",
"Description": "Compose Notifications",
"Interface": "Notification",
"Struct": [
{
......@@ -17,7 +17,7 @@
{
"Name": "email/send",
"Method": "POST",
"Title": "Send email from the CRM",
"Title": "Send email from the Compose",
"Path": "/email",
"Parameters": {
"post": [
......
{
"Title": "Pages",
"Description": "CRM module pages",
"Description": "Compose module pages",
"Interface": "Page",
"Struct": [
{
......
{
"Title": "Records",
"Description": "CRM records ",
"Description": "Compose records",
"Interface": "Record",
"Struct": [
{
"imports": [
"github.com/crusttech/crust/crm/types"
"github.com/crusttech/crust/compose/types"
]
}
],
......
{
"Title": "Triggers",
"Description": "CRM Triggers",
"Description": "Compose Triggers",
"Interface": "Trigger",
"Struct": null,
"Parameters": null,
......
......@@ -12,7 +12,7 @@ import (
"github.com/crusttech/crust/internal/subscription"
"github.com/crusttech/crust/internal/version"
crm "github.com/crusttech/crust/crm"
compose "github.com/crusttech/crust/compose"
system "github.com/crusttech/crust/system"
)
......@@ -24,7 +24,7 @@ func main() {
ctx := context.AsContext(sigctx.New())
crm.Flags("crm")
compose.Flags("compose")
system.Flags("system")
subscription.Flags()
......@@ -34,7 +34,7 @@ func main() {
if err := system.Init(ctx); err != nil {
log.Fatalf("Error initializing: %+v", err)
}
if err := crm.Init(ctx); err != nil {
if err := compose.Init(ctx); err != nil {
log.Fatalf("Error initializing: %+v", err)
}
......@@ -51,7 +51,7 @@ func main() {
// Disabled for now, system service is the only one that validates subscription
// ctx = subscription.Monitor(ctx)
if err := crm.StartRestAPI(ctx); err != nil {
if err := compose.StartRestAPI(ctx); err != nil {
log.Fatalf("Error starting/running: %+v", err)
}
}
......
......@@ -13,7 +13,7 @@ import (
_ "github.com/joho/godotenv/autoload"
"github.com/namsral/flag"
crm "github.com/crusttech/crust/crm"
compose "github.com/crusttech/crust/compose"
"github.com/crusttech/crust/internal/auth"
messaging "github.com/crusttech/crust/messaging"
system "github.com/crusttech/crust/system"
......@@ -55,7 +55,7 @@ func main() {
flags.http = new(config.HTTP).Init()
flags.monitor = new(config.Monitor).Init()
crm.Flags("crm")
compose.Flags("compose")
messaging.Flags("messaging")
system.Flags("system")
......@@ -78,8 +78,8 @@ func main() {
if err := system.Init(ctx); err != nil {
log.Fatalf("Error initializing system: %+v", err)
}
if err := crm.Init(ctx); err != nil {
log.Fatalf("Error initializing crm: %+v", err)
if err := compose.Init(ctx); err != nil {
log.Fatalf("Error initializing compose: %+v", err)
}
if err := messaging.Init(ctx); err != nil {
log.Fatalf("Error initializing messaging: %+v", err)
......@@ -103,16 +103,16 @@ func main() {
// logging, cors and such
middleware.Mount(ctx, r, flags.http)
// Use JWT secret for hmac signer for now
auth.DefaultSigner = auth.HmacSigner(authJwtFlags.Secret)
auth.DefaultJwtHandler, err = auth.JWT(authJwtFlags.Secret, authJwtFlags.Expiry)
// Use JWT secret for hmac signer for now
auth.DefaultSigner = auth.HmacSigner(authJwtFlags.Secret)
auth.DefaultJwtHandler, err = auth.JWT(authJwtFlags.Secret, authJwtFlags.Expiry)
if err != nil {
log.Fatalf("Error creating JWT Auth: %v", err)
}
r.Route("/api", func(r chi.Router) {
r.Route("/crm", func(r chi.Router) {
crm.MountRoutes(ctx, r)
r.Route("/compose", func(r chi.Router) {
compose.MountRoutes(ctx, r)
})
r.Route("/messaging", func(r chi.Router) {
messaging.MountRoutes(ctx, r)
......@@ -125,8 +125,8 @@ func main() {
fileserver := http.FileServer(http.Dir("webapp"))
for _, service := range []string{"admin", "system", "messaging", "crm"} {
r.HandleFunc("/"+service+"*", serveIndex("webapp", "crm/index.html", fileserver))
for _, service := range []string{"admin", "system", "messaging", "compose"} {
r.HandleFunc("/"+service+"*", serveIndex("webapp", "compose/index.html", fileserver))
}
r.HandleFunc("/*", serveIndex("webapp", "index.html", fileserver))
......
......@@ -22,15 +22,15 @@ function types {
CGO_ENABLED=0 go build -o ./build/gen-type-set codegen/v2/type-set.go
fi
./build/gen-type-set --types Attachment --output crm/types/attachment.gen.go
./build/gen-type-set --types Module --output crm/types/module.gen.go
./build/gen-type-set --types Page --output crm/types/page.gen.go
./build/gen-type-set --types Chart --output crm/types/chart.gen.go
./build/gen-type-set --types Trigger --output crm/types/trigger.gen.go
./build/gen-type-set --types Record --output crm/types/record.gen.go
./build/gen-type-set --with-primary-key=false --types ModuleField --output crm/types/module_field.gen.go
./build/gen-type-set --with-primary-key=false --types RecordValue --output crm/types/record_value.gen.go
./build/gen-type-set --types Attachment --output compose/types/attachment.gen.go
./build/gen-type-set --types Module --output compose/types/module.gen.go
./build/gen-type-set --types Page --output compose/types/page.gen.go
./build/gen-type-set --types Chart --output compose/types/chart.gen.go
./build/gen-type-set --types Trigger --output compose/types/trigger.gen.go
./build/gen-type-set --types Record --output compose/types/record.gen.go
./build/gen-type-set --with-primary-key=false --types ModuleField --output compose/types/module_field.gen.go
./build/gen-type-set --with-primary-key=false --types RecordValue --output compose/types/record_value.gen.go
./build/gen-type-set --types MessageAttachment --output messaging/types/attachment.gen.go
./build/gen-type-set --types Mention --output messaging/types/mention.gen.go
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment