Compare commits
19 Commits
Release_23
...
develop
Author | SHA1 | Date | |
---|---|---|---|
9b2ffa8b2c | |||
9bafc52626 | |||
18ddaa1da4 | |||
be2105a284 | |||
5481cc67a0 | |||
a547fbb631 | |||
0e3f943f1e | |||
ec42479304 | |||
dbb7c1c0fc | |||
410bba4966 | |||
17aee22400 | |||
aaf220dce2 | |||
276a289ca7 | |||
e684365612 | |||
105cc96963 | |||
bdd62aadf5 | |||
390c13608a | |||
345cf31bb3 | |||
c7f5ea0d85 |
43
Jenkinsfile
vendored
43
Jenkinsfile
vendored
@ -62,23 +62,42 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Release Docker image') {
|
||||
stage('Prepare Docker release') {
|
||||
environment {
|
||||
COMPOSER_HOME="${WORKSPACE}/.composer"
|
||||
npm_config_cache="${WORKSPACE}/.npm"
|
||||
}
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'docker/Dockerfile'
|
||||
dir '.'
|
||||
additionalBuildArgs '--target mapg_base'
|
||||
reuseNode true
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
sh script: 'git clean -ffdx', label: 'Clean repository'
|
||||
env.VERSION = sh(script: 'git describe --tags --always --match "Release_*" HEAD', returnStdout: true).trim()
|
||||
sh script: 'docker/scripts/release.sh', label: 'Release script'
|
||||
sh script: "rm -rf ${env.COMPOSER_HOME} ${env.npm_config_cache}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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'
|
||||
|
||||
stage('Release Docker image') {
|
||||
steps {
|
||||
script {
|
||||
withDockerRegistry([credentialsId: 'gitea-system-user', url: 'https://git.esoko.eu/']) {
|
||||
sh script: "docker push ${imageUrl}", label: 'Push Docker image to registry'
|
||||
sh script: 'docker buildx create --use --bootstrap --platform=linux/arm64,linux/amd64 --name multi-platform-builder'
|
||||
sh script: """docker buildx build \
|
||||
--platform linux/amd64,linux/arm64 \
|
||||
-f docker/Dockerfile \
|
||||
--target mapg_release \
|
||||
-t git.esoko.eu/esoko/mapguesser:${env.VERSION} \
|
||||
--push \
|
||||
.""",
|
||||
label: 'Build Docker image'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,11 +10,10 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"esoko/soko-web": "0.14",
|
||||
"fzaninotto/faker": "^1.9"
|
||||
"esoko/soko-web": "0.15"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"phpunit/phpunit": "^10.3",
|
||||
"phpstan/phpstan": "^1.10"
|
||||
},
|
||||
"autoload": {
|
||||
|
900
composer.lock
generated
900
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
||||
FROM ubuntu:focal AS mapg_base
|
||||
FROM ubuntu:22.04 AS mapg_base
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
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 apt update --fix-missing && apt install -y sudo curl git unzip mariadb-client nginx \
|
||||
php-apcu php8.1-cli php8.1-curl php8.1-fpm php8.1-mbstring php8.1-mysql php8.1-zip php8.1-xml
|
||||
|
||||
RUN mkdir -p /run/php
|
||||
COPY docker/configs/nginx.conf /etc/nginx/sites-available/default
|
||||
@ -20,9 +20,9 @@ FROM mapg_base AS mapg_dev
|
||||
|
||||
RUN apt update --fix-missing && apt install -y php-xdebug
|
||||
|
||||
RUN echo "xdebug.remote_enable = 1" >> /etc/php/7.4/mods-available/xdebug.ini &&\
|
||||
echo "xdebug.remote_autostart = 1" >> /etc/php/7.4/mods-available/xdebug.ini &&\
|
||||
echo "xdebug.remote_connect_back = 1" >> /etc/php/7.4/mods-available/xdebug.ini
|
||||
RUN echo "xdebug.remote_enable = 1" >> /etc/php/8.1/mods-available/xdebug.ini &&\
|
||||
echo "xdebug.remote_autostart = 1" >> /etc/php/8.1/mods-available/xdebug.ini &&\
|
||||
echo "xdebug.remote_connect_back = 1" >> /etc/php/8.1/mods-available/xdebug.ini
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 5000
|
||||
@ -30,14 +30,14 @@ 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
|
||||
|
||||
WORKDIR /var/www/mapguesser
|
||||
COPY ./ /var/www/mapguesser
|
||||
RUN docker/scripts/release.sh &&\
|
||||
rm -rf /var/www/mapguesser/.git /var/www/mapguesser/.env
|
||||
RUN rm -rf /var/www/mapguesser/.git
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 8090
|
||||
|
@ -18,7 +18,7 @@ server {
|
||||
|
||||
location ~ \.php$ {
|
||||
include snippets/fastcgi-php.conf;
|
||||
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
|
||||
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
|
||||
fastcgi_param REQUEST_SCHEME $forwarded_scheme;
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
chmod 777 cache
|
||||
|
||||
echo "Installing Composer packages..."
|
||||
if [ -f .env ]; then
|
||||
composer install
|
||||
@ -20,11 +18,22 @@ echo "Installing Yarn packages..."
|
||||
echo "Migrating DB..."
|
||||
./mapg db:migrate
|
||||
|
||||
echo "Set runner user based on owner of .env..."
|
||||
if ! getent group mapg; then
|
||||
USER_GID=$(stat -c "%g" .env)
|
||||
groupadd --gid $USER_GID mapg
|
||||
fi
|
||||
if ! id -u mapg; then
|
||||
USER_UID=$(stat -c "%u" .env)
|
||||
useradd --uid $USER_UID --gid $USER_GID mapg
|
||||
fi
|
||||
sed -i -e "s/^user = .*$/user = mapg/g" -e "s/^group = .*$/group = mapg/g" /etc/php/8.1/fpm/pool.d/www.conf
|
||||
|
||||
set +e
|
||||
|
||||
/usr/sbin/php-fpm7.4 -F &
|
||||
/usr/sbin/php-fpm8.1 -F &
|
||||
/usr/sbin/nginx -g 'daemon off;' &
|
||||
/usr/bin/node --inspect=0.0.0.0:9229 multi &
|
||||
sudo -u mapg -g mapg /usr/bin/node --inspect=0.0.0.0:9229 multi &
|
||||
|
||||
wait -n
|
||||
|
||||
|
@ -8,12 +8,24 @@ echo "Migrating DB..."
|
||||
echo "Installing crontab..."
|
||||
/usr/bin/crontab docker/scripts/cron
|
||||
|
||||
echo "Set runner user based on owner of .env..."
|
||||
if ! getent group mapg; then
|
||||
USER_GID=$(stat -c "%g" .env)
|
||||
groupadd --gid $USER_GID mapg
|
||||
fi
|
||||
if ! id -u mapg; then
|
||||
USER_UID=$(stat -c "%u" .env)
|
||||
useradd --uid $USER_UID --gid $USER_GID mapg
|
||||
fi
|
||||
chown mapg:mapg cache
|
||||
sed -i -e "s/^user = .*$/user = mapg/g" -e "s/^group = .*$/group = mapg/g" /etc/php/8.1/fpm/pool.d/www.conf
|
||||
|
||||
set +e
|
||||
|
||||
/usr/sbin/cron -f &
|
||||
/usr/sbin/php-fpm7.4 -F &
|
||||
/usr/sbin/php-fpm8.1 -F &
|
||||
/usr/sbin/nginx -g 'daemon off;' &
|
||||
/usr/bin/node multi &
|
||||
sudo -u mapg -g mapg /usr/bin/node multi &
|
||||
|
||||
wait -n
|
||||
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
chmod 777 cache
|
||||
|
||||
echo "Installing Composer packages..."
|
||||
composer create-project --no-dev
|
||||
|
||||
@ -28,3 +26,5 @@ find public/static/img -type f -iname '*.svg' -exec svgo {} -o {} \;
|
||||
|
||||
echo "Linking view files..."
|
||||
./mapg view:link
|
||||
|
||||
rm .env
|
||||
|
38
multi/package-lock.json
generated
38
multi/package-lock.json
generated
@ -1,17 +1,43 @@
|
||||
{
|
||||
"name": "mapguesser-multi",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"dotenv": {
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mapguesser-multi",
|
||||
"license": "GNU AGPL 3.0",
|
||||
"dependencies": {
|
||||
"dotenv": "^8.2.0",
|
||||
"ws": "^7.4.4"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
|
||||
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw=="
|
||||
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"ws": {
|
||||
"node_modules/ws": {
|
||||
"version": "7.4.4",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz",
|
||||
"integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw=="
|
||||
"integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==",
|
||||
"engines": {
|
||||
"node": ">=8.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": "^5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user