Skip to content

Commit e9080f8

Browse files
authored
Merge pull request #14 from infinum/feature/manual-version-trigger
Add support for version option; Make build option accepting empty string
2 parents 964bbf0 + d33ba3c commit e9080f8

File tree

3 files changed

+45
-5
lines changed

3 files changed

+45
-5
lines changed

.github/pull_request_template.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Description
2+
3+
<!--
4+
Provide an overview of what this pull request aims to address or achieve and describe the changes, including any technical details or architectural decisions.
5+
-->
6+
7+
**Related task(s):**
8+
9+
* [Productive Ticket](url-to-ticket)
10+
<!-- Link a relevant task(s) that this pull request addresses or resolves. -->
11+
12+
### Additional notes
13+
14+
<!--
15+
Add any additional comments, instructions, or insights about this pull request.
16+
-->
17+
18+
### Design changes
19+
20+
<!--
21+
If this pull request includes any design changes, provide a brief overview and include relevant design files, screenshots and/or screen recordings.
22+
-->

app-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ source /usr/local/bin/.app-deploy-sources/__build_tagging.sh
2525
# Use global variables at your own risk as this can be overridden in the future.
2626
set -e
2727

28-
VERSION="2.0.0"
28+
VERSION="2.0.1"
2929

3030
#################################
3131
# START EVERYTHING #

sources/__build_tagging.sh

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,31 @@ function __validate_options {
6363
esac
6464
done
6565

66-
# Check if all mandatory options are provided
67-
if [[ -z "$ENVIRONMENT" || -z "$APP_PATH" || -z "$BUILD_COUNT" ]]; then
68-
echo "Error: Missing mandatory options."
69-
echo "Usage: app-deploy tagging -e \"environment_name\" -p \"path/to/app.{ipa/apk}\" -b \"{build count}\""
66+
# Check if mandatory options are provided
67+
if [[ -z "$ENVIRONMENT" ]]; then
68+
echo "Error: Missing mandatory option -e (environment)."
69+
echo "Usage: app-deploy tagging -e \"environment_name\" [-p \"path/to/app.{ipa/apk}\" | -v \"version\"] -b \"{build count}\""
7070
echo "Example: app-deploy tagging -e \"internal-staging\" -p \"path/to/app.ipa\" -b \"42\""
7171
exit 1
7272
fi
73+
74+
# Ensure only one of -p or -v is set, and at least one is provided
75+
if [[ -n "$APP_PATH" && -n "$CUSTOM_APP_VERSION" ]]; then
76+
echo "Error: Options -p (path) and -v (version) are mutually exclusive. Provide only one."
77+
echo "Usage: app-deploy tagging -e \"environment_name\" [-p \"path/to/app.{ipa/apk}\" | -v \"version\"] -b \"{build count}\""
78+
exit 1
79+
elif [[ -z "$APP_PATH" && -z "$CUSTOM_APP_VERSION" ]]; then
80+
echo "Error: Either -p (path) or -v (version) must be provided."
81+
echo "Usage: app-deploy tagging -e \"environment_name\" [-p \"path/to/app.{ipa/apk}\" | -v \"version\"] -b \"{build count}\""
82+
exit 1
83+
fi
84+
85+
# Ensure BUILD_COUNT is set (even if empty string is allowed)
86+
if [[ ! -v BUILD_COUNT ]]; then
87+
echo "Error: Missing mandatory option -b (build count)."
88+
echo "Usage: app-deploy tagging -e \"environment_name\" [-p \"path/to/app.{ipa/apk}\" | -v \"version\"] -b \"{build count}\""
89+
exit 1
90+
fi
7391
}
7492

7593
function __check_platform {

0 commit comments

Comments
 (0)