inm5151-glitchfix

module
v0.0.0-...-245198b Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: LGPL-2.1

README

Projet synthèse

Building the project

See web/README.md for instructions on building and running the Angular front-end app.

A Makefile is provided with the following targets:

  • dep: Download and setup project dependencies to the vendor directory.
  • build: Compile the project. Emitted executables are located in the bin directory by default.
  • run: run the main server executable.
  • test: run test suite using go test
  • clean: Remove all files generated during the build.
  • clean-deps: Remove all files generated by dep.
Requirements
  • make
  • go

Deployment

For ease of deployment, a docker-compose file can be found in the deploy subdirectory along with all files to build docker images for the webservers and database.

Before deploying, you must fill in all sample.env files with the proper values and save them as .env.

You can launch the app without further configuration via the docker-compose up command from the deploy directory.

Upon first launch, the database will be initialized by execution the scripts in configs/sql. The database files will be saved to deploy/database/data/ and will be kept between restarts unless explicitly deleted.

If not using docker-compose, you must define the following environment variables for the application to work:

  • $MYSQL_USERNAME: The username to use for your app (Please don't use the root user)
  • $MYSQL_PASSWORD: The password for user $MYSQL_USERNAME
  • $MYSQL_HOST: Hostname or IP address of your MariaDB server
  • $MYSQL_DATABASE: Database name for the app
Requirements
  • docker
  • docker-compose
Troubleshooting

docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))

  • Make sure the docker daemon is running. You can start it by running systemctl start docker as a privileged user.

Database schema is incorrect

  • You can delete the deploy/database/data directory and the database will be rebuilt from the scripts in configs/sql. You will lose a data stored in the database.
  • running make distclean will delete that subdirectory

Application container is not up to date with the repo's contents

  • This can be caused by changes to the Dockerfile or initialization scripts, or by old artifacts being cached by docker.
  • First, you can try rebuilding the containers with docker-compose up --build.
  • If this doesn't work, you should delete the saved containers before running the docker-compose command again.
    • Run docker container ls -a and look for entries that have the one of the following values in the Image column and note the Container ID.
      • inm5151_glitchfix_goserver for the Go app
      • inm5151_glitchfix_webserver for the Webserver and Angular app
      • inm5151_glitchfix_database for the Mariadb database server
    • Remove the containers with docker container rm <Container ID...>

WARNING: Found orphan containers

  • Launching the containers with docker-compose up --remove-orphans will delete orphan containers and remove this warning.

Rebuild only the front-end container

  • sudo docker-compose up —force-recreate —no-deps webproxy

Contributors

Felix
  • Front-end
  • DB
Barberousse
  • Back-end
  • DB
  • Infrastructure/Ops
Alexis
  • Front-end
  • Back-end (rest api)

References

Directories

Path Synopsis
cmd
pkg
db

Jump to

Keyboard shortcuts

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