Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnharvey committed May 11, 2020
2 parents ea11ee6 + a79250b commit 8c58bea
Show file tree
Hide file tree
Showing 25 changed files with 693 additions and 93 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
MAGICLAMP_VERSION=1.1
PROJECTS_DIR=./data/projects
SSH_DIR=./data/ssh
DEFAULT_PHP_VERSION=7.2
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,26 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Install tooling
run: |
curl -fsSL https://goss.rocks/install | sudo sh
curl -LO https://raw.githubusercontent.com/aelsabbahy/goss/master/extras/dcgoss/dcgoss
chmod +x dcgoss
sudo mv dcgoss /usr/local/bin
- uses: actions/checkout@v1

- name: Build Docker Images
run: scripts/build-all-parallel.sh

- name: Test Docker Images
run: scripts/test.sh

- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
email: ${{ secrets.DOCKER_EMAIL }}
- name: Build and push images to registry
run: scripts/build.sh

- name: Push Docker Images
run: scripts/push.sh
13 changes: 0 additions & 13 deletions CHANGELOG-1.x.md

This file was deleted.

28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Release Notes

## [Unreleased](https://github.com/chrisnharvey/magicLAMP/compare/master...develop)

### v1.1.0

### New

- ElasticSearch is now included ([#21](https://github.com/chrisnharvey/magicLAMP/issues/21), [4effd1a](https://github.com/chrisnharvey/magicLAMP/commit/4effd1a97f6faac3b443642ab8f381812913b2b6))

### Improved

- Some containers are now tested automatically ([#16](https://github.com/chrisnharvey/magicLAMP/issues/16), [1735092](https://github.com/chrisnharvey/magicLAMP/commit/17350921bf9a7464c4b85f01d801d661952fbd05), [38f7abb](https://github.com/chrisnharvey/magicLAMP/commit/38f7abb3e40eec5432efb7f2f6201208943249ca), [e8f823b](https://github.com/chrisnharvey/magicLAMP/commit/e8f823b161e80334aac4c161010f6f6c9ef787c8))
- PHP version switcher no longer causes conflicts when run in parallel ([33df08d](https://github.com/chrisnharvey/magicLAMP/commit/33df08da4a57e1a94812aeac1173356f347fff42))

### Fixed

- Swoole is now working in the PHP 7.1 container ([344a5d7](https://github.com/chrisnharvey/magicLAMP/commit/344a5d7433e66f3c7ff94597f4f67fa8e9e37abc))

## v1.0.1

### Fixed

- Fix issue with Postgres container failing to start ([#22](https://github.com/chrisnharvey/magicLAMP/issues/22), [1d719ff](https://github.com/chrisnharvey/magicLAMP/commit/1d719ffb7e97489e273ddb893d6ee2944b1e9ffb))

## v1.0.0

Initial release
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# magicLAMP

[![Build](https://github.com/chrisnharvey/magicLAMP/workflows/Build/badge.svg)](https://github.com/chrisnharvey/magicLAMP/actions)
[![Documentation Status](https://readthedocs.org/projects/magiclamp/badge/?version=latest)](http://magiclamp.app/en/latest/?badge=latest)
[![Documentation Status](https://readthedocs.org/projects/magiclamp/badge/?version=stable)](http://magiclamp.app/en/stable/?badge=stable)
[![Author](http://img.shields.io/badge/[email protected]?style=square)](https://twitter.com/chrisnharvey)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=square)](LICENSE)

Expand All @@ -26,6 +26,7 @@ magicLAMP is a simple docker setup that provides a modern LEMP stack based on of
- [x] PostgreSQL
- [x] pgAdmin4
- [x] Redis
- [x] ElasticSearch
- [x] Auto DNS
- [x] Automatic Local SSL
- [x] Catch-all email with webmail (Mailcatcher)
Expand Down Expand Up @@ -65,6 +66,7 @@ The following DNS records are resolved automatically:

- redis.localhost
- mysql.localhost
- elasticsearch.localhost
- phpmyadmin.localhost
- postgres.localhost
- pgadmin.localhost
Expand Down
1 change: 1 addition & 0 deletions conf/default/dnsmasq_internal/dnsmasq.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ address=/workspace.localhost/10.0.10.5
address=/postgres.localhost/10.0.10.15
address=/mysql.localhost/10.0.10.20
address=/redis.localhost/10.0.10.21
address=/elasticsearch.localhost/10.0.10.92
address=/smtp.localhost/10.0.10.25
address=/chrome.localhost/10.0.10.30
address=/firefox.localhost/10.0.10.31
Expand Down
1 change: 1 addition & 0 deletions containers/default/elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM elasticsearch:7.6.2
2 changes: 1 addition & 1 deletion containers/default/php71/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ RUN docker-php-ext-install mysqli pdo pdo_mysql pdo_pgsql zip bcmath
RUN pecl install imagick
RUN pecl install swoole --enable-sockets --enable-openssl --enable-http2 --enable-async-redis --enable-timewheel --enable-mysqlnd --enable-ringbuffer

RUN docker-php-ext-enable imagick opcache
RUN docker-php-ext-enable imagick opcache swoole
66 changes: 57 additions & 9 deletions containers/default/workspace/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -qq php5.6 php5.6-imagick php

RUN DEBIAN_FRONTEND=noninteractive apt-get install -qq redis-tools iputils-ping screen

ADD install-composer.sh /root/install-composer.sh
RUN chmod +x /root/install-composer.sh
RUN /root/install-composer.sh
RUN update-alternatives --remove-all php
RUN update-alternatives --remove-all phpize
RUN update-alternatives --remove-all php-config
RUN update-alternatives --remove-all phar
RUN update-alternatives --remove-all phar.phar

ADD php/switch-php-version /usr/src/magicLAMP/switch-php-version
ADD php/5.6 /usr/bin/5.6
Expand All @@ -68,25 +70,71 @@ RUN chmod +x /usr/bin/7.2
RUN chmod +x /usr/bin/7.3
RUN chmod +x /usr/bin/7.4

RUN mkdir -p /opt/magicLAMP/php/5.6
RUN ln -s /usr/bin/php5.6 /opt/magicLAMP/php/5.6/php
RUN ln -s /usr/bin/phpize5.6 /opt/magicLAMP/php/5.6/phpize
RUN ln -s /usr/bin/phar5.6 /opt/magicLAMP/php/5.6/phar
RUN ln -s /usr/bin/phar.phar5.6 /opt/magicLAMP/php/5.6/phar.phar
RUN ln -s /usr/bin/php-config5.6 /opt/magicLAMP/php/5.6/php-config

RUN mkdir -p /opt/magicLAMP/php/7.0
RUN ln -s /usr/bin/php7.0 /opt/magicLAMP/php/7.0/php
RUN ln -s /usr/bin/phpize7.0 /opt/magicLAMP/php/7.0/phpize
RUN ln -s /usr/bin/phar7.0 /opt/magicLAMP/php/7.0/phar
RUN ln -s /usr/bin/phar.phar7.0 /opt/magicLAMP/php/7.0/phar.phar
RUN ln -s /usr/bin/php-config7.0 /opt/magicLAMP/php/7.0/php-config

RUN mkdir -p /opt/magicLAMP/php/7.1
RUN ln -s /usr/bin/php7.1 /opt/magicLAMP/php/7.1/php
RUN ln -s /usr/bin/phpize7.1 /opt/magicLAMP/php/7.1/phpize
RUN ln -s /usr/bin/phar7.1 /opt/magicLAMP/php/7.1/phar
RUN ln -s /usr/bin/phar.phar7.1 /opt/magicLAMP/php/7.1/phar.phar
RUN ln -s /usr/bin/php-config7.1 /opt/magicLAMP/php/7.1/php-config

RUN mkdir -p /opt/magicLAMP/php/7.2
RUN ln -s /usr/bin/php7.2 /opt/magicLAMP/php/7.2/php
RUN ln -s /usr/bin/phpize7.2 /opt/magicLAMP/php/7.2/phpize
RUN ln -s /usr/bin/phar7.2 /opt/magicLAMP/php/7.2/phar
RUN ln -s /usr/bin/phar.phar7.2 /opt/magicLAMP/php/7.2/phar.phar
RUN ln -s /usr/bin/php-config7.2 /opt/magicLAMP/php/7.2/php-config

RUN mkdir -p /opt/magicLAMP/php/7.3
RUN ln -s /usr/bin/php7.3 /opt/magicLAMP/php/7.3/php
RUN ln -s /usr/bin/phpize7.3 /opt/magicLAMP/php/7.3/phpize
RUN ln -s /usr/bin/phar7.3 /opt/magicLAMP/php/7.3/phar
RUN ln -s /usr/bin/phar.phar7.3 /opt/magicLAMP/php/7.3/phar.phar
RUN ln -s /usr/bin/php-config7.3 /opt/magicLAMP/php/7.3/php-config

RUN mkdir -p /opt/magicLAMP/php/7.4
RUN ln -s /usr/bin/php7.4 /opt/magicLAMP/php/7.4/php
RUN ln -s /usr/bin/phpize7.4 /opt/magicLAMP/php/7.4/phpize
RUN ln -s /usr/bin/phar7.4 /opt/magicLAMP/php/7.4/phar
RUN ln -s /usr/bin/phar.phar7.4 /opt/magicLAMP/php/7.4/phar.phar
RUN ln -s /usr/bin/php-config7.4 /opt/magicLAMP/php/7.4/php-config

RUN 5.6 pecl install -f swoole-2.0.10 --enable-sockets --enable-openssl --enable-http2 --enable-async-redis --enable-timewheel --enable-mysqlnd --enable-ringbuffer
RUN pecl uninstall -r swoole
RUN 5.6 pecl uninstall -r swoole
RUN echo "extension=swoole.so" > /etc/php/5.6/cli/conf.d/50-swoole.ini
RUN 7.0 pecl install -f swoole-4.3.6 --enable-sockets --enable-openssl --enable-http2 --enable-async-redis --enable-timewheel --enable-mysqlnd --enable-ringbuffer
RUN pecl uninstall -r swoole
RUN 7.0 pecl uninstall -r swoole
RUN echo "extension=swoole.so" > /etc/php/7.0/cli/conf.d/50-swoole.ini
RUN 7.1 pecl install -f swoole --enable-sockets --enable-openssl --enable-http2 --enable-async-redis --enable-timewheel --enable-mysqlnd --enable-ringbuffer
RUN pecl uninstall -r swoole
RUN 7.1 pecl uninstall -r swoole
RUN echo "extension=swoole.so" > /etc/php/7.1/cli/conf.d/50-swoole.ini
RUN 7.2 pecl install -f swoole --enable-sockets --enable-openssl --enable-http2 --enable-async-redis --enable-timewheel --enable-mysqlnd --enable-ringbuffer
RUN pecl uninstall -r swoole
RUN 7.2 pecl uninstall -r swoole
RUN echo "extension=swoole.so" > /etc/php/7.2/cli/conf.d/50-swoole.ini
RUN 7.3 pecl install -f swoole --enable-sockets --enable-openssl --enable-http2 --enable-async-redis --enable-timewheel --enable-mysqlnd --enable-ringbuffer
RUN pecl uninstall -r swoole
RUN 7.3 pecl uninstall -r swoole
RUN echo "extension=swoole.so" > /etc/php/7.3/cli/conf.d/50-swoole.ini
RUN 7.4 pecl install -f swoole --enable-sockets --enable-openssl --enable-http2 --enable-async-redis --enable-timewheel --enable-mysqlnd --enable-ringbuffer
RUN pecl uninstall -r swoole
RUN 7.4 pecl uninstall -r swoole
RUN echo "extension=swoole.so" > /etc/php/7.4/cli/conf.d/50-swoole.ini

ADD install-composer.sh /root/install-composer.sh
RUN chmod +x /root/install-composer.sh
RUN 7.4 /root/install-composer.sh

RUN runuser -l magicLAMP -c "mkdir -p /opt/magicLAMP/composer/5.6"
RUN runuser -l magicLAMP -c "mkdir -p /opt/magicLAMP/composer/7.0"
RUN runuser -l magicLAMP -c "mkdir -p /opt/magicLAMP/composer/7.1"
Expand Down
45 changes: 15 additions & 30 deletions containers/default/workspace/php/switch-php-version
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,30 @@ if [ -z $NEW_VERSION ] ; then
exit 1
fi

if [ -z $ORIGINAL_PATH ] ; then
export ORIGINAL_PATH=$PATH
fi

OLD_PHP_VERSION=$CURRENT_PHP_VERSION
export CURRENT_PHP_VERSION=$NEW_VERSION
export COMPOSER_HOME="~/.composer$CURRENT_PHP_VERSION"
export PATH="$COMPOSER_HOME/vendor/bin:/opt/magicLAMP/composer/$CURRENT_PHP_VERSION/vendor/bin":$ORIGINAL_PATH

if [ "$EUID" -ne 0 ] ; then
SUDO="sudo"
fi

${SUDO} update-alternatives --set php "/usr/bin/php$CURRENT_PHP_VERSION" &> /dev/null
${SUDO} update-alternatives --set phar "/usr/bin/phar$CURRENT_PHP_VERSION" &> /dev/null
${SUDO} update-alternatives --set phar.phar "/usr/bin/phar.phar$CURRENT_PHP_VERSION" &> /dev/null
${SUDO} update-alternatives --set phpize "/usr/bin/phpize$CURRENT_PHP_VERSION" &> /dev/null
${SUDO} update-alternatives --set php-config "/usr/bin/php-config$CURRENT_PHP_VERSION" &> /dev/null
if [ -z $ORIGINAL_PATH ] ; then
export ORIGINAL_PATH=$PATH
fi

COMPOSER_HOME="~/.composer$NEW_VERSION"
PATH="/opt/magicLAMP/php/${NEW_VERSION}:$COMPOSER_HOME/vendor/xbin:/opt/magicLAMP/composer/$NEW_VERSION/vendor/bin":$ORIGINAL_PATH
PHP_PEAR_PHP_BIN="/opt/magicLAMP/php/${NEW_VERSION}/php"

if [ "$SESSION_SWITCH" -eq "1" ]; then
echo "PHP version is set to $CURRENT_PHP_VERSION"
export COMPOSER_HOME
export PATH
export PHP_PEAR_PHP_BIN

echo "PHP version is set to $NEW_VERSION"
return 0
elif [ $# -eq 0 ] ; then
echo "No command specified. To switch version for the current session, run \". $CURRENT_PHP_VERSION\""
echo "No command specified. To switch version for the current session, run \". $NEW_VERSION\""
exit 1
fi

"$@"

status=$?

export CURRENT_PHP_VERSION=$OLD_PHP_VERSION
export COMPOSER_HOME="~/.composer${OLD_PHP_VERSION}"
export PATH="$COMPOSER_HOME/vendor/bin":$ORIGINAL_PATH

${SUDO} update-alternatives --set php "/usr/bin/php${OLD_PHP_VERSION}" &> /dev/null
${SUDO} update-alternatives --set phar "/usr/bin/phar${OLD_PHP_VERSION}" &> /dev/null
${SUDO} update-alternatives --set phar.phar "/usr/bin/phar.phar${OLD_PHP_VERSION}" &> /dev/null
${SUDO} update-alternatives --set phpize "/usr/bin/phpize${OLD_PHP_VERSION}" &> /dev/null
${SUDO} update-alternatives --set php-config "/usr/bin/php-config${OLD_PHP_VERSION}" &> /dev/null
COMPOSER_HOME=$COMPOSER_HOME PATH=$PATH PHP_PEAR_PHP_BIN=$PHP_PEAR_PHP_BIN "$@"

exit $status
exit $?
Loading

0 comments on commit 8c58bea

Please sign in to comment.