Skip to content
Merged
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
41 changes: 41 additions & 0 deletions .buildkite/pipeline.pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
env:
PIPELINE_NAME: docker-php

steps:
- block: ":question::hammer: What version do you want to test?"
fields:
- select: Select a version to test
key: selected-version
required: true
options:
- label: v8.3.6-fpm
value: 8.3.6-fpm
- label: v8.2.4-fpm
value: 8.2.4-fpm

- label: ":hammer::docker: Running tests for the selected version"
command: |
VERSION="$$(buildkite-agent meta-data get selected-version --default 'NA')"

bin/php tests --version "$${VERSION}" --build


- block: ":question::hammer: Do you want to release this version?"

- label: Trigger Build and Release pipeline
command: |
VERSION="$$(buildkite-agent meta-data get selected-version --default 'NA')"

cat <<- YAML | buildkite-agent pipeline upload
steps:
- trigger: ${PIPELINE_NAME}
async: true
label: ":construction::building_construction: Trigger release for version $$VERSION"
build:
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
VERSION: "$$VERSION"
VERSION_IS_LATEST: no
DEPLOY_SERVICE: release
YAML
21 changes: 21 additions & 0 deletions .buildkite/pipeline.release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
env:
IMAGE: bandsintown/php

steps:
- label: ":docker: Build and Push PHP v${VERSION}"
if: build.env("VERSION") != "NA"
plugins:
- docker-compose#v5.2.0:
build: php
push:
- php:${IMAGE}:${VERSION}-${BUILDKITE_COMMIT:0:7}

- wait

- label: ":docker: Tag as latest and Push PHP v${VERSION}"
if: build.env("VERSION_IS_LATEST") == "yes"
plugins:
- docker-compose#v5.2.0:
push:
- php:${IMAGE}:${VERSION}
- php:${IMAGE}:latest
30 changes: 30 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
steps:
# Upload pipeline for branch `master`.
# Conditions:
# Build created from branch `master`
# Not "triggered" by other builds.
- command: "buildkite-agent pipeline upload .buildkite/pipeline.master.yml"
label: ":pipeline: Master pipeline"
if: |
build.branch == "master" &&
build.source != "trigger_job"

# Upload pipeline for Pull Requests.
# Conditions:
# Not created from the `master` branch.
# Not "triggered" by other builds.
- command: "buildkite-agent pipeline upload .buildkite/pipeline.pull_request.yml"
label: ":pipeline: Pull Request pipeline"
if: |
build.branch != "master" &&
build.source != "trigger_job"

# Upload pipeline specified by $DEPLOY_SERVICE.
# Conditions:
# Build triggered by other builds.
# $DEPLOY_SERVICE is specified.
- command: "buildkite-agent pipeline upload .buildkite/pipeline.${DEPLOY_SERVICE}.yml"
label: ":pipeline: Triggered pipeline for ${DEPLOY_SERVICE}"
if: |
build.source == "trigger_job" &&
build.env("DEPLOY_SERVICE") != "NA"
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true


[*.yml]
indent_size = 2
59 changes: 59 additions & 0 deletions Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
FROM bandsintown/alpine:3.19.1 as builder

FROM %%PARENT%%:%%VERSION_FULL%%-alpine

ENV S6_LOGGING=1 S6_OVERLAY_VERSION=1.19.1.1 GODNSMASQ_VERSION=1.0.7 CONSUL_TEMPLATE_VERSION=0.19.4 CONSUL_VERSION=0.8.4 MEMCACHED_DEPS="zlib-dev libmemcached-dev cyrus-sasl-dev" TZ="America/New_York"

COPY --from=builder /usr/local/bin/consul /usr/local/bin/consul
COPY --from=builder /usr/local/bin/consul-template /usr/local/bin/consul-template
COPY --from=builder /usr/sbin/go-dnsmasq /usr/sbin/go-dnsmasq
COPY --from=builder /etc/cont-init.d /etc/cont-init.d
COPY --from=builder /etc/services.d /etc/services.d
COPY --from=builder /root /root

RUN apk update && apk upgrade \
&& apk add --update \
coreutils \
freetype-dev \
libjpeg-turbo-dev \
libltdl \
libpng-dev \
curl wget bash tree jq bind-tools su-exec build-base gcc autoconf \
libmemcached-libs zlib \
&& set -xe \
&& apk add --virtual .phpize-deps $PHPIZE_DEPS \
&& apk add --virtual .memcached-deps $MEMCACHED_DEPS \
&& pecl install memcached-3.1.4 \
&& echo "extension=memcached.so" > /usr/local/etc/php/conf.d/20_memcached.ini \
&& pecl install memcache \
&& echo "extension=memcache.so" > /usr/local/etc/php/conf.d/21_memcache.ini \
&& docker-php-ext-install mysqli \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd \
&& rm -rf /usr/share/php8 \
&& rm -rf /tmp/* \
&& apk del .memcached-deps .phpize-deps

RUN curl -Ls https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz | tar -xz -C /

RUN mkdir /var/composer && \
cd /var/composer && \
php -r "copy('https://getcomposer.org/download/2.7.3/composer.phar', 'composer-setup.php');" && \
php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
php composer-setup.php --install-dir=/usr/bin --filename=composer && \
php -r "unlink('composer-setup.php');"

COPY rootfs /

RUN echo $TZ > /etc/timezone \
&& touch /usr/local/var/run/php-fpm.pid \
&& echo -ne "- with $(php -v | head -n 1)\n" >> /root/.built

EXPOSE 9000

# Workaround https://bugs.php.net/bug.php?id=71880
ENV LOG_STREAM="/tmp/stdout"
RUN mkfifo $LOG_STREAM && chmod 777 $LOG_STREAM

ENTRYPOINT ["/init"]
CMD ["/bin/sh", "-c", "php-fpm --pid /usr/local/var/run/php-fpm.pid | tail -f $LOG_STREAM"]
157 changes: 0 additions & 157 deletions bin/functions

This file was deleted.

Loading