एजेंट कमांड

Cloud macOS बिल्डर पर शेल स्क्रिप्ट चलाएँ, प्रोजेक्ट के सोर्स के साथ या उसके बिना, और जिन फ़ाइलों का नाम आप दें उन्हें वापस लाएँ।

runmacos टीम के Environment से, Xcode वाले macOS बिल्डर पर एक Bash स्क्रिप्ट चलाता है। इसे airbuild.yaml की ज़रूरत नहीं। इसका उपयोग हर उस काम के लिए करें जो सैंडबॉक्स अपने आप नहीं कर सकता: macOS और Xcode वर्शन जाँचना, swift test चलाना, macOS ऐप के टूल चलाना।

यह केवल Cloud टीम के लिए है। Mac टीम पर यह runmacos is only available in cloud Teams; local Teams provide runtest. के साथ रुक जाता है।

सिनॉप्सिस

टर्मिनल विंडो
runmacos [<project-id>] [--source <directory>] [--output <relative-path>]... --command '<shell script>' [--environment ID] [--no-cache]
runmacos --follow [--run ID]    # reattach; starts nothing
runmacos --cancel [--run ID]
runmacos --list-environments
runmacos --help

विकल्प

विकल्प मान डिफ़ॉल्ट यह क्या करता है
--command शेल स्क्रिप्ट ज़रूरी चलाने वाली Bash स्क्रिप्ट। यह अपलोड किए गए रूट पर -e -o pipefail के साथ चलती है।
<project-id> UUID कोई नहीं यह प्रोजेक्ट अपलोड करें और उसके रूट पर चलाएँ।
--source डायरेक्टरी कोई नहीं इसकी जगह यह डायरेक्टरी अपलोड करें। आपकी मौजूदा डायरेक्टरी के सापेक्ष। दोनों होने पर --source अपलोड होता है।
--output सापेक्ष पाथ कोई नहीं वापस लाने वाली फ़ाइल या डायरेक्टरी। ज़्यादा के लिए दोहराएँ।
--environment --list-environments से मिला ID डिफ़ॉल्ट किसी दूसरे बिल्डर environment (macOS और Xcode वर्शन) पर चलाएँ।
--no-cache — कैश चालू बिल्डर कैश के बिना चलाता है और कुछ नहीं सहेजता।
--follow — — किसी भी मोड में पहले से चल रहे रन से फिर जुड़ता है। खत्म हो चुके रन पर यह बताता है और उसका सहेजा आउटपुट फिर से दिखाता है।
--run रन ID चल रहा रन, वरना सबसे नया --follow या --cancel के साथ।
--cancel — — रन को रुकने को कहता है; पुष्टि के लिए 30 सेकंड तक इंतज़ार करता है।
--list-environments — — बिल्डर environment की सूची।

प्रोजेक्ट ID या --source के बिना स्क्रिप्ट एक खाली डायरेक्टरी में चलती है और कोई सोर्स अपलोड नहीं होता; कमांड और उसके हेल्पर वाला एक छोटा पैकेज फिर भी भेजा जाता है। runmacos --platform, --sign, --unsigned, --script या --additional-options नहीं लेता।

बिल्डर पर

  • airbuild-xcode PATH पर है। रन का पहला airbuild-xcode install या test प्रोजेक्ट का DerivedData वापस लाता है, और रन स्क्रिप्ट के बाद उसे सहेजता है; archive और सादे xcodebuild को कुछ नहीं मिलता। airbuild-xcode देखें।
  • रन के बीच दूसरी फ़ाइलें रखने के लिए airbuild-cache PATH पर है। स्क्रिप्ट जो भी वापस लाती है, वह उसके खत्म होने के बाद हर बार फिर से सहेजा जाता है। airbuild-cache देखें।
  • Node, npm और pnpm इंस्टॉल हैं।
  • कोई साइनिंग सामग्री नहीं दी जाती।

आउटपुट फ़ाइलें

हर --output वर्किंग डायरेक्टरी के सापेक्ष एक ठोस पाथ होना चाहिए: कोई absolute पाथ, .., वाइल्डकार्ड, सिम्बॉलिक लिंक या विशेष फ़ाइल नहीं, और कोई पाथ दूसरे के भीतर नहीं। विफल स्क्रिप्ट भी मौजूद आउटपुट वापस लाती है, अपने शून्य से अलग एग्ज़िट कोड के साथ। जो स्क्रिप्ट पास हो पर कोई घोषित आउटपुट न लिखे, वह एग्ज़िट कोड 65 के साथ विफल होती है।

आउटपुट

• Build started in the Environment. Run: <run-id>
• It runs to completion even if this command is interrupted (reattach with: runmacos --follow --run <run-id>).
Airbuild remote execution
… the script's output …
✓ Command succeeded in <time>.

✓ Command finished.
  Build: <build-id>
  Artifact: <path to the collected outputs>

--output के बिना यह No outputs requested; skipping artifact download. प्रिंट करता है।

कई चलाना

runmacos का अपना स्लॉट है, जो runbuild, runtest और runlinux से अलग है। कई runmacos एक साथ चल सकते हैं। शुरू करने पर उसका रन ID प्रिंट होता है; जब कई चल रहे हों, तो --follow और --cancel को --run ID चाहिए (या ऐसा प्रोजेक्ट ID जिसे उनमें से केवल एक उपयोग करता हो)। Ctrl-C केवल अलग करता है।

एग्ज़िट कोड

कोड अर्थ
0 स्क्रिप्ट पास हुई और हर आउटपुट लिखा गया।
1 रन शुरू नहीं हो सका या खो गया।
2 गलत विकल्प, या --command गायब; कुछ नहीं चला।
65 कोई घोषित आउटपुट गायब है या एक्सपोर्ट नहीं हो सकता।
130 रद्द हुआ, या Ctrl-C से अलग किया गया।
अन्य स्क्रिप्ट का अपना एग्ज़िट कोड।

त्रुटियाँ

संदेश क्या करें
--command requires a nonempty shell script and is only available with runmacos and runlinux. एक स्क्रिप्ट दें।
--output requires a working-directory-relative path and is only available with runmacos and runlinux. सापेक्ष पाथ दें।
--platform takes a platform (…) and is only available with runbuild and runtest. --platform हटाएँ।
runmacos does not accept build or signing options. --sign / --unsigned हटाएँ।
--follow and --cancel cannot submit a command, outputs, or test options. follow या रद्द करते समय कमांड न दें।
Declared output was not produced: <path> स्क्रिप्ट से उसे लिखवाएँ, या --output हटाएँ।
The command failed and its output files could not be downloaded. फिर से चलाएँ; एग्ज़िट कोड स्क्रिप्ट का है।
N runmacos executions are running; choose one with --run. सूचीबद्ध रन ID में से एक दें।
This Team's Environment is already running N runmacos executions, the limit. किसी एक के खत्म होने का इंतज़ार करें, या एक को follow करें।

उदाहरण

टर्मिनल विंडो
# What the builder has, no source uploaded
runmacos --command 'xcodebuild -version; swift --version'
टर्मिनल विंडो
# Run a package's tests in the Project
runmacos 3f6c1a2e-8b4d-4f0a-9c1e-2d7b5a6e9f10 --command 'swift test'
टर्मिनल विंडो
# Build a worktree and bring back a report
runmacos --source ../feature-branch --output build/report.txt \
  --command 'mkdir -p build && swift build 2>&1 | tee build/report.txt'