Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 2.4 KB

run-local-dev.md

File metadata and controls

81 lines (54 loc) · 2.4 KB

Running a Local Development Environment

Setup

  1. Install Docker Desktop and enable Kubernetes

  2. Install Helm

  3. Install NGINX Ingress Controller

  4. Install Skaffold

  5. Download large docker files

    docker pull elasticsearch:7.17.5
    docker pull kibana:7.17.5
  6. Create secrets for each service

  7. Add the following to your host file sudo vim /etc/hosts

    127.0.0.1   index.murmurations.developers
    127.0.0.1   library.murmurations.developers
    127.0.0.1   data-proxy.murmurations.developers

After Completing the Setup

  1. Run make dev to start services

  2. Try GETting the following API endpoints to check the services are running:

Setting Up Pre-commit and Custom Git Hooks for Development (Optional)

Note: Pre-commit is a linter to ensure consistent style, etc. Please use it before submitting pull requests to this repository. There is no need to install if you are not planning to submit pull requests.

  1. Install pre-commit on a Mac by running brew install pre-commit.

  2. Add pre-commit file and change permission.

    touch .git/hooks/pre-commit
    chmod +x .git/hooks/pre-commit
  3. Use vim .git/hooks/pre-commit to edit the pre-commit file.

    #!/bin/sh
    
    PASS=true
    
    # Run Newman
    make newman-test
    if [[ $? != 0 ]]; then
        printf "\t\033[31mNewman\033[0m \033[0;30m\033[41mFAILURE!\033[0m\n"
        PASS=false
    else
        printf "\t\033[32mNewman\033[0m \033[0;30m\033[42mpass\033[0m\n"
    fi
    
    if ! $PASS; then
        printf "\033[0;30m\033[41mCOMMIT FAILED\033[0m\n"
        exit 1
    else
        printf "\033[0;30m\033[42mCOMMIT SUCCEEDED\033[0m\n"
    fi
    
    exit 0
  4. Run pre-commit install to set up the git hook scripts in your local repository. You can safely ignore the "Running in migration mode with existing hooks" message.

Now, pre-commit will run automatically on git commit. If you want to manually run all pre-commit hooks on a repository, run pre-commit run --all-files.