Skip to content

Commit 283a7cb

Browse files
committed
Add help
1 parent 70c7bd7 commit 283a7cb

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

app-deploy.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env bash
22

3+
source /usr/local/bin/.app-deploy-sources/__constants.sh
4+
source /usr/local/bin/.app-deploy-sources/__help.sh
35
if [ -z "$1" ] || [ "$1" == 'trigger' ] ; then
46
source ./.deploy-options.sh
57
source /usr/local/bin/.app-deploy-sources/__trigger_deploy.sh
68
fi
7-
source /usr/local/bin/.app-deploy-sources/__constants.sh
89
source /usr/local/bin/.app-deploy-sources/__auto_update.sh
910
source /usr/local/bin/.app-deploy-sources/__init.sh
1011
source /usr/local/bin/.app-deploy-sources/__env_extractor.sh
@@ -28,7 +29,9 @@ set -e
2829
# START EVERYTHING #
2930
#################################
3031

31-
if [ "$1" == '--update' ] ; then
32+
if [ "$1" == '--help' ] ; then
33+
__help
34+
elif [ "$1" == '--update' ] ; then
3235
__clear_console
3336
__script_auto_update
3437
elif [ "$1" == 'init' ] ; then

sources/__help.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
################
2+
# HELP #
3+
################
4+
5+
function __help {
6+
cat << EOF
7+
Usage: app-deploy [OPTION] [ARGUMENTS]
8+
9+
A group of scripts and tools designed to assist in the deployment process. This script can:
10+
- Initialize deploy options.
11+
- Create trigger tag for CI/CD.
12+
- Extract environments from a trigger tag.
13+
- Generate a final build tag after CI/CD deployment.
14+
15+
Parameters:
16+
--update Update the script to the latest version.
17+
init Initialize the deploy-options file for the project.
18+
trigger Generate a trigger tag for starting the CI/CD flow.
19+
environments <trigger-tag>
20+
Extract environments from the specified trigger tag.
21+
tagging Generate a build tag after CI/CD uploads the build.
22+
Accepts the following options:
23+
-e <environment> Specify the environment to use as a tag prefix (e.g., internal-staging).
24+
-p <file-path> Path to the file from which app version, build number, etc., will be extracted.
25+
Supported formats: ipa, apk, aab.
26+
Use in combination with -v for unsupported formats (e.g. zip).
27+
-b <build-count> Specify the build count, usually the CI/CD counter.
28+
-v <custom-app-version> Optional: Override the app version extracted from the file.
29+
Useful for unsupported formats.
30+
-c <changelog> Optional: Add a changelog to the release tag.
31+
32+
Examples:
33+
1. Initialize deploy options:
34+
app-deploy init
35+
36+
2. Generate a trigger tag:
37+
app-deploy or app-deploy trigger
38+
output: ci/internal-staging/2024-12-12T14-32
39+
40+
3. Extract environments from a trigger tag:
41+
app-deploy environments ci/internal-staging/2024-12-12T14-32
42+
output: internal-staging
43+
44+
4. Generate a final build tag:
45+
app-deploy tagging -e "internal-staging" -p "path/to/my-app.ipa" -b "123" -c "Added new features"
46+
output: internal-staging/v1.2.3-44b123
47+
48+
EOF
49+
}

0 commit comments

Comments
 (0)