Githubに関するJavadocのコメントを含む大きなJavaプロジェクトがあります。そこにはTravis CIがリンクされています。成功した後、プロジェクトのドキュメントを生成し、それを "doc"というブランチにプッシュしたいと思います!Githubで生成されたドキュメントを自動アップロード
トラビスCIのビルドが成功した後に開始したbashスクリプトがあります:
#!/usr/bin/env bash
# If error, return 0
set -e
# Repo
REPOSITORY="[email protected]:xxx/yyy"
# Clone repo to work in (repo_clone dir)
git clone ${REPOSITORY} repo_clone
cd repo_clone
# Go into doc branch, create it if not exist (first time only)
git checkout doc || git checkout --orphan doc
git config user.name "Travis CI"
git config user.email "[email protected]"
# Generation of doc
javadoc -private -sourcepath "src/main/java:src/main/ressources" \
-d doc \
marche.traitement.exceptions \
marche.traitement.label \
marche.traitement.marche \
marche.traitement.participant \
marche.traitement.production \
marche.traitement.produits
# Add new dir (all dir but only doc/ is impacted
git add .
git commit -m "There is the doc Marty !"
git remote add origin ${REPOSITORY}
# Push
git push origin doc
しかし、時には、私はこのエラーにしました
fatal: remote origin already exists.
時には、この1:
error: src refspec doc does not match any.
error: failed to push some refs to '[email protected]:GeeksdelaCave/aidons-les-fermiers.git'
未成年者の適応に応じて。
修正方法?