plantd

module
v0.0.0-...-87de96b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2020 License: MIT

README

Pipeline Status Coverage Status Coverage Status Go Report Card FOSSA Status


Plantd

Services and utilities for constructing and working with distributed control systems.

This repository is currently in early stages, but it is meant to consolidate what's available in a few others that are spread out. Notes and plans while this takes place can be seen in the roadmap.

Services

Specific instructions for individual services have been carried over from previous projects and are subject to change as the instructions here improve.

Develop

Dependencies

[TODO] need to add various go packages that are used, eg. go lint.

go get -u github.com/fzipp/gocyclo
go get -u golang.org/x/tools/cmd/cover
go get -u github.com/mattn/goveralls
go get -u github.com/pressly/sup/cmd/sup

The pre-commit package needs to be installed in order to push commits.

python3 -m pip install --user pre-commit
pre-commit install
Building
Development

The development containers are setup with hot-reloading, if everything is right you should be able to skip ahead to [Start Services][#start-services], but if not the containers that the stack file wants can be built with the following commands.

./tools/build build dev

Once these are built the docker-compose command in [Start Services][#start-services] can be used to run everything during development.

Deployment

To build the containers for normal execution using static binaries execute the following command.

./tools/build build v2

Publishing them is done similarly, but requires access to the GitLab registry.

./tools/build push v2
Start Services

The best way to start the services that plantd depends on is by using the docker-compose stack configuration.

docker-compose -f build/stack-dev.yml up -d
Setup

A database named plantd needs to exist in the database, this should be run once.

psql -h localhost -U postgres -c "create database plantd;"

Apply the migrations by installing the migrate utility and running it once, changing user name and passwords as required.

./tools/setup
migrate -source file://data/1.0/ \
  -database postgres://postgres:postgres@localhost:5432/plantd?sslmode=disable up

If something fails and you don't care about the data in the database the drop command can be run to remove all tables.

License

Unless otherwise specified the license used for plantd projects is MIT. For more information see here.

Directories

Path Synopsis
cmd
internal
orm
Package orm provides `GORM` helpers for the creation, migration and access on the project's database
Package orm provides `GORM` helpers for the creation, migration and access on the project's database
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL