Skip to content

Commit

Permalink
feat(cli): support cli v1 (#4)
Browse files Browse the repository at this point in the history
feat(cli): support cli v1
  • Loading branch information
Malinskiy authored Feb 20, 2024
1 parent 02ca21c commit 8d51d51
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 19 deletions.
28 changes: 19 additions & 9 deletions step.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
#!/usr/bin/env bash
set -ex

command_args=" -api-key $API_KEY -app $application -testapp $test_application -platform $platform -system-image $system_image -isolated $isolated"
run_platform=$(echo "$platform" | awk '{print tolower($0)}')
command_args="run $run_platform"
command_args="$command_args --api-key $api_key"
command_args="$command_args --application $application"
command_args="$command_args --test-application $test_application"
command_args="$command_args --system-image $system_image"
command_args="$command_args --isolated $isolated"

if [ -n "$os_version" ]; then
command_args="$command_args -os-version $os_version"
command_args="$command_args --os-version $os_version"
fi

if [ -n "$link" ]; then
command_args="$command_args -link $link"
command_args="$command_args --link $link"
fi

if [ -n "$run_name" ]; then
command_args="$command_args -name $run_name"
command_args="$command_args --name $run_name"
fi

if [ -n "$ignore_test_failures" ]; then
command_args="$command_args --ignore-test-failures $ignore_test_failures"
fi

if [[ $OSTYPE == 'darwin'* ]]; then
echo 'macOS agents preinstall marathon-cloud cli via brew'
marathon-cloud $command_args
echo 'macOS agents preinstall marathon-cloud cli via brew'
marathon-cloud $command_args
elif [[ $OSTYPE == 'linux'* ]]; then
echo 'using docker image $docker_image to pull the latest marathon-cloud cli version'
docker pull $docker_image
docker run -v "$(pwd)":/work --rm $docker_image $command_args
echo 'using docker image $docker_image to pull the latest marathon-cloud cli version'
docker pull $docker_image
docker run -v "$(pwd)":/work --rm $docker_image $command_args
fi
28 changes: 18 additions & 10 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ type_tags:
#
deps:
brew:
- name: malinskiy/tap/marathon-cloud
- name: malinskiy/tap/marathon-cloud
# apt_get:
# - name: cmake


toolkit:
bash:
entry_file: step.sh


inputs:
- application: ""
opts:
Expand All @@ -68,7 +66,7 @@ inputs:
description: |
Application binary path.
For an Android project: app APK file path.
For an iOS project: an ARM compatible Simulator build packaged in a ZIP archive.
For an iOS project: an ARM compatible Simulator build packaged in a ZIP archive.
is_expand: true
is_required: true
- test_application: ""
Expand All @@ -78,7 +76,7 @@ inputs:
description: |
Test application binary path.
For an Android project: test app APK file path.
For an iOS project: an ARM compatible Simulator iOS Test Runner app packaged in a ZIP archive.
For an iOS project: an ARM compatible Simulator iOS Test Runner app packaged in a ZIP archive.
is_expand: true
is_required: true
- platform: ""
Expand All @@ -88,15 +86,15 @@ inputs:
description: ""
value_options:
- "Android"
- "iOS"
- "iOS"
is_expand: true
is_required: true
- api_key:
opts:
title: Marathon Cloud API key
summary: API key for authenticating with Marathon Cloud
description: |
Have a look at [the tokens page](https://cloud.marathonlabs.io/tokens) in the dashboard to obtain your token.
Have a look at [the tokens page](https://cloud.marathonlabs.io/tokens) in the dashboard to obtain your token.
is_expand: true
is_required: true
is_sensitive: true
Expand All @@ -122,8 +120,8 @@ inputs:
is_required: false
- link: ""
opts:
title: Link to commit
summary: Link to commit
title: Optional link, for example it could be a link to source control commit or CI run
summary: Optional link, for example it could be a link to source control commit or CI run
description: ""
is_expand: true
is_required: false
Expand All @@ -143,7 +141,17 @@ inputs:
summary: Run each test using isolated execution. Default is false
description: ""
value_options:
- "true"
- "true"
- "false"
is_expand: true
is_required: false
- ignore_test_failures: false
opts:
title: Ignore test failures
summary: When tests fail and this option is true then cli will exit with code 0. By default, cli will exit with code 1 in case of test failures and 0 for passing tests
description: ""
value_options:
- "true"
- "false"
is_expand: true
is_required: false

0 comments on commit 8d51d51

Please sign in to comment.