2016-12-15 3 views
1

travis로 일부 "travis"브랜치를 빌드하고 github 개인 사이트 저장소의 마스터 브랜치에 푸시하려고합니다. 건물Travis CI Jekyll buildt build.sh가 1로 종료되었습니다. 오류를 찾을 수 없습니다.

The command "./build.sh" exited with 1. 

Done. Your build exited with 1 

입니다 그러나 트래비스 나에게 실제 오류를 제공하지 않는 경우 는 내가 무엇을 얻을. 사이트를 로컬로 구축 할 수 있습니다. 나는 몇 가지를 시도

sudo: required 
language: ruby 
before_script: 
- chmod a+x ./build.sh 
script: "./build.sh" 
branches: 
    only: 
    - travis 
rbenv: 
- 2.2.3 
env: 
    global: 
    - secure: "long encrypted env variables" 

: 이것은 내 .travis.yml이

#!/bin/bash 

# only proceed script when started not by pull request (PR) 
if [ $TRAVIS_PULL_REQUEST == "true" ]; then 
    echo "this is PR, exiting" 
    exit 0 
fi 

# enable error reporting to the console 
set -e 

# build site with jekyll, by default to `_site' folder 
bundle exec jekyll build 
#find ./_site -name "*.html" -exec bundle exec htmlbeautifier {} \; 
#bundle exec htmlproof ./_site --disable-external --check-html --verbose 

# cleanup 
rm -rf ../DavidSanwald.github.io.master 

#clone `master' branch of the repository using encrypted GH_TOKEN for authentification 
git clone https://${GH_TOKEN}@github.com/DavidSanwald/DavidSanwald.github.io.git ../DavidSanwald.github.io.master 

# copy generated HTML site to `master' branch 
cp -R _site/* ../DavidSanwald.github.io.master 

# commit and push generated content to `master' branch 
# since repository was cloned in write mode with token auth - we can push there 
cd ../DavidSanwald.github.io.master 
git config user.email "[email protected]" 
git config user.name "DavidSanwald" 
git add -A . 
git commit -a -m "Travis #$TRAVIS_BUILD_NUMBER" 
git push --quiet origin master > /dev/null 2>&1 

입니다 : 이것은 내 build.sh 스크립트

https://travis-ci.org/DavidSanwald/DavidSanwald.github.io/builds/184261084

입니다 : 다음은 전체 로그입니다 하지만 시작하기에 유용한 오류 메시지를 찾을 수 없기 때문에 잃어 버렸습니다. 또한 모든 것을 로컬로 구축 할 수 있습니다. 그래서 나는 어디에서 시작해야할지 모른다.

편집 : 좋아, --quiet 옵션을 제거하고 출력을 리디렉션합니다. 아니요 :

error: src refspec master does not match any. 
error: failed to push some refs to 'https://[email protected]/DavidSanwald/DavidSanwald.github.io.git' 

그 시작점입니다. 내가 해결하면 다시 올거야. 어떤 아이디어라도 여전히 고맙게 생각합니다. 위 토큰을 취소했습니다. 데모 용으로 여기에 있습니다.

답변

1

git push 바로 전에 git 상태를 사용해보십시오.

해당 error message means 여기에는 커밋이 없거나 refs/heads/master을 사용할 수 없습니다.

시도해보십시오. 작동하는지 확인하려면 git push origin HEAD:master을 참조하십시오.

+0

고마워요! 당신이 옳았. 'git show-ref'와 내 심판이 엉망이되었습니다. –

+0

불행히도 가져 오거나'git update-ref'가 바로 해결하지 못했습니다. 많은 일을 시도하고 마침내 트릭을했는지조차 모르겠다 (미안하지만 실수로 내 의견을 제출하고 나머지는 추가하지 못한다) –