The following instructions are useful during development.
Note: This has been tested on Linux and Darwin/macOS. It has not been tested on Windows.
🤔 The following tasks need to be complete before proceeding. These are "one-time tasks" which may already have been completed.
-
Identify git repository.
export GIT_ACCOUNT=senzing-garage export GIT_REPOSITORY=observe export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}"
-
Using the environment variables values just set, follow steps in clone-repository to install the Git repository.
-
A one-time command to install dependencies needed for
make
targets. Example:cd ${GIT_REPOSITORY_DIR} make dependencies-for-development
-
Install dependencies needed for Go code. Example:
cd ${GIT_REPOSITORY_DIR} make dependencies
-
Run linting. Example:
cd ${GIT_REPOSITORY_DIR} make lint
-
Build the binaries. Example:
cd ${GIT_REPOSITORY_DIR} make clean build
-
The binaries will be found in the
${GIT_REPOSITORY_DIR}/target
directory. Example:tree ${GIT_REPOSITORY_DIR}/target
-
Run program. Examples:
-
Linux
${GIT_REPOSITORY_DIR}/target/linux-amd64/observe
-
macOS
${GIT_REPOSITORY_DIR}/target/darwin-amd64/observe
-
Windows
${GIT_REPOSITORY_DIR}/target/windows-amd64/observe
-
-
Clean up. Example:
cd ${GIT_REPOSITORY_DIR} make clean
-
Run tests. Example:
cd ${GIT_REPOSITORY_DIR} make clean setup test
Create a code coverage map.
-
Run Go tests. Example:
cd ${GIT_REPOSITORY_DIR} make clean setup coverage
A web-browser will show the results of the coverage. The goal is to have over 80% coverage. Anything less needs to be reflected in testcoverage.yaml.
-
View documentation. Example:
cd ${GIT_REPOSITORY_DIR} make clean documentation
-
If a web page doesn't appear, visit localhost:6060.
-
Senzing documentation will be in the "Third party" section.
github.com
>senzing-garage
>observe
-
When a versioned release is published with a
v0.0.0
format tag, the reference can be found by clicking on the following badge at the top of the README.md page. Example: -
To stop the
godoc
server, runcd ${GIT_REPOSITORY_DIR} make clean
-
Use make target to run a docker images that builds RPM and DEB files. Example:
cd ${GIT_REPOSITORY_DIR} make docker-build
-
Run docker container. Example:
docker run --rm senzing/observe
-
Optional: Test using
docker-compose
. Example:cd ${GIT_REPOSITORY_DIR} make clean docker-test
To bring the
docker-compose
formation, runcd ${GIT_REPOSITORY_DIR} make clean
-
Use make target to run a docker images that builds RPM and DEB files. Example:
cd ${GIT_REPOSITORY_DIR} make package
-
The results will be in the
${GIT_REPOSITORY_DIR}/target
directory. Example:tree ${GIT_REPOSITORY_DIR}/target
-
Determine if
observe
is installed. Example:apt list --installed | grep observe
-
✏️ Install
observe
. Example:cd ${GIT_REPOSITORY_DIR}/target sudo apt install ./observe-0.0.0.deb
-
Run command. Example:
observe
-
Remove
observe
from system. Example:sudo apt-get remove observe