Commit 8c794c34 authored by Vadym Gidulian's avatar Vadym Gidulian

Initial commit

parents
services:
- docker:dind
variables:
IMAGE_SNAPSHOT: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME-snapshot
IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest
stages:
- build
- test
- release
before_script:
- docker version
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build:
stage: build
script:
- docker build --pull -t $IMAGE_SNAPSHOT .
- docker push $IMAGE_SNAPSHOT
tags:
- dind
test:
stage: test
script:
- docker pull $IMAGE_SNAPSHOT
- docker run --rm --entrypoint='bash' $IMAGE_SNAPSHOT -c '[[ $(ls -A /usr/src/bolt) ]] && echo "Bolt is downloaded."'
tags:
- dind
release:
stage: release
script:
- docker pull $IMAGE_SNAPSHOT
- docker tag $IMAGE_SNAPSHOT $IMAGE
- docker push $IMAGE
tags:
- dind
except:
- master
release:latest:
stage: release
script:
- docker pull $IMAGE_SNAPSHOT
- docker tag $IMAGE_SNAPSHOT $IMAGE_LATEST
- docker push $IMAGE_LATEST
tags:
- dind
only:
- master
FROM php:apache
MAINTAINER Vadym Gidulian <vadym.gidulian@gvia.group>
COPY bolt-entrypoint.sh /usr/local/bin/
VOLUME /bolt
WORKDIR /bolt
RUN apt-get update && \
apt-get install -y \
libicu-dev \
libjpeg-dev \
libpng-dev && \
\
docker-php-ext-configure gd --with-jpeg-dir=/usr/lib && \
docker-php-ext-install exif gd intl opcache pdo_mysql zip && \
\
rm -rf /var/lib/apt/lists/* && \
\
mkdir /usr/src/bolt && \
curl https://bolt.cm/distribution/bolt-latest.tar.gz | tar xzC /usr/src/bolt --strip-components=1 && \
\
rm -r /var/www/html && \
ln -s /bolt/public /var/www/html && \
\
a2enmod rewrite && \
sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
ENTRYPOINT ["bolt-entrypoint.sh"]
#!/bin/bash
set -e
if ! [ -e $PWD/app/nut -a -e $PWD/public/index.php ]; then
echo >&2 "Bolt not found in $PWD. Installing now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty! Press Ctrl+C now if this is an error!"
(set -x; ls -A; sleep 10)
fi
tar cplC /usr/src/bolt . | tar xplC $PWD
php app/nut init
set +e
chown -R www-data:www-data .
chmod a+r .
for dir in app/cache/ app/database/ public/thumbs/
do
find $dir -type d -print0 | xargs -0 chmod u+rwx,g+rwxs,o+rx-w
find $dir -type f -print0 | xargs -0 chmod u+rw-x,g+rw-x,o+r-wx > /dev/null 2>&1
done
for dir in app/config/ extensions/ public/extensions/ public/files/ public/theme/
do
find $dir -type d -print0 | xargs -0 chmod u+rwx,g+rwxs,o+rx-w
find $dir -type f -print0 | xargs -0 chmod u+rw-x,g+rw-x,o+r-wx > /dev/null 2>&1
done
set -e
echo >&2 "Finished. Bolt has been successfully installed into $PWD."
fi
docker-php-entrypoint apache2-foreground
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment