Sha256: af4485e64e16a6ba490e1802d409574728a4313f8f0db3b80ae0021377728344

Contents?: true

Size: 1.21 KB

Versions: 38

Compression:

Stored size: 1.21 KB

Contents

#!/usr/bin/env bash

set -e

# Initialize flags
local_dev=true
api_only=false
debug=false

function opr_cmd() {
    if $local_dev; then
        bin/opr $1
    else
        $1
    fi
}

function cleanup() {
    echo "Cleaning up attached services..."
    docker compose down
    echo "...Done"
}

# Check for and parse flags
for arg in "$@"
do
    case $arg in
        --api-only)
            api_only=true
        ;;
        --docker)
            local_dev=false
        ;;
        --debug)
            export DEBUG=true
            debug=true
        ;;
        *)
            # Unknown arguments can be ignored or handled here
        ;;
    esac
done

# In non-local dev scenarios, change ownership of the application to the non-root 'plug-app' user
if [[ $local_dev == false ]]; then
    chown -R plug-app:plug-app /usr/src/app
else
    # In local dev scenarios, run attached compose services in detached mode
    docker compose up --wait
fi

if $local_dev; then

    # Ensure docker-compose goes down when the server is stopped
    trap cleanup SIGINT
    trap cleanup SIGTSTP

    if $debug; then
        bin/foreman start -f Procfile.debug
    else
        bin/foreman start -f Procfile.dev
    fi
else
    bin/puma -C config/puma.rb
fi

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
hephaestus-0.8.3 templates/script/server
hephaestus-0.8.2 templates/script/server
hephaestus-0.8.1 templates/script/server
hephaestus-0.8.0 templates/script/server
hephaestus-0.7.7.2 templates/script/server
hephaestus-0.7.7 templates/script/server
hephaestus-0.7.6.2 templates/script/server
hephaestus-0.7.6.1 templates/script/server
hephaestus-0.7.6 templates/script/server
hephaestus-0.7.5.3 templates/script/server
hephaestus-0.7.5.2 templates/script/server
hephaestus-0.7.5.1 templates/script/server
hephaestus-0.7.5 templates/script/server
hephaestus-0.7.4.2 templates/script/server
hephaestus-0.7.4.1 templates/script/server
hephaestus-0.7.4 templates/script/server
hephaestus-0.7.3.1 templates/script/server
hephaestus-0.7.3 templates/script/server
hephaestus-0.7.2.5 templates/script/server
hephaestus-0.7.2.4 templates/script/server