7

我使用 Xcode 和 Xcode 服务器创建了多个机器人。我想备份这些机器人并将其转移到另一台机器上。如何才能做到这一点?

4

2 回答 2

3

所有 Xcode Server 机器人信息都存储在 CouchDB 中。路径(当前为 Server.app 5.2 和 Xcode.app 8.2.1)是:

 /Library/Developer/XcodeServer/Database/*
 /Library/Developer/XcodeServer/Database/xcs.couch

您可能可以将整个“XcodeServer”文件夹从一台服务器复制并粘贴到另一台服务器并启动 Xcode 服务器服务。

在处理 Xcode Server 时还有一些其他有用的提示:

于 2017-02-20T21:30:07.387 回答
0

Maybe this little guide can help.

  1. From the machine in which there are the bots you want migrate, open the browser and go to:

https://localhost:20343/api/bots

  1. Save the JSON you just received in a text file and import it to the destination machine.

  2. From the destination machine, open a terminal and:

cd /Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer/usr/share/xcs/xcsd/routes

sudo nano routes_bot.js

  1. Edit the file adding the following lines before the line "module.exports = router":

router.route('/bots/noauth').post(prepareRequest, bot.create);

  1. Save the file you just edited;
  1. Restart XcodeServer:

sudo xcscontrol --shutdown

sudo xcscontrol --start

  1. Wait until the restart process is finished;

  2. Open POSTMAN (or any http client you want), open Settings and disable "SSL certificate verification";

  3. Prepare a request with the following parameters:

  • POST
  • URL: https://localhost:20343/api/bots/noauth
  • Headers: Content-Type: application/json
  • Body: "raw"
  1. One at time, paste into the BODY the items of the "results" array contained into the JSON you saved at the point 2, and send the request.

  2. Now you have all your bots. Enjoy!

于 2021-07-06T10:05:20.443 回答