2017-12-20 22 views
0

내가 fastlane를 사용 jenkins으로 .ipa 컬하려고했지만 :에패스트 레인 및 셸 스크립트. 내 스크립트에 실패 (18) 대신에 0

'chmod +x ./publish.sh; ./publish.sh;' was 18 instead of 0. (FastlaneCore::Interface::FastlaneShellError) 
Uploading: ./../MobileApp.ipa 

Fastfile : 여기

sh('chmod +x ./publish.sh; ./publish.sh;')

가의 내용입니다 내 스크립트 :

#!/bin/bash -e 

upload() { 
    for file in ./../*.ipa; do 
    echo "Uploading: $file" 
    response=$(
    curl -u $PUBLISH_USER:$PUBLISH_PASS -T $file http://example.com/ios-dev-local/ \ 
     --write-out %{http_code} \ 
     --silent \ 
     --output /dev/null \ 
) 
    done 
} 

upload; 

if [ "$response" -gt 400 ]; 
then 
    echo "bounce with status $response" 
    exit 1; 
fi; 

다음은 전체 스택 트레이스입니다.

from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane_core/lib/fastlane_core/ui/ui.rb:14:in `method_missing' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/helper/sh_helper.rb:75:in `sh_control_output' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/helper/sh_helper.rb:16:in `sh_no_action' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/fast_file.rb:184:in `block in sh' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/fast_file.rb:183:in `sh' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/fast_file.rb:178:in `sh' 
from Fastfile:68:in `block (2 levels) in parsing_binding' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/lane.rb:33:in `call' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/lane.rb:33:in `call' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/runner.rb:49:in `block in execute' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/runner.rb:45:in `chdir' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/runner.rb:45:in `execute' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/command_line_handler.rb:34:in `handle' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/commands_generator.rb:104:in `block (2 levels) in run' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/commander-fastlane-4.4.5/lib/commander/command.rb:178:in `call' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/commander-fastlane-4.4.5/lib/commander/command.rb:178:in `call' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/commander-fastlane-4.4.5/lib/commander/command.rb:153:in `run' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/commander-fastlane-4.4.5/lib/commander/runner.rb:476:in `run_active_command' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:66:in `run!' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/commander-fastlane-4.4.5/lib/commander/delegates.rb:15:in `run!' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/commands_generator.rb:343:in `run' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/commands_generator.rb:42:in `start' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/fastlane/lib/fastlane/cli_tools_distributor.rb:75:in `take_off' 
from /Users/myUser/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.69.2/bin/fastlane:20:in `<top (required)>' 
from /Users/myUser/.fastlane/bin/bundle/bin/fastlane:22:in `load' 
from /Users/myUser/.fastlane/bin/bundle/bin/fastlane:22:in `<main>' 
Build step 'Execute shell' marked build as failure 

내가받은 18 개의 오류 코드와 그 이유는 누구에게 설명 할 수 있습니까?

답변

1

그 값은 명령 행에서 반환되는 값입니다. 난 당신이 아무 문제없이 손으로 정확히 실행하려고했다고 가정합니다. 보통 셸 명령에서 오류가 발생하면 오류가 발생하기 전에 셸 출력도 함께 표시됩니다. 그것이 왜 실패하고 있는지에 관해서는 뭐라 말합니까? 이 성공하지 못하면 chmod +x ./publish.sh && ./publish.sh을 시도해 스크립트를 실행하지 않았습니까?

그 중 어느 것도 도움이되지 않으면

, 내가 추가 조사를 이런 식으로 뭔가를 시도하는 것이 좋습니다 :

sh "chmod", "+x", "./publish.sh" do |status, output, command| 
    unless status.success? 
    UI.user_error! "#{command} failed with status #{status.exitstatus}. Output was #{output}" 
    end 

    sh "./publish.sh" do |status, output, command| 
    unless status.success? 
     UI.user_error! "#{command} failed with status #{status.exitstatus}. Output was #{output}" 
    end 
    end 
end 

이것은 당신이 실패하는 방법 sh 오류 처리 작업 된 것만 볼 수 있도록 단지입니다. 나는 명령의 출력이 당신에게 오류를 보여 주어야한다고 생각한다. 그리고 당신은 이미 이러한 변화없이 그것을 가질 수 있습니다. 또한

, 더에 sh 여기 : https://docs.fastlane.tools/advanced/#using-the-sh-method

내가 curlcurl 사람 페이지에서 18를 반환 의심

업데이트 :

18  Partial file. Only a part of the file was transferred. 

그리고 당신은 표시되지 않는 쉘 스크립트가 출력물을 삼키고 있기 때문에 curl 출력에서. 루프에서 다음과 같이 스크립트를 수정해야 할 수도 있습니다.

if [[ $? != 0 ]]; then echo $response; fi 
+0

감사합니다. 마치 뒤틀린 컬 소리 같은 것 같습니다. –