-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from thin-edge/ci-streamline-test-workflow
ci: streamline test workflow
- Loading branch information
Showing
4 changed files
with
9 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,5 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
SHOULD_PROMPT=${SHOULD_PROMPT:-1} | ||
CAN_PROMPT=0 | ||
|
||
# | ||
# Detect if the shell is running in interactive mode or not | ||
if [ -t 0 ]; then | ||
CAN_PROMPT=1 | ||
else | ||
CAN_PROMPT=0 | ||
fi | ||
|
||
prompt_value() { | ||
user_text="$1" | ||
value="$2" | ||
|
||
if [ "$SHOULD_PROMPT" = 1 ] && [ "$CAN_PROMPT" = 1 ]; then | ||
printf "\n%s (%s): " "$user_text" "${value:-not set}" >&2 | ||
read -r user_input | ||
if [ -n "$user_input" ]; then | ||
value="$user_input" | ||
fi | ||
fi | ||
echo "$value" | ||
} | ||
|
||
if [ -z "$TEDGE_MQTT_DEVICE_TOPIC_ID" ]; then | ||
if [ -z "$C8Y_USER" ]; then | ||
C8Y_USER=$(prompt_value "Enter your Cumulocity IoT user" "$C8Y_USER") | ||
fi | ||
|
||
if [ -z "$C8Y_USER" ]; then | ||
echo "C8Y_USER is not set" | ||
exit 1 | ||
fi | ||
|
||
if [ -n "$C8Y_PASSWORD" ]; then | ||
C8YPASS="$C8Y_PASSWORD" tedge cert upload c8y --user "$C8Y_USER" | ||
else | ||
tedge cert upload c8y --user "$C8Y_USER" | ||
fi | ||
tedge cert upload c8y | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8fe2f04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
8fe2f04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
8fe2f04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results
8fe2f04
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Robot Results