-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use an external base gitpod image (ddev#3331)
- Loading branch information
Showing
4 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Set up ddev for use on gitpod | ||
|
||
set -eu -o pipefail | ||
|
||
if [ $# != 1 ]; then | ||
echo "Usage: gitpod-setup-ddev.sh <project-path>" && exit 1 | ||
fi | ||
|
||
PROJDIR="$1/.ddev" | ||
cd ${PROJDIR} | ||
|
||
# Generate a config.gitpod.yaml that adds the gitpod | ||
# proxied ports so they're known to ddev. | ||
shortgpurl="${GITPOD_WORKSPACE_URL#'https://'}" | ||
|
||
cat <<CONFIGEND > ${PROJDIR}/config.gitpod.yaml | ||
web_environment: | ||
- DRUSH_OPTIONS_URI=$(gp url 8080) | ||
bind_all_interfaces: true | ||
host_webserver_port: 8080 | ||
# Will ignore the direct-bind https port, which will land on 2222 | ||
host_https_port: 2222 | ||
# Allows local db clients to run | ||
host_db_port: 3306 | ||
# Assign MailHog port | ||
host_mailhog_port: "8025" | ||
# Assign phpMyAdmin port | ||
host_phpmyadmin_port: 8036 | ||
CONFIGEND | ||
|
||
# We need host.docker.internal inside the container, | ||
# So add it via docker-compose.host-docker-internal.yaml | ||
hostip=$(awk "\$2 == \"$HOSTNAME\" { print \$1; }" /etc/hosts) | ||
|
||
cat <<COMPOSEEND >${PROJDIR}/docker-compose.host-docker-internal.yaml | ||
#ddev-gitpod-generated | ||
version: "3.6" | ||
services: | ||
web: | ||
extra_hosts: | ||
- "host.docker.internal:${hostip}" | ||
COMPOSEEND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
DOCKER_REPO=drud/ddev-gitpod-base:latest | ||
|
||
echo "Pushing ${DOCKER_REPO}" | ||
set -x | ||
# Build only current architecture and load into docker | ||
docker buildx build -t ${DOCKER_REPO} --push --platform=linux/amd64 . |