|
|
@@ -1,32 +1,33 @@
|
|
|
version: 2.1
|
|
|
|
|
|
jobs:
|
|
|
- check_chip:
|
|
|
- parameters:
|
|
|
- target_chip:
|
|
|
- type: string
|
|
|
- machine: true
|
|
|
- resource_class: "exo/hardware"
|
|
|
- steps:
|
|
|
- - run:
|
|
|
- name: Check for chip
|
|
|
- command: |
|
|
|
- echo "Hostname: $(hostname)"
|
|
|
- CHIP=$(sysctl -n machdep.cpu.brand_string | grep -o "M[1-4]" || echo "Unknown")
|
|
|
- echo "Found chip: $CHIP"
|
|
|
-
|
|
|
- if [[ "$CHIP" == "<< parameters.target_chip >>" ]]; then
|
|
|
- echo "Match found! Hello $CHIP"
|
|
|
- exit 0
|
|
|
- else
|
|
|
- echo "This machine doesn't have << parameters.target_chip >>"
|
|
|
- exit 1
|
|
|
- fi
|
|
|
+ check_chip:
|
|
|
+ parameters:
|
|
|
+ target_chip:
|
|
|
+ type: string
|
|
|
+ machine: true
|
|
|
+ resource_class: "exo/hardware"
|
|
|
+ steps:
|
|
|
+ - run:
|
|
|
+ name: Print Machine Details
|
|
|
+ command: |
|
|
|
+ echo "=== Machine Details ==="
|
|
|
+ echo "Hostname: $(hostname)"
|
|
|
+ echo "IP Address: $(ifconfig | grep 'inet ' | grep -v 127.0.0.1 | awk '{print $2}')"
|
|
|
+ CHIP=$(sysctl -n machdep.cpu.brand_string | grep -o "M[1-4]" || echo "Unknown")
|
|
|
+ echo "Chip: $CHIP"
|
|
|
+ echo "===================="
|
|
|
+
|
|
|
+ if [[ "$CHIP" == "<< parameters.target_chip >>" ]]; then
|
|
|
+ echo "Found $CHIP chip on $(hostname)"
|
|
|
+ else
|
|
|
+ echo "No << parameters.target_chip >> chip found on this machine"
|
|
|
+ fi
|
|
|
|
|
|
workflows:
|
|
|
- check-chips:
|
|
|
- jobs:
|
|
|
- - check_chip:
|
|
|
- matrix:
|
|
|
- parameters:
|
|
|
- target_chip: ["M3", "M4"]
|
|
|
+ check-chips:
|
|
|
+ jobs:
|
|
|
+ - check_chip:
|
|
|
+ matrix:
|
|
|
+ parameters:
|
|
|
+ target_chip: ["M3", "M4"]
|