Skip to content

Commit

Permalink
Build bedrock images with php 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
calind committed Feb 15, 2022
1 parent a314749 commit c6704f0
Show file tree
Hide file tree
Showing 26 changed files with 2,605 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,61 @@ services:
environment:
DOCKER_TLS_CERTDIR: ""

---
kind: pipeline
name: wordpress-runtime-bedrock-php-8.1

depends_on:
- php-runtime-8.1

workspace:
base: /workspace
path: src/github.com/bitpoke/stack-runtimes

steps:
- &step
name: setup docker
pull: always
image: docker.io/bitpoke/build:v0.8.0
environment: &baseEnv
TAG_SUFFIX: ${DRONE_BRANCH/master/}
TEST_HOSTNAME: docker
DOCKER_HOST: tcp://docker:2375
commands:
- dockerize -wait http://docker:2375/_ping -timeout 30s
- docker info
- make -C wordpress pull-$DRONE_STAGE_NAME

- <<: *step
name: build image
pull: default
commands:
- make -C wordpress $DRONE_STAGE_NAME

- <<: *step
name: test image
pull: default
commands:
- make -C wordpress test-$DRONE_STAGE_NAME

- <<: *step
name: publish
pull: default
environment:
<<: *baseEnv
DOCKER_USERNAME: bitpokebot
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
commands:
- /usr/local/bin/setup-credentials-helper.sh
- make -C wordpress push-$DRONE_STAGE_NAME

services:
- name: docker
image: docker:20.10.8-dind-rootless
environment:
DOCKER_TLS_CERTDIR: ""

---
kind: pipeline
name: wordpress-runtime-bedrock
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include common.Makefile

REGISTRY ?= docker.io/bitpoke
PHP_VERSION ?= 7.4.27
WORDPRESS_VERSION ?= 5.8
WORDPRESS_VERSION ?= 5.9

ifndef CI
TAG_SUFFIX ?= canary
Expand Down
11 changes: 11 additions & 0 deletions wordpress/Dockerfile-bedrock-build-php-8.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ARG BASE_IMAGE=docker.io/bitpoke/wordpress-runtime:bedrock-php-8.1
FROM ${BASE_IMAGE} as bedrock
WORKDIR /src
# Install project dependencies as first build step for child images so that we
# heat up composer cache
ONBUILD COPY --chown=www-data:www-data composer.json composer.lock /src/
ONBUILD RUN composer install --no-dev --no-interaction --no-progress --no-ansi --no-scripts

ONBUILD COPY --chown=www-data:www-data . /src
ONBUILD RUN composer install --no-dev --no-interaction --no-progress --no-ansi --no-scripts
ONBUILD RUN cp -a /src/. /app
21 changes: 21 additions & 0 deletions wordpress/Dockerfile-bedrock-php-8.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ARG PHP_BASE_IMAGE=docker.io/bitpoke/php-runtime:8.1
FROM ${PHP_BASE_IMAGE} as bedrock

ENV WP_CLI_VERSION=2.6.0
ENV WP_CLI_CONFIG_PATH=/app/wp-cli.yml
ENV DOCUMENT_ROOT=/app/web
ENV WP_CONTENT_DIR=${DOCUMENT_ROOT}/app
ENV STACK_MEDIA_PATH=/app/uploads
USER root
COPY docker/build-scripts /usr/local/docker/build-scripts/
RUN set -ex \
&& /usr/local/docker/build-scripts/install-wp-cli \
&& rm -rf /app \
&& mkdir -p /app/web /src \
&& { \
echo "path: $DOCUMENT_ROOT/wp"; \
} | tee /app/wp-cli.yml >&2 \
&& chown -R www-data:www-data /app /src

COPY --chown=www-data:www-data ./docker /usr/local/docker
USER www-data
13 changes: 13 additions & 0 deletions wordpress/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ push-wordpress-runtime-bedrock: push-wordpress-runtime-bedrock-build

wordpress-runtime-bedrock-php-8.0: wordpress-runtime-bedrock-build-php-8.0
push-wordpress-runtime-bedrock-php-8.0: push-wordpress-runtime-bedrock-build-php-8.0

# Modify build targets for bedrock-php-8.1 so that we build, test and publish bedrock-php-8.1 and bedrock-build-php-8.1 variants
.build/wordpress-runtime-bedrock-build-php-8.1: .build/wordpress-runtime-bedrock-php-8.1
.build/wordpress-runtime-bedrock-build-php-8.1: BASE_IMAGE := local.build/wordpress-runtime-bedrock-php-8.1
.build/wordpress-runtime-bedrock-build-php-8.1: DOCKER_BUILD := docker build

.build/tag-wordpress-runtime-bedrock-build-php-8.1: .build/tag-wordpress-runtime-bedrock-php-8.1

.build/test-wordpress-runtime-bedrock-build-php-8.1: .build/test-wordpress-runtime-bedrock-build-php-8.1 ;

wordpress-runtime-bedrock-php-8.1: wordpress-runtime-bedrock-build-php-8.1
push-wordpress-runtime-bedrock-php-8.1: push-wordpress-runtime-bedrock-build-php-8.1

28 changes: 28 additions & 0 deletions wordpress/test/bedrock-php-8/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
DB_NAME='database_name'
DB_USER='database_user'
DB_PASSWORD='database_password'

# Optionally, you can use a data source name (DSN)
# When using a DSN, you can remove the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST variables
# DATABASE_URL='mysql://database_user:database_password@database_host:database_port/database_name'

# Optional database variables
# DB_HOST='localhost'
# DB_PREFIX='wp_'

WP_ENV='development'
WP_HOME='http://example.com'
WP_SITEURL="${WP_HOME}/wp"

# Specify optional debug.log path
# WP_DEBUG_LOG='/path/to/debug.log'

# Generate your keys here: https://roots.io/salts.html
AUTH_KEY='generateme'
SECURE_AUTH_KEY='generateme'
LOGGED_IN_KEY='generateme'
NONCE_KEY='generateme'
AUTH_SALT='generateme'
SECURE_AUTH_SALT='generateme'
LOGGED_IN_SALT='generateme'
NONCE_SALT='generateme'
26 changes: 26 additions & 0 deletions wordpress/test/bedrock-php-8/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Application
web/app/plugins/*
!web/app/plugins/.gitkeep
web/app/mu-plugins/*/
web/app/upgrade
web/app/uploads/*
!web/app/uploads/.gitkeep
web/app/cache/*

# WordPress
web/wp
web/.htaccess

# Logs
*.log

# Dotenv
.env
.env.*
!.env.example

# Composer
/vendor

# WP-CLI
wp-cli.local.yml
Loading

0 comments on commit c6704f0

Please sign in to comment.