Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
debdutdeb committed May 4, 2022
1 parent 78ccad2 commit 855a7f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
8 changes: 4 additions & 4 deletions apps/meteor/deploy/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
-mongodb://${MONGODB_ROOT_USER:-root}:${MONGODB_ROOT_PASSWORD}@${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:\
${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\
local?authSource=admin&replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}"
ROOT_URL: ${ROOT_URL:-http://localhost:${HOST_PORT}}
ROOT_URL: ${ROOT_URL:-http://localhost:${HOST_PORT:-3000}}
PORT: ${PORT:-3000}
depends_on: [mongodb]
expose:
Expand All @@ -41,8 +41,8 @@ services:
- mongodb_data:/bitnami/mongodb
# using the long format to avoid docker automatically creating the source on host
- type: bind
source: ./user_set_role_cluster_admin.sh
target: /docker-entrypoint-initdb.d/user_set_role_cluster_admin.sh
source: ./user_set_role_cluster_monitor.sh
target: /docker-entrypoint-initdb.d/user_set_role_cluster_monitor.sh
read_only: true
environment:
BITNAMI_DEBUG: 'true'
Expand All @@ -59,4 +59,4 @@ services:
MONGODB_USERNAME: ${MONGODB_USERNAME:-rocketchat}
MONGODB_PASSWORD: ${MONGODB_PASSWORD?must pass database user password}
MONGODB_DATABASE: ${MONGODB_DATABASE:-rocketchat}
MONGODB_REPLICA_SET_KEY: ${MONGODB_REPLICA_SET_KEY?must pass a key; key length >=5}
MONGODB_REPLICA_SET_KEY: ${MONGODB_REPLICA_SET_KEY:-replaceme}
18 changes: 7 additions & 11 deletions apps/meteor/deploy/deploy-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ _substitute_or_inject_variable() {
local variable=${1?} value=${2?} file=${3?}
((DRY_RUN)) && { info "$variable=$value"; return; }
if grep -Eq "^$variable=.+" $file && ! ((FORCE)); then
warn "value for \"$variable\" already exists; skipping"
warn "value for \"$variable\" already exists; skipping; use --force to overwrite"
return
fi
# comment out the existing value and put the new value in
Expand Down Expand Up @@ -134,17 +134,11 @@ install_docker_compose() {
local distro="$(. /etc/os-release; echo $ID)"

case $distro in
'ubuntu'|'debian')
if [[ -n "$(apt search docker-compose-plugin -qqq)" ]]; then
run apt install docker-compose-plugin -yqqq || error "failed to install compose v2"
success_msg "compose v2 successfully installed"
return
fi
;;
'centos')
# do stuff
;;
'ubuntu'|'debian') [[ -n "$(apt search docker-compose-plugin -qqq)" ]] && run apt install docker-compose-plugin -yqqq || error "failed to install compose v2" ;;
'centos') [[ -n "$(yum -C -e0 -q search docker-compose-plugin)" ]] && run yum install -y docker-compose-plugin || error "failed to install compose v2" ;;
esac
&>/dev/null docker compose version && { success_msg "compose v2 sucessfully installed"; return; }
# well if we're here compose isn't in the repo or something else went wrong; manual install may still work
warn "compose v2 not found on the repos...attempting manual install"
do_install_compose
}
Expand Down Expand Up @@ -198,6 +192,8 @@ deploy() {
read -p "please enter your domain name (without the 'https://'): " domain
_substitute_or_inject_variable DOMAIN $domain .env
_substitute_or_inject_variable ROOT_URL "https://$domain" .env
read -p "please enter your email address for TLS certificate renewal: " email
_substitute_or_inject_variable LETSENCRYPT_EMAIL $email .env
fi

info "pulling docker images"
Expand Down

0 comments on commit 855a7f1

Please sign in to comment.