2021-01-01 18:43:34 +01:00
|
|
|
# One click app release automation
|
|
|
|
|
|
|
|
This directory contains scripts for automating the release of Zulip one click apps.
|
|
|
|
|
|
|
|
## DigitalOcean 1-Click Application
|
|
|
|
`prepare_digital_ocean_one_click_app_release.py` creates the image of DigitalOcean 1-Click
|
2021-08-26 04:14:59 +02:00
|
|
|
app from the latest Zulip release (fetched from https://download.zulip.com/server/). It will
|
2021-01-01 18:43:34 +01:00
|
|
|
also create a test droplet from the image and send the image and droplet
|
|
|
|
details to a pre-configured Zulip stream. Anyone, whose key is added to the
|
|
|
|
Zulip DigitalOcean team can SSH into the droplet for testing.
|
|
|
|
|
|
|
|
### Running as GitHub action
|
|
|
|
|
|
|
|
`.github/workflows/update-oneclick-apps.yml` is configured to invoke
|
|
|
|
`prepare_digital_ocean_one_click_app_release.py` as a GitHub action during each Zulip
|
|
|
|
server release.
|
|
|
|
|
|
|
|
You also need to set the following secrets in your GitHub repository to make the action
|
|
|
|
work correctly. These secrets are passed as environment variables to the GitHub action.
|
|
|
|
|
2021-08-20 21:45:39 +02:00
|
|
|
- `ONE_CLICK_ACTION_DIGITALOCEAN_API_KEY` - DigitalOcean API key used for creating droplets, snapshots etc.
|
|
|
|
- `ONE_CLICK_ACTION_ZULIP_BOT_API_KEY` - The API key of the Zulip bot used for sending messages.
|
|
|
|
- `ONE_CLICK_ACTION_ZULIP_BOT_EMAIL` - The email of the Zulip bot.
|
2021-01-01 18:43:34 +01:00
|
|
|
|
|
|
|
Also pass the following as environment variables in `.github/workflows/update-oneclick-apps.yml`.
|
2021-08-20 21:45:39 +02:00
|
|
|
- `PYTHON_DIGITALOCEAN_REQUEST_TIMEOUT_SEC` - This configures the maximum number of seconds
|
docs: Add missing space to compound verbs “log in”, “set up”, etc.
Noun: backup, checkout, cleanup, login, logout, setup, shutdown, signup,
timeout.
Verb: back up, check out, clean up, log in, log out, set up, shut
down, sign up, time out.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-04-25 23:05:38 +02:00
|
|
|
to wait before the requests made by `python-digitalocean` time out. If not configured, it's
|
2021-01-01 18:43:34 +01:00
|
|
|
common for the requests to take 20+ minutes before getting timed out.
|
|
|
|
|
|
|
|
### Verifying the one click app image
|
2021-08-20 21:45:39 +02:00
|
|
|
- The action will send the image name and test droplet details to the stream configured in the
|
2021-01-01 18:43:34 +01:00
|
|
|
above steps.
|
2021-08-20 21:45:39 +02:00
|
|
|
- SSH into the test droplet by following the instructions in the message. In order to do this,
|
2021-06-03 18:16:48 +02:00
|
|
|
you need to add your SSH key to the team.
|
2021-08-20 21:45:39 +02:00
|
|
|
- After logging into the test droplet, exit the installer and run the following script.
|
2021-01-01 18:43:34 +01:00
|
|
|
|
2021-06-03 18:03:37 +02:00
|
|
|
https://raw.githubusercontent.com/digitalocean/marketplace-partners/master/scripts/99-img-check.sh
|
2021-01-01 18:43:34 +01:00
|
|
|
|
|
|
|
This script checks whether the image created is valid. It is also run by the DigitalOcean team
|
|
|
|
before they approve the image submission in the one click app marketplace.
|
2021-08-20 21:45:39 +02:00
|
|
|
- If there are no errors (you can ignore most of the warnings), exit the SSH connection and
|
2021-01-01 18:43:34 +01:00
|
|
|
reconnect.
|
2021-08-20 21:45:39 +02:00
|
|
|
- Populate the details asked by the installer and verify that the installer completes successfully.
|
2021-06-03 18:16:48 +02:00
|
|
|
One error is expected:
|
|
|
|
```
|
|
|
|
User root has a populated authorized_keys file in /root/.ssh/authorized_keys
|
|
|
|
```
|
|
|
|
The key in that file will be the SSH key you've authenticated with.
|
|
|
|
If there are other errors see the section below.
|
2021-08-20 21:45:39 +02:00
|
|
|
- Use the link generated by the installer to create a new Zulip organization. Do some basic
|
2021-01-01 18:43:34 +01:00
|
|
|
testing like sending a bunch of messages and reloading the webpage.
|
2021-08-20 21:45:39 +02:00
|
|
|
- If there are no issues, submit the image in the
|
2021-01-01 18:43:34 +01:00
|
|
|
[DigitalOcean vendor portal](https://marketplace.digitalocean.com/vendorportal). You need to be
|
|
|
|
added to the vendor portal team for doing this. Ask Tim to add you if required. During the submission,
|
|
|
|
make sure to update the blog post URL if it's a major release.
|
2021-08-20 21:45:39 +02:00
|
|
|
- Keep checking the vendor portal for change in status of the submission. DigitalOcean does nominally send
|
2021-01-01 18:43:34 +01:00
|
|
|
emails when there are updates on the submission, but we have found the emails to not always arrive.
|
2021-08-20 21:45:39 +02:00
|
|
|
- If there are any issues with submission, rebuild the image by manually invoking the script and
|
2021-01-01 18:43:34 +01:00
|
|
|
resubmit. The issues we have seen mostly in the past are caused by the dependencies getting outdated
|
|
|
|
by the time the DigitalOcean team run the checks. In that case you have to just rebuild the image
|
|
|
|
by invoking the script.
|
2021-08-20 21:45:39 +02:00
|
|
|
- Delete the test droplet `oneclickapp-{release_version}-test` after you have completed testing
|
2021-01-01 18:43:34 +01:00
|
|
|
by going to the [DigitalOcean Zulip team account](https://cloud.digitalocean.com/droplets?i=0242e0).
|
|
|
|
If there are other existing test droplets with the same name format but with with older release versions
|
|
|
|
feel free to delete them as well. These droplets are also tagged with `github-action` and`temporary`
|
|
|
|
tags.
|
|
|
|
|
|
|
|
**Errors**
|
|
|
|
|
|
|
|
If there are any errors while setting up the one click app installer, you have three options
|
2021-08-20 21:45:39 +02:00
|
|
|
- Include the fix in the Fabric script that setups the installer.
|
2021-01-01 18:43:34 +01:00
|
|
|
[01-initial-setup](https://raw.githubusercontent.com/zulip/marketplace-partners/master/marketplace_docs/templates/Fabric/scripts/01-initial-setup)
|
|
|
|
file should be a good place to include the fix. See
|
|
|
|
[zulip/marketplace-partners#4](https://github.com/zulip/marketplace-partners/pull/4/files) for an
|
|
|
|
example fix.
|
2021-08-20 21:45:39 +02:00
|
|
|
- Wait for the next release to fix the error.
|