Compare commits
No commits in common. "390c13608a32675cbb6430125eda21e99387c18c" and "fc6141e2b924abff9e18a49eaa78357efdb132bf" have entirely different histories.
390c13608a
...
fc6141e2b9
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
@ -67,16 +67,18 @@ pipeline {
|
||||
script {
|
||||
sh script: 'git clean -ffdx', label: 'Clean repository'
|
||||
|
||||
env.VERSION = sh(script: 'git describe --tags --always --match "Release_*" HEAD', returnStdout: true).trim()
|
||||
def version = sh(script: 'git describe --tags --always --match "Release_*" HEAD', returnStdout: true).trim()
|
||||
def imageUrl = "git.esoko.eu/esoko/mapguesser:${version}"
|
||||
|
||||
sh script: """docker buildx build \
|
||||
-t ${imageUrl} \
|
||||
-f docker/Dockerfile \
|
||||
--target mapg_release \
|
||||
.""",
|
||||
label: 'Build Docker image'
|
||||
|
||||
withDockerRegistry([credentialsId: 'gitea-system-user', url: 'https://git.esoko.eu/']) {
|
||||
sh script: """docker buildx build \
|
||||
-f docker/Dockerfile \
|
||||
--target mapg_release \
|
||||
-t git.esoko.eu/esoko/mapguesser:${env.VERSION} \
|
||||
--push \
|
||||
.""",
|
||||
label: 'Build Docker image'
|
||||
sh script: "docker push ${imageUrl}", label: 'Push Docker image to registry'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ FROM ubuntu:focal AS mapg_base
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt update --fix-missing && apt install -y sudo curl git unzip mariadb-client nginx \
|
||||
RUN apt update --fix-missing && apt install -y curl git unzip mariadb-client nginx \
|
||||
php-apcu php7.4-cli php7.4-curl php7.4-fpm php7.4-mbstring php7.4-mysql php7.4-zip php7.4-xml
|
||||
|
||||
RUN mkdir -p /run/php
|
||||
@ -30,7 +30,6 @@ EXPOSE 8090
|
||||
EXPOSE 9229
|
||||
ENTRYPOINT docker/scripts/entry-point-dev.sh
|
||||
|
||||
|
||||
FROM mapg_base AS mapg_release
|
||||
|
||||
RUN apt update --fix-missing && apt install -y cron
|
||||
@ -38,7 +37,7 @@ RUN apt update --fix-missing && apt install -y cron
|
||||
WORKDIR /var/www/mapguesser
|
||||
COPY ./ /var/www/mapguesser
|
||||
RUN docker/scripts/release.sh &&\
|
||||
rm -rf /var/www/mapguesser/.git
|
||||
rm -rf /var/www/mapguesser/.git /var/www/mapguesser/.env
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 8090
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
chmod 777 cache
|
||||
|
||||
echo "Installing Composer packages..."
|
||||
if [ -f .env ]; then
|
||||
composer install
|
||||
@ -18,18 +20,11 @@ echo "Installing Yarn packages..."
|
||||
echo "Migrating DB..."
|
||||
./mapg db:migrate
|
||||
|
||||
echo "Set runner user based on owner of .env..."
|
||||
USER_UID=$(stat -c "%u" .env)
|
||||
USER_GID=$(stat -c "%g" .env)
|
||||
groupadd --gid $USER_GID mapg
|
||||
useradd --uid $USER_UID --gid $USER_GID mapg
|
||||
sed -i -e "s/^user = .*$/user = mapg/g" -e "s/^group = .*$/group = mapg/g" /etc/php/7.4/fpm/pool.d/www.conf
|
||||
|
||||
set +e
|
||||
|
||||
/usr/sbin/php-fpm7.4 -F &
|
||||
/usr/sbin/nginx -g 'daemon off;' &
|
||||
sudo -u mapg -g mapg /usr/bin/node --inspect=0.0.0.0:9229 multi &
|
||||
/usr/bin/node --inspect=0.0.0.0:9229 multi &
|
||||
|
||||
wait -n
|
||||
|
||||
|
@ -8,20 +8,12 @@ echo "Migrating DB..."
|
||||
echo "Installing crontab..."
|
||||
/usr/bin/crontab docker/scripts/cron
|
||||
|
||||
echo "Set runner user based on owner of .env..."
|
||||
USER_UID=$(stat -c "%u" .env)
|
||||
USER_GID=$(stat -c "%g" .env)
|
||||
groupadd --gid $USER_GID mapg
|
||||
useradd --uid $USER_UID --gid $USER_GID mapg
|
||||
chown mapg:mapg cache
|
||||
sed -i -e "s/^user = .*$/user = mapg/g" -e "s/^group = .*$/group = mapg/g" /etc/php/7.4/fpm/pool.d/www.conf
|
||||
|
||||
set +e
|
||||
|
||||
/usr/sbin/cron -f &
|
||||
/usr/sbin/php-fpm7.4 -F &
|
||||
/usr/sbin/nginx -g 'daemon off;' &
|
||||
sudo -u mapg -g mapg /usr/bin/node multi &
|
||||
/usr/bin/node multi &
|
||||
|
||||
wait -n
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
chmod 777 cache
|
||||
|
||||
echo "Installing Composer packages..."
|
||||
composer create-project --no-dev
|
||||
|
||||
@ -26,5 +28,3 @@ find public/static/img -type f -iname '*.svg' -exec svgo {} -o {} \;
|
||||
|
||||
echo "Linking view files..."
|
||||
./mapg view:link
|
||||
|
||||
rm .env
|
||||
|
Loading…
Reference in New Issue
Block a user