Skip to content

Commit 1e0db46

Browse files
committed
Update readme
1 parent b88ce19 commit 1e0db46

File tree

1 file changed

+1
-165
lines changed

1 file changed

+1
-165
lines changed

README.md

+1-165
Original file line numberDiff line numberDiff line change
@@ -50,172 +50,8 @@ app-deploy --update
5050
> Script commands such as `install`, and `--update` will need `sudo` to execute successfully. Use it when requested.
5151
5252
## Usage
53-
### Script modifications
5453

55-
#### Main option `app-deploy init`
56-
57-
Once `deploy-options` are generated with the `init` command, the script should be used as-is.
58-
59-
The only part that should be changed is stored inside the `.deploy-options.sh` file under the `deploy_options` function. This part of the script is responsible for creating the first part of the tag that can trigger a specific workflow on CI. If the given values are not enough or do not represent the project structure, they can be replaced with different values.
60-
61-
> Keep in mind that the prefix `internal-' should be used for builds created for internal testing, while builds for beta testing (e.g., Google Play Beta or Apple TestFlight) or public release should be prefixed as `beta—' or `play store`/ `app store`.
62-
63-
**Final variable name inside the `deploy_options` function must stay: `target`**
64-
65-
#### Configuration flags
66-
67-
As tag creation is divided into several small steps, some can be skipped and/or disabled by changing configuration flags at the beginning of the script inside the `.deploy-options.sh` file.
68-
69-
```bash
70-
# If enabled, the console will be cleared on every script run.
71-
# By default, this option is enabled
72-
use_automatic_console_clean=true
73-
# If enabled, commits that are not pushed will be pushed automatically without a confirmation dialog.
74-
# By default, this option is disabled
75-
enable_automatic_commit_push=false
76-
# If enabled, a confirmation dialog with a deploy summary will be presented.
77-
# By default, this option is enabled
78-
enable_final_confirmation=true
79-
```
80-
##### Script version
81-
If needed, you can specify the version of the script you want to run by changing the value of the `script_version` parameter. Available options are `v1` for the old (legacy) deployment flow and `v2` for the new deployment flow.
82-
<b>v1</b>
83-
Old deployment flow where local `app-deploy` command will generate a tag that includes and defines the app version and following build number without the `ci/` prefix (e.g.,. `internal-staging/v1.0.0-200`).
84-
85-
<b>v2</b>
86-
This is a new deployment flow in which the local `app-deploy` command generates the new trigger tag described at the beginning of this readme.
87-
88-
### Commands
89-
#### Local trigger `app-deploy [optional trigger]`
90-
91-
Script should be run just by calling the script name from the folder where `.deploy-options.sh` is stored (e.g. root folder):
92-
93-
```bash
94-
app-deploy
95-
```
96-
97-
After that, the script will check if everything is pushed to the remote, and if needed it will push all commits before it continues (automatic push can be enabled with `enable_automatic_commit_push` flag).
98-
99-
```bash
100-
###############################################################
101-
# DEPLOY SCRIPT #
102-
# #
103-
# Copyright (c) 2020 Infinum. #
104-
###############################################################
105-
106-
107-
###############################################################
108-
# COMMIT CHECK #
109-
###############################################################
110-
111-
---------------------------------------------------------------
112-
Targeting commit: e3e45889b
113-
---------------------------------------------------------------
114-
#123: Add my cool feature
115-
---------------------------------------------------------------
116-
```
117-
118-
The next step is selecting one or multiple targets that should be run on CI. Enter one or more numbers separated by whitespaces:
119-
120-
```bash
121-
###############################################################
122-
# DEPLOY TARGET SELECTION #
123-
###############################################################
124-
125-
--------------
126-
| TryOutApps |
127-
--------------
128-
129-
[0] Test
130-
[1] Develop
131-
[2] Production
132-
133-
==================
134-
135-
---------
136-
| STORE |
137-
---------
138-
139-
[3] App Store
140-
141-
Enter number in square brackets: 0 1
142-
```
143-
144-
After selecting the target, the script will ask for the changelog. The console will open a preselected text editor where a changelog can be added. Keep in mind that closing that editor without entering the changelog will result in a script termination.
145-
146-
```bash
147-
###############################################################
148-
# CHANGELOG #
149-
###############################################################
150-
151-
------------------------------------------------------------
152-
Enter changelog message...
153-
------------------------------------------------------------
154-
```
155-
156-
If everything is done correctly, the confirmation step will be shown with the summary of selected options (can be skipped by disabling the `enable_final_confirmation` flag):
157-
158-
```bash
159-
###############################################################
160-
# DEPLOY #
161-
###############################################################
162-
163-
---------------------------------------------------------------
164-
~ CONFIGURATION ~
165-
166-
Tag: ci/internal-develop/internal-test/2024-12-16T10-26
167-
168-
Changelog:
169-
New features:
170-
171-
* first
172-
* second
173-
---------------------------------------------------------------
174-
175-
Is configuration correct for the CI deployment? [y or enter / n]
176-
```
177-
178-
In the end, the tag is created and pushed to the remote.
179-
180-
#### Remote CI/CD build tagging `app-deploy tagging`
181-
Once the build is deployed, you can run the `tagging` option that will read the version from the installation file (ipa, apk, aab), combined with some input options, and as output, it will generate deployed build tag (e.g., `internal-staging/v1.0.0-45b46c100`). Mandatory parameters are **e**nvironment `-e`, **p**ath to installation file `p`, and CI/CD **b**uild counter `b`:
182-
```bash
183-
app-deploy tagging -e "internal-staging" -p path/to/app.ipa -b $CI_COUNTER
184-
```
185-
There are two optional parameters: a custom **v**ersion number that overrides one from the installation file `-v` and `-c`, which can be used to set the tag message representing the **c**hangelog.
186-
187-
#### Helper command `app-deploy environments`
188-
To help you with parsing out triggered environments from the trigger tag, you can use `app-deploy environments $TAG` command, where `$TAG` is tag used for triggering the build. Tag must be in the format used by the trigger command (i.e., `ci/env1/env2/timestamp`).
189-
```bash
190-
deploy environments "ci/env1/env2/timestamp"
191-
192-
output:
193-
env1
194-
env2
195-
```
196-
197-
For example, this command could be used for mapping trigger env notation into the CI/CD workflow name:
198-
```bash
199-
EXTRACTED_ENVIRONMENTS=$(app-deploy environments "$CI_GIT_TAG" | tr '\n' ' ')
200-
201-
# Process environments
202-
BUILD_ENVIRONMENTS=""
203-
IFS=$' ' read -ra environments <<< "$EXTRACTED_ENVIRONMENTS"
204-
205-
# Map environment from tag to the Workflow name
206-
for environment in "${environments[@]}"; do
207-
if [[ $environment == 'internal-develop' ]]; then
208-
BUILD_ENVIRONMENTS+="Development"$'\n'
209-
elif [[ $environment == 'internal-staging' ]]; then
210-
BUILD_ENVIRONMENTS+="Staging"$'\n'
211-
fi
212-
done
213-
214-
# Remove empty line at the end of the list
215-
BUILD_ENVIRONMENTS="$(echo "$BUILD_ENVIRONMENTS")"
216-
217-
# Set $BUILD_ENVIRONMENTS as a global variable on CI/CD that CI can use later as a list of workflows that should be run
218-
```
54+
For detailed usage documentation, please check the [wiki pages](https://github.com/infinum/app-deploy-script/wiki).
21955

22056
## Contributing
22157

0 commit comments

Comments
 (0)