Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a bleeding edge version #10

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ RUN set -x && apt-get update && \
cd $DRUPAL_COMPOSER_ROOT && \
composer require drush/drush || \
# Try drush 11.x-dev if the above fails.
composer require drush/drush:11.x-dev && \
composer require drush/drush:11.x-dev || \
composer require drush/drush:13.x-dev && \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverse order.

mkdir -p $DRUPAL_DOCROOT/sites/default/files && \
chgrp www-data $DRUPAL_DOCROOT/sites/default/files && \
chmod 2775 $DRUPAL_DOCROOT/sites/default/files && \
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export DRUPAL_VERSIONS := $(shell \
curl --silent https://api.github.com/repos/drupal/recommended-project/tags | \
jq -r '.[].name' | \
sort -t '-' -uV -k 1.1,1.0)
export BLEEDING_EDGE_VERSION := 11.x@dev
export BLEEDING_EDGE_TAG := 11-dev
# Today's date.
export DATE := $(shell date "+%Y-%m-%d")
# The directory to keep track of build steps.
Expand All @@ -30,6 +32,7 @@ export DRUPAL_LATEST_MAJ_MIN = $(lastword $(filter $(DRUPAL_MAJ_MIN).%,$(DRUPAL_
export DRUPAL_LATEST := $(lastword $(DRUPAL_VERSIONS))
# Determine the correct version of PHP for the Drupal version.
# See https://www.drupal.org/docs/system-requirements/php-requirements
D11_PHP_VERSION := 8.3
D10_PHP_VERSION := 8.1
D9_PHP_VERSION := 8.1
D8_PHP_VERSION := 7.4
Expand All @@ -56,7 +59,7 @@ targets: ## Print out the available make targets.
.PHONY: push-image
push-image: tag ## Push the tagged images to the docker registry.
# # Push the images.
docker push --all-tags ${DESTINATION_DOCKER_IMAGE}
#docker push --all-tags ${DESTINATION_DOCKER_IMAGE}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might have snuck in?

# # Clean up after ourselves.
$(MAKE) clean

Expand All @@ -78,6 +81,11 @@ ${BUILD_DIR}/build-image-%: ${BUILD_DIR}
@if [ "$(*)" = "$(DRUPAL_LATEST)" ]; then \
docker tag $(DESTINATION_DOCKER_IMAGE):$(*) $(DESTINATION_DOCKER_IMAGE):latest; \
fi
# Extra! Get the bleeding edge one!
docker build \
--build-arg DRUPAL_VERSION=$(BLEEDING_EDGE_VERSION) \
--build-arg PHP_VERSION=$(D11_PHP_VERSION) \
-t $(DESTINATION_DOCKER_IMAGE):$(BLEEDING_EDGE_TAG) .
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but re-creates the bleeding edge one once per existing tag, which is suboptimal (even with all layers cached).
Need to learn more about Makefiles to avoid it.

Didn't do extensive testing of the image, but there might be some permissions issues on settings.php, and drush site-install is not working (might be not our issue, or might be related to the permissions)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may run on every version.

@touch $(@)

${BUILD_DIR}:
Expand Down