Capistrano/Git not recognising checkout -B flag unless logged in via ssh - wordpress

I'm trying to use capistrano to deploy a wordpress site to my account on dreamhost.
For the most part capistrano seems to be working. Here's the output from cap dev git:check
$ cap dev git:check
INFO [1cd5c6b7] Running /usr/bin/env mkdir -p /home/parisstilton/tmp/theparisstilton.com/ on theparisstilton.com
DEBUG [1cd5c6b7] Command: /usr/bin/env mkdir -p /home/parisstilton/tmp/theparisstilton.com/
INFO [1cd5c6b7] Finished in 1.895 seconds with exit status 0 (successful).
DEBUG Uploading /home/parisstilton/tmp/theparisstilton.com/git-ssh.sh 0.0%
INFO Uploading /home/parisstilton/tmp/theparisstilton.com/git-ssh.sh 100.0%
INFO [4ede30ed] Running /usr/bin/env chmod +x /home/parisstilton/tmp/theparisstilton.com/git-ssh.sh on theparisstilton.com
DEBUG [4ede30ed] Command: /usr/bin/env chmod +x /home/parisstilton/tmp/theparisstilton.com/git-ssh.sh
INFO [4ede30ed] Finished in 0.317 seconds with exit status 0 (successful).
INFO [8d47d9d7] Running /usr/bin/env mkdir -p /home/parisstilton/tmp/theparisstilton.com/ on theparisstilton.com
DEBUG [8d47d9d7] Command: /usr/bin/env mkdir -p /home/parisstilton/tmp/theparisstilton.com/
INFO [8d47d9d7] Finished in 1.668 seconds with exit status 0 (successful).
DEBUG Uploading /home/parisstilton/tmp/theparisstilton.com/git-ssh.sh 0.0%
INFO Uploading /home/parisstilton/tmp/theparisstilton.com/git-ssh.sh 100.0%
INFO [1aacdb9a] Running /usr/bin/env chmod +x /home/parisstilton/tmp/theparisstilton.com/git-ssh.sh on theparisstilton.com
DEBUG [1aacdb9a] Command: /usr/bin/env chmod +x /home/parisstilton/tmp/theparisstilton.com/git-ssh.sh
INFO [1aacdb9a] Finished in 0.266 seconds with exit status 0 (successful).
DEBUG [bd5cfd74] Running /usr/bin/env git ls-remote git#bitbucket.org:sentur/partisstilton.git on theparisstilton.com
DEBUG [bd5cfd74] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/home/parisstilton/tmp/theparisstilton.com/git-ssh.sh /usr/bin/env git ls-remote git#bitbucket.org:sentur/partisstilton.git )
DEBUG [bd5cfd74] 5cadb90b1a5d4bbe59c2eb8e3f3e108f49b98fd0 HEAD
DEBUG [bd5cfd74] 9451025272b2a594ffc2af259bfce50c66ff15fc refs/heads/dev
DEBUG [bd5cfd74] 5cadb90b1a5d4bbe59c2eb8e3f3e108f49b98fd0 refs/heads/master
DEBUG [bd5cfd74] Finished in 2.722 seconds with exit status 0 (successful).
DEBUG [baacc1b3] Running /usr/bin/env git ls-remote git#bitbucket.org:sentur/partisstilton.git on theparisstilton.com
DEBUG [baacc1b3] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/home/parisstilton/tmp/theparisstilton.com/git-ssh.sh /usr/bin/env git ls-remote git#bitbucket.org:sentur/partisstilton.git )
DEBUG [baacc1b3] 5cadb90b1a5d4bbe59c2eb8e3f3e108f49b98fd0 HEAD
DEBUG [baacc1b3] 9451025272b2a594ffc2af259bfce50c66ff15fc refs/heads/dev
DEBUG [baacc1b3] 5cadb90b1a5d4bbe59c2eb8e3f3e108f49b98fd0 refs/heads/master
DEBUG [baacc1b3] Finished in 2.724 seconds with exit status 0 (successful).
When I deploy using the following code bundle exec cap dev deploy ( http://pastebin.com/fCWRjEyv ), capistrano fails at
DEBUG [e6f95da6] Command: cd /home/parisstilton/dev.theparisstilton.com/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/home/parisstilton/tmp/theparisstilton.com/git-ssh.sh /usr/bin/env git checkout -B 20140806215353 origin/dev )
DEBUG [e6f95da6] error: unknown switch `B'
DEBUG [e6f95da6] usage: git checkout [options] <branch>
DEBUG [e6f95da6] or: git checkout [options] [<branch>] -- <file>...
However if I ssh into the dreamhost server and run the same command it works fine recognising the git checkout -B flag. I suspect that this may be because I have installed a more recent version of git (2.0.4) in my ~/packages/bin/ which is in my $PATH. Where as the default git on Dreamhost is git version 1.7.2.5.
[beehive]$ cd /home/parisstilton/dev.theparisstilton.com/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/home/parisstilton/tmp/theparisstilton.com/git-ssh.sh /usr/bin/env git checkout -B 20140806215353 origin/dev )
Branch 20140806215353 set up to track remote branch dev from origin.
Switched to a new branch '20140806215353'

I managed to find a simple solution (though not sure if it's right, it works for me).
Editing the ~/.bashrc file to update $PATH as this is run by non-interactive shells where as ~/.bash_profile where I had originally updated my $PATH, is only run by bash on interactive shell login.
So here's the code.
$nano ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
#add ~/packages/bin installed apps/git to $PATH
export PATH=~/packages/bin:$PATH

Related

How to not show wordpress installation page at first time?

I'm building a website using docker-compose and 3 docker containers (mariadb/nginx/wordpress) and I want to install wordpress in a script, so my wordpress Dockerfile looks like this
from debian:buster
run apt-get update -y;\
apt-get install -y curl mariadb-client\
php php7.3 php7.3-fpm php7.3-mysql php-common php7.3-cli\
php7.3-common php7.3-json php7.3-opcache php7.3-readline\
php-curl php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc\
php-zip
run mkdir -p /var/www/html;\
cd /var/www/html
add conf/php-fpm.conf /etc/php/7.3/fpm/pool.d/www.conf
add conf/init_wp.sh /tmp
run mkdir -p /var/run /run/php
run curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
run chmod +x wp-cli.phar
run mv wp-cli.phar /usr/local/bin/wp
workdir /var/www/html
run wp core download --allow-root
run chown -R www-data:www-data /var/www/html
cmd [ "sh", "/tmp/init_wp.sh" ]
and my entrypoint script looks like this
FILE=/var/www/html/.exist
if [ ! -f "$FILE" ]
then
echo "Setting up wordpress"
rm -rf /var/www/html/wp-config.php
wp config create --dbname=$DB_NAME --dbuser=$WP_USER --dbpass=$WP_PASSWORD --dbhost="mariadb" --path="/var/www/html/" --allow-root --skip-check
wp core install --url="localhost" --title="inception" --admin_user=$ADMIN_USER --admin_password=$ADMIN_PASSWORD --admin_email=$ADMIN_EMAIL --path="/var/www/html/" --allow-root
wp user create testuser testuser#student.42.fr --role=author --user_pass="abc123" --allow-root
touch /var/www/html/.exist
fi
echo "Wordpress setup done"
exec php-fpm7.3 -F -R
but when I load the website for the first time I still get redirected to the wordpress installation page, shouldn't wp config create and wp core install do this for me ?
What did I do wrong?
mariadb works fine after the wordpress installation so the problem doesn't seem to come from here, so am I missing an element in the install script ?

Unable to install symfony/serializer in Symfony 4.4

composer require symfony/serializer
returns:
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In Definition.php line 288:
!!
!! Cannot replace arguments if none have been configured yet.
!!
!!
!!
Script #auto-scripts was called via post-update-cmd
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Has anyone ever seen this error? I've been debugging for hours, no result. The project is very identical to the Symfony 4.4 boilerplate project and the services seem to be fine. I'm currently debugging since hours, as i heavily depend on the rest bundles and serializers, to get the project up and working.
Thank you!
EDIT: services.yml, i checked with the boilerplate example from symfony, and cant find any differences in config files.
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../src/'
exclude:
- '../src/DependencyInjection/'
- '../src/Entity/'
- '../src/Kernel.php'
- '../src/Tests/'
# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller/'
tags: ['controller.service_arguments']
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones
EDIT: Here is the snippet from -vvv, interestingly it occurs too if i try serializer-pack, until the composer file is cleaned, no work can be done.
Running 2.1.9 (2021-10-05 09:47:38) with PHP 7.4.25 on Darwin / 21.4.0
Reading ./composer.json (/Users/christofjori/Desktop/Projects/bon-api/composer.json)
Loading config file /Users/christofjori/.composer/auth.json
Loading config file ./composer.json (/Users/christofjori/Desktop/Projects/bon-api/composer.json)
Checked CA file /opt/homebrew/etc/ca-certificates/cert.pem: valid
Executing command (/Users/christofjori/Desktop/Projects/bon-api): git branch -a --no-color --no-abbrev -v
Executing command (/Users/christofjori/Desktop/Projects/bon-api): git rev-list master..development
Executing command (/Users/christofjori/Desktop/Projects/bon-api): git rev-list remotes/origin/master..development
Executing command (/Users/christofjori/Desktop/Projects/bon-api): git rev-list remotes/origin/4.4_migration..development
Failed to initialize global composer: Composer could not find the config file: /Users/christofjori/.composer/composer.json
Reading /Users/christofjori/Desktop/Projects/bon-api/vendor/composer/installed.json
Loading plugin PackageVersions\Installer (from composer/package-versions-deprecated)
Loading plugin Symfony\Flex\Flex (from symfony/flex)
Reading /Users/christofjori/Library/Caches/composer/repo/flex/symfony-recipes-flex-main-index.json from cache
Reading /Users/christofjori/Library/Caches/composer/repo/flex/symfony-recipes-contrib-flex-main-index.json from cache
Downloading https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json
Downloading https://raw.githubusercontent.com/symfony/recipes-contrib/flex/main/index.json
[304] https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json
[304] https://raw.githubusercontent.com/symfony/recipes-contrib/flex/main/index.json
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git rev-parse --git-dir
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git remote -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git remote set-url origin -- 'https://git.incert.at/libaries/core.git' && git remote update --prune origin && git remote set-url origin -- 'https://git.incert.at/libaries/core.git' && git gc --auto
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git show-ref --tags --dereference
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git branch --no-color --no-abbrev -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git branch --no-color
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git show 'master':'composer.json'
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git -c log.showSignature=false log -1 --format=%at 'master'
Reading composer.json of incert/core (1.52)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-core.git/ccb15c4498a0ddde03845dabd9de8aa0ff12365f from cache
Importing tag 1.52 (1.52.0.0)
Reading composer.json of incert/core (master)
Importing branch master (dev-master)
Reading composer.json of incert/core (master1)
Importing branch master1 (dev-master1)
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git rev-parse --git-dir
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git remote -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git remote set-url origin -- 'https://git.incert.at/libaries/doctrine-rql' && git remote update --prune origin && git remote set-url origin -- 'https://git.incert.at/libaries/doctrine-rql' && git gc --auto
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git show-ref --tags --dereference
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git branch --no-color --no-abbrev -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git branch --no-color
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git show 'master':'composer.json'
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git -c log.showSignature=false log -1 --format=%at 'master'
Reading composer.json of incert/doctrine-rql (1.21)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-doctrine-rql/688d4dec384efbc48f056430136ebc2a65e2ffff from cache
Importing tag 1.21 (1.21.0.0)
Reading composer.json of incert/doctrine-rql (master)
Importing branch master (dev-master)
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git rev-parse --git-dir
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git remote -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git remote set-url origin -- 'https://git.incert.at/libaries/rql-parser54' && git remote update --prune origin && git remote set-url origin -- 'https://git.incert.at/libaries/rql-parser54' && git gc --auto
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git show-ref --tags --dereference
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git branch --no-color --no-abbrev -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git branch --no-color
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git show 'master':'composer.json'
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git -c log.showSignature=false log -1 --format=%at 'master'
Reading composer.json of incert/rql-parser54 (1.0)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-rql-parser54/785f29f1987974968e3730daba20b859bdf3e976 from cache
Importing tag 1.0 (1.0.0.0)
Reading composer.json of incert/rql-parser54 (1.01)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-rql-parser54/401f12fde384d308f827bc63e58a110f4f63493d from cache
Importing tag 1.01 (1.01.0.0)
Reading composer.json of incert/rql-parser54 (master)
Importing branch master (dev-master)
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git rev-parse --git-dir
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git remote -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git remote set-url origin -- 'https://git.incert.at/libaries/log-explorer-client-php' && git remote update --prune origin && git remote set-url origin -- 'https://git.incert.at/libaries/log-explorer-client-php' && git gc --auto
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git show-ref --tags --dereference
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git branch --no-color --no-abbrev -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git branch --no-color
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git show 'master':'composer.json'
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git -c log.showSignature=false log -1 --format=%at 'master'
Reading composer.json of incert/log-explorer-client-php (1.0)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-log-explorer-client-php/ca8f8385c20ccb3aeb2d042f0a20923ca6b4804d from cache
Importing tag 1.0 (1.0.0.0)
Reading composer.json of incert/log-explorer-client-php (1.01)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-log-explorer-client-php/0e14852d472050699cddb5e70dee9f9ff67ea49c from cache
Importing tag 1.01 (1.01.0.0)
Reading composer.json of incert/log-explorer-client-php (1.02)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-log-explorer-client-php/091d2cf864b1cf5a5970f7d49a713568eab077f0 from cache
Importing tag 1.02 (1.02.0.0)
Reading composer.json of incert/log-explorer-client-php (1.03)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-log-explorer-client-php/be64766d9a7a4d50c6f6203c4665f585d5e61749 from cache
Importing tag 1.03 (1.03.0.0)
Reading composer.json of incert/log-explorer-client-php (1.04)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-log-explorer-client-php/60354cae3b148201b47d4b2440c02939a6304e7a from cache
Importing tag 1.04 (1.04.0.0)
Reading composer.json of incert/log-explorer-client-php (1.041)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-log-explorer-client-php/1296c0c5a1fe9e464fdd828c497f0ff53395789b from cache
Importing tag 1.041 (1.041.0.0)
Reading composer.json of incert/log-explorer-client-php (master)
Importing branch master (dev-master)
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Info from https://repo.packagist.org: #StandWithUkraine
Writing /Users/christofjori/Library/Caches/composer/repo/https---repo.packagist.org/packages.json into cache
Reading /Users/christofjori/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~serializer.json from cache
Downloading https://repo.packagist.org/p2/symfony/serializer.json if modified
Reading /Users/christofjori/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~serializer~dev.json from cache
Downloading https://repo.packagist.org/p2/symfony/serializer~dev.json if modified
[304] https://repo.packagist.org/p2/symfony/serializer.json
[304] https://repo.packagist.org/p2/symfony/serializer~dev.json
./composer.json has been updated
Reading ./composer.json (/Users/christofjori/Desktop/Projects/bon-api/composer.json)
Loading config file /Users/christofjori/.composer/auth.json
Loading config file ./composer.json (/Users/christofjori/Desktop/Projects/bon-api/composer.json)
Executing command (/Users/christofjori/Desktop/Projects/bon-api): git branch -a --no-color --no-abbrev -v
Executing command (/Users/christofjori/Desktop/Projects/bon-api): git rev-list master..development
Executing command (/Users/christofjori/Desktop/Projects/bon-api): git rev-list remotes/origin/master..development
Executing command (/Users/christofjori/Desktop/Projects/bon-api): git rev-list remotes/origin/4.4_migration..development
Failed to initialize global composer: Composer could not find the config file: /Users/christofjori/.composer/composer.json
Reading /Users/christofjori/Desktop/Projects/bon-api/vendor/composer/installed.json
Loading plugin PackageVersions\Installer_composer_tmp0 (from composer/package-versions-deprecated)
Loading plugin Symfony\Flex\Flex_composer_tmp1 (from symfony/flex)
Reading /Users/christofjori/Library/Caches/composer/repo/flex/symfony-recipes-flex-main-index.json from cache
Reading /Users/christofjori/Library/Caches/composer/repo/flex/symfony-recipes-contrib-flex-main-index.json from cache
Downloading https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json
Downloading https://raw.githubusercontent.com/symfony/recipes-contrib/flex/main/index.json
[304] https://raw.githubusercontent.com/symfony/recipes-contrib/flex/main/index.json
[304] https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json
Running composer update symfony/serializer
Reading ./composer.lock (/Users/christofjori/Desktop/Projects/bon-api/composer.lock)
> pre-update-cmd: Symfony\Flex\Flex_composer_tmp1->configureInstaller
Loading composer repositories with package information
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git rev-parse --git-dir
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git remote -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git remote set-url origin -- 'https://git.incert.at/libaries/core.git' && git remote update --prune origin && git remote set-url origin -- 'https://git.incert.at/libaries/core.git' && git gc --auto
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git show-ref --tags --dereference
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git branch --no-color --no-abbrev -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git branch --no-color
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git show 'master':'composer.json'
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-core.git/): git -c log.showSignature=false log -1 --format=%at 'master'
Reading composer.json of incert/core (1.52)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-core.git/ccb15c4498a0ddde03845dabd9de8aa0ff12365f from cache
Importing tag 1.52 (1.52.0.0)
Reading composer.json of incert/core (master)
Importing branch master (dev-master)
Reading composer.json of incert/core (master1)
Importing branch master1 (dev-master1)
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git rev-parse --git-dir
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git remote -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git remote set-url origin -- 'https://git.incert.at/libaries/doctrine-rql' && git remote update --prune origin && git remote set-url origin -- 'https://git.incert.at/libaries/doctrine-rql' && git gc --auto
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git show-ref --tags --dereference
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git branch --no-color --no-abbrev -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git branch --no-color
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git show 'master':'composer.json'
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-doctrine-rql/): git -c log.showSignature=false log -1 --format=%at 'master'
Reading composer.json of incert/doctrine-rql (1.21)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-doctrine-rql/688d4dec384efbc48f056430136ebc2a65e2ffff from cache
Importing tag 1.21 (1.21.0.0)
Reading composer.json of incert/doctrine-rql (master)
Importing branch master (dev-master)
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git rev-parse --git-dir
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git remote -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git remote set-url origin -- 'https://git.incert.at/libaries/rql-parser54' && git remote update --prune origin && git remote set-url origin -- 'https://git.incert.at/libaries/rql-parser54' && git gc --auto
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git show-ref --tags --dereference
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git branch --no-color --no-abbrev -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git branch --no-color
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git show 'master':'composer.json'
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-rql-parser54/): git -c log.showSignature=false log -1 --format=%at 'master'
Reading composer.json of incert/rql-parser54 (1.0)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-rql-parser54/785f29f1987974968e3730daba20b859bdf3e976 from cache
Importing tag 1.0 (1.0.0.0)
Reading composer.json of incert/rql-parser54 (1.01)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-rql-parser54/401f12fde384d308f827bc63e58a110f4f63493d from cache
Importing tag 1.01 (1.01.0.0)
Reading composer.json of incert/rql-parser54 (master)
Importing branch master (dev-master)
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git rev-parse --git-dir
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git remote -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git remote set-url origin -- 'https://git.incert.at/libaries/log-explorer-client-php' && git remote update --prune origin && git remote set-url origin -- 'https://git.incert.at/libaries/log-explorer-client-php' && git gc --auto
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git show-ref --tags --dereference
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git branch --no-color --no-abbrev -v
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git branch --no-color
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git show 'master':'composer.json'
Executing command (/Users/christofjori/Library/Caches/composer/vcs/https---git.incert.at-libaries-log-explorer-client-php/): git -c log.showSignature=false log -1 --format=%at 'master'
Reading composer.json of incert/log-explorer-client-php (1.041)
Reading /Users/christofjori/Library/Caches/composer/repo/https---git.incert.at-libaries-log-explorer-client-php/1296c0c5a1fe9e464fdd828c497f0ff53395789b from cache
Importing tag 1.041 (1.041.0.0)
Reading composer.json of incert/log-explorer-client-php (master)
Importing branch master (dev-master)
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Info from https://repo.packagist.org: #StandWithUkraine
Writing /Users/christofjori/Library/Caches/composer/repo/https---repo.packagist.org/packages.json into cache
Reading /Users/christofjori/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~serializer.json from cache
Downloading https://repo.packagist.org/p2/symfony/serializer.json if modified
[304] https://repo.packagist.org/p2/symfony/serializer.json
> pre-pool-create: Symfony\Flex\Flex_composer_tmp1->truncatePackages
Updating dependencies
Generating rules
Resolving dependencies through SAT
Looking at all rules.
Dependency resolution completed in 0.001 seconds
Analyzed 260 packages to resolve dependencies
Analyzed 656 rules to resolve dependencies
Generating rules
Resolving dependencies through SAT
Looking at all rules.
Dependency resolution completed in 0.000 seconds
Lock file operations: 1 install, 0 updates, 0 removals
Installs: symfony/serializer:v4.4.41
- Locking symfony/serializer (v4.4.41)
Writing lock file
Installing dependencies from lock file (including require-dev)
Reading ./composer.lock (/Users/christofjori/Desktop/Projects/bon-api/composer.lock)
> pre-operations-exec: Symfony\Flex\Flex_composer_tmp1->recordOperations
Package operations: 1 install, 0 updates, 0 removals
Installs: symfony/serializer:v4.4.41
Reading /Users/christofjori/Library/Caches/composer/files/symfony/serializer/6fa9ff63c92acff28fbdaf7744e7bb64fefcbebe.zip from cache
- Loading symfony/serializer (v4.4.41) from cache
- Installing symfony/serializer (v4.4.41): Extracting archive
Executing async command (CWD): '/usr/bin/unzip' -qq '/Users/christofjori/Desktop/Projects/bon-api/vendor/composer/tmp-a61c55d8c539df185725083347debffb' -d '/Users/christofjori/Desktop/Projects/bon-api/vendor/composer/3247dc55'
Executing async command (CWD): rm -rf '/Users/christofjori/Desktop/Projects/bon-api/vendor/composer/3247dc55'
> post-package-install: Symfony\Flex\Flex_composer_tmp1->recordFlexInstall
Downloading https://packagist.org/downloads/
[201] https://packagist.org/downloads/
Package doctrine/doctrine-cache-bundle is abandoned, you should avoid using it. No replacement was suggested.
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package symfony/inflector is abandoned, you should avoid using it. Use EnglishInflector from the String component instead.
Generating autoload files
> post-autoload-dump: PackageVersions\Installer_composer_tmp0->dumpVersionsClass
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
99 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> post-update-cmd: Symfony\Flex\Flex_composer_tmp1->update
Run composer recipes at any time to see the status of your Symfony recipes.
> post-update-cmd: #auto-scripts
> auto-scripts: Symfony\Flex\Flex_composer_tmp1->executeAutoScripts
Executing script cache:clear
Executed script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In Definition.php line 288:
!!
!! Cannot replace arguments if none have been configured yet.
!!
!!
!!
Script #auto-scripts was called via post-update-cmd
Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Using Symfony Doctrine Migrations with Gitlab CI: GitLab CI interprets "Nothing to migrate" as error

We are using the Doctrine migrations bundle for update database in our deployment process. Currently, we are switching to Gitlab-CI.
The problem: The CI is aborting the deployment process because the output of command php sf doctrine:migrations:diff contains stderr.
The part of our .gitlab-ci.yml:
deploy_live:
type: deploy
environment:
name: live
url: 1.2.3.4
script:
- ssh root#1.2.3.4 "cd /var/www/html/ && git pull origin master && exit"
- ssh root#11.2.3.4 "cd /var/www/html/ && composer install -n && exit"
- ssh root#1.2.3.4 "cd /var/www/html/ && php sf doctrine:migrations:diff --env=prod && exit"
- ssh root#1.2.3.4 "cd /var/www/html/ && php sf doctrine:migrations:migrate -n --env=prod && exit"
- 'ssh root#1.2.3.4 "cd /var/www/html/ && chown www-data:www-data . -R && exit"'
only:
- master
Output of Gitlab CI:
$ ssh root#1.2.3.4 "cd /var/www/html/ && php sf doctrine:migrations:diff --env=prod && exit"
#!/usr/bin/env php
In NoChangesDetected.php line 13:
No changes detected in your mapping information.
doctrine:migrations:diff [--configuration [CONFIGURATION]] [--db-configuration [DB-CONFIGURATION]] [--editor-cmd [EDITOR-CMD]] [--filter-expression [FILTER-EXPRESSION]] [--formatted] [--line-length [LINE-LENGTH]] [--check-database-platform [CHECK-DATABASE-PLATFORM]] [--db DB] [--em [EM]] [--shard SHARD] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
ERROR: Job failed: exit code 1
This may be a bug, but maybe it can be circumvented?
FYI: sf is a symlink to bin/console.
I just found a solution:
move the commands excecuted directly from the gitlab-ci.yml file unter script to an shell script deploy.sh
move this script via scp to the server
gitlab-ci.yml
deploy_live:
type: deploy
environment:
name: live
url: 1.2.3.4
script:
- scp deploy.sh root#1.2.3.4:/var/www/html/
- ssh root#1.2.3.4 "cd /var/www/html/ && chmod +x deploy.sh && ./deploy.sh && exit"
only:
- master
deploy.sh
cd /var/www/html/
git add --all
git commit -m "changes"
git pull origin master
composer install -n
php sf doctrine:cache:clear-metadata --env=prod
php sf doctrine:migrations:diff --env=prod
php sf doctrine:migrations:migrate -n --env=prod
php sf cache:clear --env=prod
exit
They added option for such case: --allow-no-migration - can you try it?
see: https://github.com/doctrine/migrations/blob/ebd2551c7767375fcbc762b48d7dee4c18ceae97/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php#L64

Docker and Analytics Install

I have a docker file called quasar.dockerfile. I built the docker file and everything loaded successfully.
#quasar.dockerfile
FROM java:8
WORKDIR /app
ADD docker/quasar-config.json quasar-config.json
RUN apt-get update && \
apt-get install -y wget && \
wget https://github.com/quasar-analytics/quasar/releases/download/v2.3.3-SNAPSHOT-2121-web/web_2.11-2.3.3-SNAPSHOT-one-jar.jar
EXPOSE 8080
CMD java -jar web_2.11-2.2.3-SNAPSHOT-one-jar.jar -c /app/quasar-config.json
I then tried running the docker and I get this error saying that I am unable to access the jarfile.
[test]$ docker build -f docker/quasar.dockerfile -t quasar_fdw_test/quasar .
Sending build context to Docker daemon 1.851 MB
Successfully built a7d4bc6c906f
[test]$ docker run -d --name quasar_fdw_test-quasar --link quasar_fdw_test-mongodb:mongodb quasar_fdw_test/quasar
6af2f58bf446560507bdf4a2db8ba138de9ed94a408492144e7fdf6c1fe05118
[test]$ docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6af2f58bf446 quasar_fdw_test/quasar "/bin/sh -c 'java -ja" 5 seconds ago Exited (1) 4 seconds ago quasar_fdw_test- quasar
[test]$ docker logs 6af2f58bf446
Error: Unable to access jarfile web_2.11-2.2.3-SNAPSHOT-one-jar.jar
How come the process keeps getting killed? Seems like it has to do with being unable to run the jarfile but the build needed to access that file and happened successfully. Is this a linking issue?
Try to use full path on Dockerfile
CMD java -jar /web_2.11-2.2.3-SNAPSHOT-one-jar.jar -c /app/quasar-config.json

Unable to install Sylius with Composer

With composer, i tried to install Sylius via sylius/sylius and sylius/sylius-standard.
Installations have both ended like this :
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command.
It happens just after the parameters.ini initialization.
And after, the command line doesn't work (example : "app/console list" return nothing) although I'm in the project root directory.
Any idea, please ? Thanks.
I've gotten this error ( I'm not sure if it's the same place where your getting it ) and developed a solution that seems to work. Instead of running app/console cache:clear ( which I think gets run at the end of the composer install ), I run a bash script that opens the permissions before and after.
sudo sh clearCache
Contents of clearCache:
#!/bin/bash
chmod -R 777 app/cache/ app/logs/
su www-data -c "app/console cache:clear -e dev"
chmod -R 777 app/cache/ app/logs/
su www-data -c "app/console cache:clear -e prod"
chmod -R 777 app/cache/ app/logs/
I think I got this message during a composer install and was still able to continue via cd Sylius and app/console sylius:install. Just run this before and after installing and updates.

Resources