|
| 1 | +# ADaaS Template |
| 2 | + |
| 3 | +This GitHub repository provides a template with example code to implement an Airdrop as a Service (ADaaS) Snap-in . |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +1\. Install [DevRev CLI](https://developer.devrev.ai/snapin-development/references/cli-install) by following the instructions as per the Operating System. |
| 8 | + |
| 9 | +2\. Install [jq](https://jqlang.github.io/jq/download/). |
| 10 | + |
| 11 | +## Build, Deploy and Run |
| 12 | + |
| 13 | +1\. Clone Repository: |
| 14 | + |
| 15 | +- Either clone this repository or create a new repository from it by clicking the "Use this template" button above. |
| 16 | +- Set the desired repository name for your own copy (e.g., `<organization>-<external system>-adaas`). |
| 17 | + |
| 18 | +2\. Open the project in your IDE and set up project environment variables, by following these steps: |
| 19 | + |
| 20 | +- Rename `.env.example` to `.env`. |
| 21 | +- In `.env` set the slug of your organization, and your email. |
| 22 | + |
| 23 | +4\. Build the Snap-in using the following command: |
| 24 | + |
| 25 | +```bash |
| 26 | +make build |
| 27 | +``` |
| 28 | + |
| 29 | +5\. Deploy the Snap-in to the organization: |
| 30 | + |
| 31 | +```bash |
| 32 | +make deploy |
| 33 | +``` |
| 34 | + |
| 35 | +NOTE: This process may take some time. Command authenticates you to the org using the DevRev CLI, creates a Snap-in package, its Snap-in version, and finally the Snap-in draft. |
| 36 | + |
| 37 | +6\. After the Snap-in draft is created, install the Snap-in in the DevRev UI (`Settings` -> `Snap-ins` -> `Install snap-in`). |
| 38 | + |
| 39 | +7\. Start the import (`Imports` -> `Start import` -> `<your Snap-in>`). |
| 40 | + |
| 41 | +## Common Pitfalls |
| 42 | + |
| 43 | +#### Q: `Conflict` error after the `Creating snap-in package...` output during `make deploy`. |
| 44 | + |
| 45 | + A: Snap-in package with the same slug already exists. Override the `SNAP_IN_SLUG` variable by explicitly updating the variable in `scripts/vars.sh`. |
| 46 | + |
| 47 | +#### Q: Snap-in version `build/deployment failed` after the `Waiting for snap-in version to be ready...` message |
| 48 | + |
| 49 | + A: The snap-in version could not be built. Check the logs by running the DevRev CLI command `devrev snap_in_package logs`. For prettier UI, pipe the output to `jq` |
| 50 | + |
| 51 | +### Q: `Token is expired` when deploying or cleaning up. |
| 52 | + |
| 53 | + A: Authentication token to the `DEV_ORG` has expired. Run `make auth` to reconnect to the organization. |
0 commit comments