github.com/web-platform-tests/wpt.fyi@v0.0.0-20240530210107-70cf978996f1/util/docker-dev/web_server.sh (about)

     1  #!/bin/bash
     2  
     3  # Start the Google Cloud web development server in `wptd-dev-instance`
     4  # (started using ./run.sh).
     5  
     6  DOCKER_DIR=$(dirname $0)
     7  source "${DOCKER_DIR}/../commands.sh"
     8  source "${DOCKER_DIR}/../logging.sh"
     9  
    10  set -e
    11  
    12  wptd_exec make inotifywait
    13  info "Building web server..."
    14  # Build the full go_build target to get node_modules.
    15  wptd_exec make go_build
    16  
    17  DOCKER_STATUS="${?}"
    18  if [ "${DOCKER_STATUS}" != "0" ]; then
    19    error "Failed to install web server code dependencies"
    20    exit "${DOCKER_STATUS}"
    21  fi
    22  
    23  info "Starting web server. Port forwarded to host: ${WPTD_HOST_WEB_PORT}"
    24  wptd_exec_it "\$(gcloud beta emulators datastore env-init) && util/server-watch.sh"