init.sh Script Documentation

The init.sh script automates the setup process for initializing a development environment. It installs necessary dependencies, sets up Docker containers for PostgreSQL, Odoo, and Nginx, configures network settings, and initializes databases. This documentation provides a detailed explanation of each section and function within the script.

  • The preamble section includes essential settings and variable definitions.
  1. set -euopipefail: This line is commented out but typically enables strict error handling in bash scripts.
  2. IFS=$'\n\t': Sets the Internal Field Separator (IFS) to newline and tab characters to improve parsing of file names.
  • Determining Script Directory: This section resolves the directory where the script resides.
  • Default Directories:
    1. FILESTORE: Path to the file storage directory.
    2. EXTRAADDONS: Path to the directory for extra-addons.
HOME
├── extra-addons
├── filestore
├── postgres
├── rembin
└── wproxy
  • Python3, Pip3, Tmux, CCZE, Perl Template Toolkit, Pass, Curl, Wget, File, Gotty, and JQ:
    • These sections check for the availability of various utilities and install them if missing.
  • Docker and Docker-Compose:
    • Checks for Docker and Docker-Compose and installs them if not present.
  • Disable Sudo Password Prompt:
    • Adds a sudoers entry to allow the script to execute commands as root without password prompt.
  • Docker Group Membership:
    • Checks if the current user is a member of the Docker group and adds them if necessary.
  • Network Creation:
    • Creates a Docker network named app_net with a specific subnet.
  • Docker Image Download:
    • Downloads necessary Docker images for Odoo, PostgreSQL, and Nginx.
  • PostgreSQL Setup:
    • Creates a Docker Compose file for PostgreSQL and starts the container.
  • Odoo Database Initialization:
    • Initializes databases for different Odoo versions using Docker containers.
  • Web Proxy Setup:
    • Creates a Docker Compose file for Nginx web proxy and starts the container.
  • Grabs the SSH public key for a GitLab server and adds it to the known hosts file.

Nadir Habib 2024/03/29 21:56

  • elosys/init.txt
  • Last modified: 2024/03/29 22:00
  • by nadir