Skip to content
Open
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
57 changes: 0 additions & 57 deletions .circleci/config.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Git
.git
.gitignore

# Docker
docker-compose.yml
Dockerfile
.dockerignore

# CI/CD
.circleci/
cloudbuild.yaml

# Documentation
README.md
FUNDING.yml
LICENSE
packages/Readme.md
scratch-info.txt

# Local development
.env.local
.env.*.local
.env.postgres.local
local_data
Makefile

# IDE
.editorconfig
.idea
.vscode
.devcontainer/
*.swp
*.swo
*~

# Cache and logs
var/cache/*
var/log/*
!var/cache/.gitkeep
!var/log/.gitkeep

# Composer
composer.phar

# Testing
phpunit.xml
.phpunit.result.cache
tests

# Node modules (if any)
node_modules

# OS files
.DS_Store
Thumbs.db

3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* @wpengine/wp-updater james.dominy@wpengine.com

#jira:APIH is where issues related to this repository should be ticketed
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/config/reference.php
/public/bundles/
/vendor/
###< symfony/framework-bundle ###
Expand All @@ -22,3 +23,7 @@
# Apache-specific user and not implode at runtime when they want to write cache files.
/var/*
!/var/cache/twig/.gitkeep

/local_data/*
!/local_data/.gitkeep
.DS_Store
33 changes: 27 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
FROM php:8.1-apache
FROM php:8.5-apache

ARG env
RUN test -n "$env"

# Install the AWS CLI - needed to load in secrets safely from S3. See https://aws.amazon.com/blogs/security/how-to-manage-secrets-for-amazon-ec2-container-service-based-applications-by-using-amazon-s3-and-docker/
RUN apt-get update -qq && apt-get install -y awscli && \
rm -rf /var/lib/apt/lists/* /var/cache/apk/*
ARG target=aws

RUN if [ "$target" = "aws" ]; then \
# Install the AWS CLI - needed to load in secrets safely from S3. \
echo Building for target=aws && \
apt-get update -qq && apt-get install -y awscli && \
rm -rf /var/lib/apt/lists/* /var/cache/apk/*; \
elif [ "$target" = "gcp" ]; then \
# Install the gcloud CLI - needed to get secrets from Google Secret Manager \
echo Building for target=gcp && \
apt-get update -qq && \
apt-get install -y curl gnupg apt-transport-https ca-certificates && \
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \
apt-get update -qq && apt-get install -y google-cloud-cli && \
rm -rf /var/lib/apt/lists/* /var/cache/apk/*; \
fi

# Install svn client, a requirement for the current native exec approach; git for
# Composer pulls; libpq-dev for Postgres; libicu-dev for intl; libonig-dev for mbstring.
Expand All @@ -17,8 +31,6 @@ RUN apt-get update -qq && \
RUN docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install intl mbstring pdo_pgsql zip

RUN docker-php-ext-enable opcache

RUN pecl install redis && rm -rf /tmp/pear && docker-php-ext-enable redis

# Get latest Composer
Expand All @@ -41,4 +53,13 @@ COPY ./config/php/php.ini /usr/local/etc/php/
RUN mkdir /tmp/twig
RUN chmod -R 777 /tmp/twig

RUN chown -R www-data:www-data /var/www/html
# USER www-data

RUN APP_ENV=${env} composer install --no-interaction --quiet --optimize-autoloader --no-dev

# Make entrypoint scripts executable
RUN chmod +x /var/www/html/deploy/*.sh || true

# Use web_entrypoint.sh directly (handles all platforms: AWS, GCP, Docker)
CMD ["/var/www/html/deploy/web_entrypoint.sh"]
43 changes: 43 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Makefile for wpackagist

DOCKER := $(shell [[ -x `which docker` ]] && which docker || which podman )

# Default environment variables
APP_ENV ?= prod
LABEL ?= stg

.PHONY: help build-local build-aws build-gcp clean

help:
@echo "Available targets:"
@echo " build-local - Build Docker image for local development"
@echo " build-aws - Build Docker image for AWS deployment"
@echo " build-gcp LABEL=[stg|prd] - Build Docker image for GCP for local testing; LABEL=stg is the default"
@echo " clean - Remove local Docker images"

build-local:
$(DOCKER) build \
--build-arg env=dev \
--build-arg target=local \
--label arch=$(shell uname -m) \
-t wpackagist:local \
.

build-aws:
$(DOCKER) build \
--build-arg env=prod \
--build-arg target=aws \
--label arch=$(shell uname -m) \
-t wpackagist:aws \
.

build-gcp:
$(DOCKER) build \
--build-arg env=$(APP_ENV) \
--build-arg target=gcp \
--label arch=$(shell uname -m) \
-t wpackagist:gcp-$(LABEL) \
.

clean:
docker rmi -f wpackagist:local wpackagist:aws wpackagist:gcp || true
40 changes: 20 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Install and manage WordPress plugins with Composer",
"config": {
"platform": {
"php": "8.0.28"
"php": "8.5.2"
},
"sort-packages": true,
"allow-plugins": {
Expand All @@ -12,7 +12,7 @@
},
"minimum-stability": "stable",
"require": {
"php": "^8.0",
"php": "^8.5",
"ext-intl": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand All @@ -21,27 +21,27 @@
"ext-pdo_sqlite": "*",
"ext-redis": "*",
"ext-simplexml": "*",
"babdev/pagerfanta-bundle": "^3.0",
"composer/composer": "^1.10.19",
"composer/package-versions-deprecated": "^1.11",
"doctrine/dbal": "^2.10.2",
"doctrine/doctrine-bundle": "^2.6",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.12",
"babdev/pagerfanta-bundle": "^4.0",
"composer/composer": "^2.0",
"doctrine/dbal": "^4.0",
"doctrine/doctrine-bundle": "^2.13",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^3.0",
"guzzlehttp/guzzle-services": "^1.1.3",
"pagerfanta/doctrine-orm-adapter": "^3.7",
"pagerfanta/doctrine-orm-adapter": "^4.0",
"pagerfanta/twig": "^3.0",
"rarst/wporg-client": "~0.5",
"symfony/config": "^5.0",
"symfony/console": "^5.0",
"symfony/dotenv": "^5.0",
"symfony/filesystem": "^5.0",
"symfony/flex": "^1.6",
"symfony/form": "^5.0",
"symfony/monolog-bundle": "^3.6",
"symfony/security-csrf": "^5.0",
"symfony/twig-bundle": "^5.4",
"symfony/yaml": "^5.0",
"symfony/config": "^7.2",
"symfony/console": "^7.2",
"symfony/dotenv": "^7.2",
"symfony/filesystem": "^7.2",
"symfony/flex": "^2.0",
"symfony/form": "^7.2",
"symfony/monolog-bundle": "^3.10",
"symfony/security-csrf": "^7.2",
"symfony/twig-bundle": "^7.2",
"symfony/var-exporter": "^7.4",
"symfony/yaml": "^7.2",
"twig/extra-bundle": "^3.4",
"twig/twig": "^3.14"
},
Expand Down
Loading