Estoy intentando configurar activadores de enjambre en un servidor Helix Core 2017.1 para un servidor Helix Swarm 2018.2 (ambos en contenedores acoplables separados orquestados mediante docker-compose) pero recibo el error anterior cuando intento canalizar los resultados de swarm-trigger.pl -o
a p4 triggers -i
:
# both with and without config file -c fails
/root/swarm-trigger.pl -c /root/swarm-trigger.conf -o > /root/generated_triggers.txt
# Tried both with and without the %quote% parts, stripped out using sed.
#sed -i -e 's/%quote//g' -e 's/%%/%/g' /root/generated_triggers.txt
sed '/^\s*#/d' -i /root/generated_triggers.txt
cat /root/generated_triggers.txt | p4 triggers -i
Mis comandos canalizados originales también fallan con el mismo error:
/root/swarm-trigger.pl -c /root/swarm-trigger.conf -o | sed -e 's/%quote//g' -e 's/%%/%/g' | sed '/^\s*#/d' | p4 triggers -i
/root/swarm-trigger.pl -c /root/swarm-trigger.conf -o | sed '/^\s*#/d' | p4 triggers -i
Entonces docker-compose
registro de errores:
perforce | + sed '/^\s*#/d'
perforce | + /root/swarm-trigger.pl -c /root/swarm-trigger.conf -o
perforce | + p4 triggers -i
perforce | Error in triggers specification.
perforce | Error detected at line 1.
perforce | Syntax error in 'swarm.job'.
perforce | /run.sh exited 1
Aquí está el archivo que p4 triggers -i
falla:
[root@9877302137d8 /]# cat /root/generated_triggers.txt
swarm.job form-commit job "%quote%/root/swarm-trigger.pl%quote% -c %quote%/root/swarm-trigger.conf%quote% -t job -v %formname%"
swarm.user form-commit user "%quote%/root/swarm-trigger.pl%quote% -c %quote%/root/swarm-trigger.conf%quote% -t user -v %formname%"
swarm.userdel form-delete user "%quote%/root/swarm-trigger.pl%quote% -c %quote%/root/swarm-trigger.conf%quote% -t userdel -v %formname%"
swarm.group form-commit group "%quote%/root/swarm-trigger.pl%quote% -c %quote%/root/swarm-trigger.conf%quote% -t group -v %formname%"
swarm.groupdel form-delete group "%quote%/root/swarm-trigger.pl%quote% -c %quote%/root/swarm-trigger.conf%quote% -t groupdel -v %formname%"
swarm.changesave form-save change "%quote%/root/swarm-trigger.pl%quote% -c %quote%/root/swarm-trigger.conf%quote% -t changesave -v %formname%"
swarm.shelve shelve-commit //... "%quote%/root/swarm-trigger.pl%quote% -c %quote%/root/swarm-trigger.conf%quote% -t shelve -v %change%"
swarm.commit change-commit //... "%quote%/root/swarm-trigger.pl%quote% -c %quote%/root/swarm-trigger.conf%quote% -t commit -v %change%"
swarm.shelvedel shelve-delete //... "%quote%/root/swarm-trigger.pl%quote% -c %quote%/root/swarm-trigger.conf%quote% -t shelvedel -v %change% -w %client% -u %user% -d %quote%%clientcwd%%quote% -a %quote%%argsQuoted%%quote% -s %quote%%serverVersion%%quote%"
Comparé esto con los resultados de nuestro servidor Helix Core de producción y la única diferencia que puedo ver es que no puse mi swarm-trigger.pl en un depósito. Sin embargo, en sus instrucciones, esto no es problemático (verpaso 6b)
Respuesta1
El problema fue que no antepuse el contenido que se estaba transmitiendo p4 triggers -i
con una línea que contuviera solo Triggers:
, así:
/root/swarm-trigger.pl -c /root/swarm-trigger.conf -o | sed '/^\s*#/d' | awk '{print "Triggers:" $0;}' | p4 triggers -i
No es posible simplemente agregar a los activadores de Perforce, por lo que se debe hacer algo como esto:
p4 triggers -o > tmp
/root/swarm-trigger.pl -c /root/swarm-trigger.conf -o | sed '/^\s*#/d' >> tmp
p4 triggers -i < tmp