diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1b70b2b --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) + +.PHONY: all + +all: go-format go-vet setup-mongodb-env + +setup-mongodb-env: + ${ROOT_DIR}/scripts/mongodb/run-mongodb-dev.sh + ${ROOT_DIR}/scripts/mongodb/run-mongoexpress.sh + +cleanup-mongodb-env: + ${ROOT_DIR}/scripts/mongodb/cleanup.sh + +go-format: + go fmt ./... + +go-vet: + go vet ./... diff --git a/scripts/dev-setup-ubuntu.sh b/scripts/dev-setup-ubuntu.sh index d9451f7..1b3d3ee 100755 --- a/scripts/dev-setup-ubuntu.sh +++ b/scripts/dev-setup-ubuntu.sh @@ -4,13 +4,13 @@ set -ex GOLANG_PACKAGE=${GOLANG_PACKAGE:="go1.24.2.linux-amd64.tar.gz"} sudo apt update -y +# install other dependencies +sudo apt install -y make gcc +# install golang package wget https://dl.google.com/go/${GOLANG_PACKAGE} sudo tar -C /usr/local -xzf ${GOLANG_PACKAGE} rm -rf ${GOLANG_PACKAGE} echo "export GOPATH=\$HOME/go" >> ~/.bashrc echo "export PATH=\$PATH:/usr/local/go/bin:\$HOME/go/bin" >> ~/.bashrc -source ~/.bashrc - -# install other dependencies -sudo apt install -y make gcc \ No newline at end of file +source ~/.bashrc \ No newline at end of file diff --git a/scripts/mongodb/cleanup.sh b/scripts/mongodb/cleanup.sh new file mode 100755 index 0000000..7575b73 --- /dev/null +++ b/scripts/mongodb/cleanup.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +sudo docker stop mongo-express > /dev/null 2>&1 +sudo docker rm mongo-express > /dev/null 2>&1 + +sudo docker stop mongodb > /dev/null 2>&1 +sudo docker rm mongodb > /dev/null 2>&1 +echo "cleanup done" \ No newline at end of file