Helix Swarm 2018.2 서버용 Helix Core 2017.1 서버에서 swarm-trigger를 설정하려고 하는데(둘 다 docker-compose를 사용하여 조정된 별도의 docker 컨테이너에 있음) 결과를 다음으로 파이프하려고 할 때 위의 오류가 발생 swarm-trigger.pl -o
합니다 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
원래 파이프된 명령도 동일한 오류로 인해 실패합니다.
/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
따라서 docker-compose
오류 로그:
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
실패한 파일은 p4 triggers -i
다음과 같습니다.
[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%"
나는 이것을 우리 프로덕션 Helix Core 서버의 결과와 비교했는데, 내가 볼 수 있는 유일한 차이점은 swarm-trigger.pl을 저장소에 넣지 않았다는 것입니다. 그러나 귀하의 지침에 따르면 이는 문제가 되지 않습니다(참조:6b단계)
답변1
문제는 다음과 같이 스트리밍되는 내용 p4 triggers -i
앞에만 포함된 줄을 추가하지 않았다는 것입니다 Triggers:
.
/root/swarm-trigger.pl -c /root/swarm-trigger.conf -o | sed '/^\s*#/d' | awk '{print "Triggers:" $0;}' | p4 triggers -i
단순히 Perforce 트리거에 추가하는 것은 불가능하므로 다음과 같이 해야 합니다.
p4 triggers -o > tmp
/root/swarm-trigger.pl -c /root/swarm-trigger.conf -o | sed '/^\s*#/d' >> tmp
p4 triggers -i < tmp