Browse Source

new: [gogocarto] upgrade code to version ``3.4.10``

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
pull/29/head
Valentin Lab 2 years ago
parent
commit
8200afa024
  1. 28
      gogocarto/README.org
  2. 19
      gogocarto/hooks/mongo_database-relation-joined
  3. 14
      gogocarto/lib/common

28
gogocarto/README.org

@ -27,16 +27,18 @@ https://gitlab.adullact.net/pixelhumain/GoGoCarto
docker_tree_hash=$(git rev-parse HEAD:docker)
## Intermediate docker image is cached on docker.0k.io if needed
if ! docker pull docker.0k.io/gogocarto-builder:${docker_tree_hash}; then
make build &&
docker tag docker_gogocarto docker.0k.io/gogocarto-builder:${docker_tree_hash} &&
make docker-build &&
docker tag gogocarto_gogocarto:latest docker.0k.io/gogocarto-builder:${docker_tree_hash} &&
docker push docker.0k.io/gogocarto-builder:${docker_tree_hash}
else
docker tag docker.0k.io/gogocarto-builder:${docker_tree_hash} docker_gogocarto
docker tag docker.0k.io/gogocarto-builder:${docker_tree_hash} gogocarto_gogocarto:latest
fi
make up &&
docker-compose -f docker/docker-compose.yml exec gogocarto make init
docker-compose exec gogocarto make init
#+end_src
Last =make init= is building the actual code to be served.
** Full release is cached on =docker.0k.io/downloads=
This is the content of the source tree, once populated by =make init=.
@ -80,13 +82,25 @@ sed -ri "s/^(<\?php)/\1\n\ini_set('memory.limit', '1024M');/" \
web/index.php bin/console
sed -ri "s%dirname\(__DIR__\)\.'%'/opt/apps/gogocarto%g" \
web/index.php
sed -ri "s/gogocarto_default/'%env(MONGODB_DATABASE)%_default'/g" \
sed -ri "s/\"use_as_saas=%env\(resolve:USE_AS_SAAS\)%\/%env\(resolve:DATABASE_NAME\)%\"/'%env(resolve:DATABASE_NAME)%'/g" \
config/packages/doctrine_mongodb.yaml
## Add missing tags in git
git log --format="%H" -- config/parameters.yaml |
while read h; do
printf "%s\t%s\n" "$h" "$(git show $h:config/parameters.yaml |
grep version |
cut -f 2 -d ":" |
xargs echo)"
done | uniq -f 1 |
while read a b; do
git tag "$b" "$a" 2>/dev/null
done
commit_sha=$(git describe HEAD --tags)
tar cjv \
bin web vendor config src templates translations \
--exclude=.git --exclude=.gitignore \
--exclude=.git --exclude=.gitignore --exclude=.github \
--owner=root --group=root \
bin web vendor config src templates translations \
> gogocarto-${commit_sha}.tar.bz2
#+end_src

19
gogocarto/hooks/mongo_database-relation-joined

@ -28,13 +28,28 @@ DATABASE_NAME=$DBNAME
EOF
touch "$initing"
trap_add EXIT,ERR "rm -v \"$initing\""
if [ -e "$inited" ]; then
{
## This is required for migrating to 3.4.10 correctly
compose --debug mongosh "$SERVICE_NAME" <<EOF &&
db.Configuration.findOneAndUpdate(
{ dbName : null },
{ \$set: { "dbName" : "$DBNAME"} }
);
EOF
symphony db:migrate
} || {
err "Mongo database migration failed."
exit 1
}
exit 0
fi
## came from ``Makefile`` in git's gogocarto source code. Target load-fixtures.
touch "$initing"
trap_add EXIT,ERR "rm -v \"$initing\""
symphony doctrine:mongodb:schema:create &&
symphony doctrine:mongodb:generate:hydrators &&
symphony doctrine:mongodb:generate:proxies &&

14
gogocarto/lib/common

@ -2,7 +2,7 @@
GOGOCARTO_DIR="/opt/apps/gogocarto"
GOGOCARTO_CODE="$SERVICE_CONFIGSTORE$GOGOCARTO_DIR"
GOGOCARTO_RELEASE=3.1.3-56-g6b8ba361
GOGOCARTO_RELEASE=3.4.10
GOGOCARTO_URL=https://docker.0k.io/downloads/gogocarto-"${GOGOCARTO_RELEASE}".tar.bz2
@ -27,7 +27,7 @@ gogocarto:init() {
if [ "$current_version" != "$GOGOCARTO_RELEASE" ]; then
cd "${GOGOCARTO_CODE}" || return 1
if [ -d "$PWD"/.git ]; then
rm -rf "$PWD"/* "$PWD"/{.version,.inited-*,.env} || return 1
rm -rf "$PWD"/* "$PWD"/{.version,.env} || return 1
else
err "Can't find the '.git' directory in ${GOGOCARTO_CODE}."
return 1
@ -48,6 +48,7 @@ gogocarto:init() {
err "'git commit' failed."
return 1
}
rm -rf "$SERVICE_DATASTORE/var/cache/gogocarto/"*
fi
fi
}
@ -79,6 +80,7 @@ FILES_MAX_FILESIZE=1M # for other public file upload
###> vich upload ###
USE_AS_SAAS=false
USE_AS_SAAS_PRIVATE=false
CONTACT_EMAIL=contact@localhost.fr
INSTANCE_NAME=GoGoCarto
@ -89,6 +91,7 @@ INSTANCE_NAME=GoGoCarto
# Delivery is disabled by default via "null://localhost"
MAILER_URL=gmail://test.gogocarto:creerdescartesagogo@localhost
FROM_EMAIL=test.gogocarto@gmail.com
MAX_EMAIL_PER_HOUR=70
###< symfony/swiftmailer-bundle ###
###> hwi/oauth-bundle ###
@ -105,6 +108,13 @@ OAUTH_FACEBOOK_SECRET=disabled
# exple: SENTRY_DSN=https://6145d1aac36c429781fc1b0f79b0da48@sentry.io/1402018
SENTRY_DSN=
###< sentry/sentry-symfony ###
###> Matomo integration - see docs/matomo.md ###
MATOMO_URL=
MATOMO_SITE_ID=
MATOMO_USER_TOKEN=
###< Matomo ###
EOF
}

Loading…
Cancel
Save