Skip to content

Commit

Permalink
Create general output check (#9)
Browse files Browse the repository at this point in the history
* Add CI ribbon

* Create output check

* Upgrade the step info yml file

* Set the archived path
  • Loading branch information
Daniel Serleg authored Jan 4, 2021
1 parent 26d982d commit f8af123
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.bitrise*
downloads
unarchived
_tmp/*
_tmp
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://app.bitrise.io/app/d4aade153bb51eba/status.svg?token=7W4uo8BVaj_1_uxMetHeag&branch=master)](https://app.bitrise.io/app/d4aade153bb51eba)

# Resource Archive

The new Resource Archive step.
Expand All @@ -8,5 +10,5 @@ Can be run directly with the [bitrise CLI](https://github.com/bitrise-io/bitrise
just `git clone` this repository, `cd` into it's folder in your Terminal/Command Line
and call `bitrise run test`.

*Check the `bitrise.yml` file for required inputs which have to be
added to your `.bitrise.secrets.yml` file!*
_Check the `bitrise.yml` file for required inputs which have to be
added to your `.bitrise.secrets.yml` file!_
41 changes: 39 additions & 2 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ app:
envs:
- STEP_VERSION: 2.0.1
- ORIG_BITRISE_SOURCE_DIR: $BITRISE_SOURCE_DIR
- ARCHIVE_URL: https://bitrise-steplib-collection.s3.amazonaws.com/step-archives/activate-ssh-key/3.0.2/step.zip
- EXTRACT_URL: ./_tmp

workflows:
test:
Expand All @@ -13,8 +15,43 @@ workflows:
steps:
- path::./:
inputs:
- archive_url: https://bitrise-steplib-collection.s3.amazonaws.com/step-archives/activate-ssh-key/3.0.2/step.zip
- extract_to_path: ./_tmp
- archive_url: $ARCHIVE_URL
- extract_to_path: $EXTRACT_URL
- script:
title: Output check
inputs:
- content: |-
#!/bin/bash
ARCHIVED_FILE_PATH=downloads/resource.zip
ARCHIVE_FILE_PATH=$EXTRACT_URL/unarchived/
UNARCHIVED_FILE_PATH=unarchived/
if [ -f "$ARCHIVED_FILE_PATH" ]; then
echo "$ARCHIVED_FILE_PATH exists."
else
echo "$ARCHIVED_FILE_PATH does not exist."
exit 1
fi
EXTRACTED_FILE_COUNT=$(ls -la $ARCHIVE_FILE_PATH | wc -l | xargs)
if [ $EXTRACTED_FILE_COUNT -eq 12 ]; then
echo "Extracted file count match with the expected count in dir.: $ARCHIVE_FILE_PATH"
else
echo "-> FAILED: location: $ARCHIVE_FILE_PATH, expected: 12 got: $EXTRACTED_FILE_COUNT"
exit 1
fi
UNARCHIVED_FILE_COUNT=$(ls -la $UNARCHIVED_FILE_PATH | wc -l | xargs)
if [ $UNARCHIVED_FILE_COUNT -eq 12 ]; then
echo "Extracted file count match with the expected count in dir.: $UNARCHIVED_FILE_PATH"
else
echo "-> FAILED: location: $UNARCHIVED_FILE_PATH expected: 12 got: $UNARCHIVED_FILE_COUNT"
exit 1
fi
exit 0
# ----------------------------------------------------------------
# --- workflows to create Release
Expand Down
8 changes: 2 additions & 6 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ description: |-
website: https://github.com/bitrise-io/steps-resource-archive
source_code_url: https://github.com/bitrise-io/steps-resource-archive
support_url: https://github.com/bitrise-io/steps-resource-archive/issues
host_os_tags:
- "osx-10.10"
host_os_tags:
- osx-10.9
project_type_tags:
type_tags:
- utility
Expand All @@ -19,7 +15,7 @@ inputs:
- archive_url: ""
opts:
title: "Resource path"
summary: ""
summary: "Resource path. It can be a remote URL too."
description: |-
Path of the resource .ZIP file.
is_required: true
Expand All @@ -28,7 +24,7 @@ inputs:
- extract_to_path: ""
opts:
title: "Extract path"
summary: ""
summary: "Extract path. Path to your local directory: path/to/dir"
description: |-
Resource extract path.
is_required: true
Expand Down

0 comments on commit f8af123

Please sign in to comment.