🤖 Manage Xcode bots easier than ever
Xcodebot is a non-official cross-platform tool for managing Xcode server on any server environment (only Ruby is required), thus it can be used on Jenkins server even if Xcode is not installed on the machine.
Whereas Xcode API was ASYNCHRONOUS, the provided bot provides a way for calling bots completely SYNCHRONOUSLY.
Some ideas for using it :
Feel free to open issues / open PRs.
Manually :
gem install bundler
git clone https://github.com/vpg/xcodebot
bundle install
rake install
Some environment variables should be set for having access to your Xcode server :
export XCODEBOT_EMAIL=”user@mail.com”
export XCODEBOT_PASSWORD=”MY_PASSWORD”
In this way, your credentials are never stored in any configuration file and you keep any control on them.
xcodebot —help
Actions | Description |
---|---|
config | Configure Xcode server |
bots | Manage xcode bots (CRUD) |
integrations | Manage xcode integrations (CRUD) |
config
)xcodebot help config
ARGS | Description |
---|---|
—list, -l | Display xcode server api endpoint |
—address, -a | Set address for xcode server |
—localhost, —local | Use localhost as address for xcode server |
bots
)xcodebot help bots
ARGS | Description | Parameters |
---|---|---|
—list, -l | List all bots | - |
—get | Get information about a bot | |
—stats, -s | Statistics of bot | |
—create, -c | Create a new bot | See above |
—duplicate, -d | Duplicate bot | |
—delete, —remove | Remove one or several bot |
For creating a bot, you need some extra params because of Xcode bot. Blueprint id is one of them. Blueprint
information are saved in a file .xcscmblueprint
which contains some information about your versionned repository
(git or SVN). Some variable are usefull for setting which repo and branch to checkout for example. But note this file
will be different for all developers machine, so a good solution it’s using one generated by your Xcode server.
For finding this file, you can run following command on your source repository :
find . -name ‘*.xcscmblueprint’
Then you can create a bot by running command (simplification work in progress) :
xcodebot bots —create \
name:’Auto Bot’ \
schedule:2 \
clean:1 \
branch:5.7 \
scheme:CI \
blueprint:82EF22EF5CE4E343B67A9F79130BD862EF58AE20 \
project:’VoyagePrive’ \
folder:’iosVoyagePrive/‘ \
git:’github.com:vpg/iosVoyagePrive.git’ \
path:’VoyagePrive/VoyagePrive.xcworkspace’
Or with a json model :
xcodebot bots —create \
name:’Auto Bot’ \
schedule:2 \
clean:1 \
branch:5.7 \
scheme:CI \
json:vpg_bot.json
integrations
)xcodebot help integrations
ARGS | Description | Parameters |
---|---|---|
—cancel | Cancel an integration | |
—create, -c | Create a new integration for a bot | |
—delete, —remove | Remove integration | |
—delete-all, —remove-all | Remove all integrations | - |
—list, -l | List integrations for a bot | |
—logs | Get logs of an integration | |
—status, -s | Get status of an integration | |
—wait, -w | Task done synchronously | - |
These (outdated) repositories have been a great source of inspiration for creating this repo. Great thanks to them.
Bug reports and pull requests are welcome on GitHub at https://github.com/jhanzo/xcodebot. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.