|
1 |
| -# app-deploy-script |
| 1 | +# App Deploy Script |
| 2 | + |
| 3 | +Deploy script used for creating the tag with tag message in format `internal-all/v1.0.0-1234`, where `internal-all` is marking the workflow that should be started on the CI, `v1.2.3` represents app version and `1234` represents the build number. Tag message set from this script can be used later for the change log message on any CI (e.g. Bitrise). Build number is number calculated as total number of tags available on github incremented by one. |
| 4 | + |
| 5 | + |
| 6 | +## Script modifications |
| 7 | + |
| 8 | +In general, script should be used as is. The only part that could be changed is marked as "DEPLOY OPTIONS" and it is available under the `deploy_options` function. This part of script is responsible for creating the first part of the tag that can trigger a specific workflow on CI. If given values are not enough or they are not representing the project structure, they can be replaced with different values. |
| 9 | +Keep in mind that prefix `internal-` should be used for the builds created for the internal testing, while builds for beta testing (i.e. Google Play Beta or Apple TestFlight) or public release, should be prefixed as `beta-` or `playstore`/ `appstore`. |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +Script should be stored somewhere in the project folder (e.g. in root folder, deployment folder, etc.) and it can be run just by calling the script name: |
| 14 | + |
| 15 | +```bash |
| 16 | +./app-deploy.sh |
| 17 | +``` |
| 18 | + |
| 19 | +After that, script will check if everything is pushed to the remote and if needed it will push all commits before it continues. |
| 20 | + |
| 21 | +```bash |
| 22 | +############################################################### |
| 23 | +# DEPLOY SCRIPT # |
| 24 | +# # |
| 25 | +# Copyright (c) 2020 Infinum. # |
| 26 | +############################################################### |
| 27 | + |
| 28 | + |
| 29 | +############################################################### |
| 30 | +# COMMIT CHECK # |
| 31 | +############################################################### |
| 32 | + |
| 33 | +--------------------------------------------------------------- |
| 34 | +Targeting commit: e3e45889b |
| 35 | +--------------------------------------------------------------- |
| 36 | +#123: Add my cool feature |
| 37 | +--------------------------------------------------------------- |
| 38 | +``` |
| 39 | + |
| 40 | +Next step is selecting target that should be run on CI: |
| 41 | + |
| 42 | +```bash |
| 43 | + |
| 44 | +############################################################### |
| 45 | +# DEPLOY TARGET SELECTION # |
| 46 | +############################################################### |
| 47 | + |
| 48 | +-------------- |
| 49 | +| TryOutApps | |
| 50 | +-------------- |
| 51 | + |
| 52 | +[0] All |
| 53 | +[1] Test |
| 54 | +[2] Develop |
| 55 | +[3] Simulation |
| 56 | +[4] Production |
| 57 | + |
| 58 | +================== |
| 59 | + |
| 60 | +--------------------- |
| 61 | +| APP STORE CONNECT | |
| 62 | +--------------------- |
| 63 | + |
| 64 | +[5] App Store |
| 65 | + |
| 66 | +Enter number in square brackets: |
| 67 | +``` |
| 68 | + |
| 69 | +After selecting the target, script will check app version from the latest tag found on current branch. New version can be always set by typing it in console. If preselected version is correct one, just hit enter and script will continue with getting and calculating the next build number. |
| 70 | + |
| 71 | +```bash |
| 72 | +############################################################### |
| 73 | +# APP VERSION # |
| 74 | +############################################################### |
| 75 | + |
| 76 | +Press enter to use last known version: 2.4.0. (or enter different version) |
| 77 | +Getting next build number... |
| 78 | + |
| 79 | +Next app version is: v2.4.0-6029 |
| 80 | +``` |
| 81 | + |
| 82 | +Last step is to add the changelog. When creating the tag, console will open preselected text editor where changelog can be added. Keep in mind that closing that editor without entered changelog will result in the script termination. |
| 83 | + |
| 84 | +```bash |
| 85 | +############################################################### |
| 86 | +# CHANGELOG # |
| 87 | +############################################################### |
| 88 | + |
| 89 | +------------------------------------------------------------ |
| 90 | +Enter changelog message... |
| 91 | +------------------------------------------------------------ |
| 92 | +``` |
| 93 | + |
| 94 | +If everything is done correctly, confirmation step will be shown with the summary of selected options: |
| 95 | + |
| 96 | +```bash |
| 97 | +############################################################### |
| 98 | +# DEPLOY # |
| 99 | +############################################################### |
| 100 | + |
| 101 | +--------------------------------------------------------------- |
| 102 | + ~ CONFIGURATION ~ |
| 103 | + |
| 104 | +Target: 1. internal-test |
| 105 | +Version: v2.4.0-6029 |
| 106 | +Tag: internal-test/v2.4.0-6029 |
| 107 | + |
| 108 | +Changelog: |
| 109 | +New features: |
| 110 | + |
| 111 | +* first |
| 112 | +* second |
| 113 | +--------------------------------------------------------------- |
| 114 | + |
| 115 | +Is configuration correct for the CI deployment? [y/n] |
| 116 | +``` |
| 117 | + |
| 118 | +At the end, tag is created and pushed to the remote. |
| 119 | + |
| 120 | +## Contributing |
| 121 | + |
| 122 | +Feedback and code contributions are very much welcome. Just make a pull request with a short description of your changes. By making contributions to this project you give permission for your code to be used under the same license. |
| 123 | + |
| 124 | +## Credits |
| 125 | + |
| 126 | +Maintained and sponsored by [Infinum](http://www.infinum.com). |
| 127 | +<a href='https://infinum.com'> |
| 128 | + <img src='https://infinum.com/infinum.png' href='https://infinum.com' width='264'> |
| 129 | +</a> |
0 commit comments