and*_*ean 10 xcode ssh-keys osx-server ios xcode-server
我为github上托管的项目安装了一个Xcode Bot.我按照步骤设置机器人以使用我现有的SSH密钥.验证成功,项目将结帐并构建.
然后我在预触发操作中添加了一个shell脚本,该操作会增加plist中的版本,标记它,然后将更改提交回github.
但是,当我尝试从shell脚本执行git push时,我得到了这个:
- 推送到git@github.com:spex-app/spex-ios.git权限被拒绝(publickey).
致命:无法从远程存储库读取.
为什么服务器会成功签出我的项目但无法推送更改.我注意到用户是_xcsbuildd.我尝试将.ssh键复制到/var/_xcsbuildd/.ssh中,但这也无效.
我想到了.您需要为_xcsbuildd用户创建新密钥.然后将它们添加到github.这个主题的底部:https://devforums.apple.com/message/1054122#1054122
sudo -u _xcsbuildd /bin/bash
ssh-keygen -t rsa -C "your_email@example.com"
ssh -T git@github.com
Run Code Online (Sandbox Code Playgroud)
小智 6
接受我在整个网络上发现的很多其他答案(以及这个问题),我已经完成了在Xcode 6中完成这项工作的步骤.首先,在你的构建上做了dmclean所说的内容(有一些改动)服务器:
sudo -u _xcsbuildd /bin/bash
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" (when asked for a keyphrase, just hit return)
ssh -vT git@github.com (this will show you debugging output - you should not have to enter a keyphrase and it should successfully get to git)
Run Code Online (Sandbox Code Playgroud)
现在,您需要在git帐户中设置此新公钥.请按照以下步骤操作:(步骤4) https://help.github.com/articles/generating-ssh-keys/
我假设你有一个项目的构建脚本.我们的项目有一个股票扩展和一个观察扩展.我希望构建数在每个构建数上增加(并且每个构建数相同).我们的构建号码的格式为ABCD(Major.Minor.Patch.build).这个"运行脚本"位于主项目的"构建阶段"中.这是我们的脚本:
#!/bin/sh
# Auto Increment Version Script
# set CFBundleVersion to 1.0.0.1 first!!!
# the perl regex splits out the last part of a build number (ie: 1.1.1.1) and increments it by one
# if you have a build number that is more than 4 components, add a '\d+\.' into the first part of the regex. If you have less remove one
buildPlist=${INFOPLIST_FILE}
newVersion=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$buildPlist" | /usr/bin/perl -pe 's/(\d+\.\d+\.\d+\.)(\d+)/$1.($2+1)/eg'`
echo $newVersion;
/usr/libexec/PListBuddy -c "Set :CFBundleVersion $newVersion" "$buildPlist"
/usr/libexec/PListBuddy -c "Set :CFBundleVersion $newVersion" "$SRCROOT/${PRODUCT_NAME} Extension/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $newVersion" "$SRCROOT/${PRODUCT_NAME} WatchKit Extension/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $newVersion" "$SRCROOT/${PRODUCT_NAME} WatchKit App/Info.plist"
echo "Trying Git Config"
git config user.email "your_email@example.com"
git config user.name "XCode Build Server"
echo "Trying Git Commit"
git commit -a -m "Updated Build Numbers"
echo "Trying Git Push"
git push
Run Code Online (Sandbox Code Playgroud)
如果它不起作用,请查看构建日志中的输出(在集成下).
Some of the problems I encountered:
Run Code Online (Sandbox Code Playgroud)
由于_xcsbuildd确实没有$ HOME,我不得不做git configs,否则我得到的错误是git不知道我是谁(身份错误).如果我在RSA密钥中放了一个关键短语,那么它在尝试推送时给了我公钥错误(让我想一下取出关键短语使其工作).
我希望这可以帮助别人.
| 归档时间: |
|
| 查看次数: |
1384 次 |
| 最近记录: |