Files
James Butters e38b3a49be add support for mutagen setup and update.
flag = none
closes: DE-529

Test Plan:
Test All On Linux and Mac
-docker_dev_setup without mutagen
  -test with dinghy not created, down, missing
-docker_dev_setup with mutagen
  -with docker desktop not running
  -with and without dory
-docker_dev_update with and without mutagen
  -with update-code option and without
-update_canvas for local is not broken
-following Next Steps, all works for mutagen

Change-Id: I7690dc2d919cf1b9d8af86200ec8439da9135d16
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/262293
QA-Review: James Butters <jbutters@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
Product-Review: James Butters <jbutters@instructure.com>
2021-04-27 19:46:36 +00:00

35 lines
1.0 KiB
Bash

#!/bin/bash
source script/common/utils/spinner.sh
function set_service_util {
if installed service; then
service_manager='service'
start_docker="sudo service docker start"
elif installed systemctl; then
service_manager='systemctl'
start_docker="sudo systemctl start docker"
else
echo "Unable to find 'service' or 'systemctl' installed."
exit 1
fi
}
function start_docker_daemon {
eval "$service_manager docker status &> /dev/null" && return 0
prompt 'The docker daemon is not running. Start it? [y/n]' confirm
[[ ${confirm:-n} == 'y' ]] || return 1
eval "$start_docker"
sleep 1 # wait for docker daemon to start
}
function setup_docker_as_nonroot {
docker ps &> /dev/null && return 0
message 'Setting up docker for nonroot user...'
if ! id -Gn "$USER" | grep -q '\bdocker\b'; then
message "Adding $USER user to docker group..."
confirm_command "sudo usermod -aG docker $USER" || true
fi
message 'We need to login again to apply that change.'
confirm_command "exec sg docker -c $0"
}