Skip to content

Gong-MFZ-Aware_Pushkar-Kakade_Resubmission-2 #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
include .env

# export values in .env to be used in the shell scripts
export $(shell sed 's/=.*//' .env)

default:
$(MAKE) build

deps:
cd code && npm ci
.PHONY: deps

build: deps
cd code && npm run build
.PHONY: build

auth:
devrev profiles authenticate --org $(DEV_ORG) --usr $(USER_EMAIL) --expiry 7 # days

.PHONY: auth

deploy: auth
./code/scripts/deploy.sh
.PHONY: deploy

# Removes the latest snap-in from the org. This is useful when you want to
# re-deploy the same snap-in to the same org.
uninstall:
./code/scripts/cleanup.sh
.PHONY: uninstall
67 changes: 53 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,53 @@
## Partner Workshop Submission

1. Clone this repo: https://github.com/devrev/partner-workshop-submissions
2. Create a branch locally: git commit -b CustomerName_YourName_ProblemStatementNumber
3. Add your code folder here.
4. Commit and Push your code
5. Raise a PR from your branch to main

Also, Dashboard is part of Snap-in, so it doesn’t need any other code repo.
Guidelines:
- You just need to share the code repo with the snap-in. The dashboard should be part of the snap-in only.
- Screenshots of the setup and documentation are not required.
- There are no additional requirements.
- You should put the code in the repo and share it with us.
# ADaaS Template

This GitHub repository provides a template with example code to implement an Airdrop as a Service (ADaaS) Snap-in.

## Prerequisites

1\. Install [DevRev CLI](https://developer.devrev.ai/snapin-development/references/cli-install) by following the instructions as per the Operating System.

2\. Install [jq](https://jqlang.github.io/jq/download/).

## Build, Deploy and Run

1\. Create a new repository:

- Create a new repository from this template by clicking the "Use this template" button in the upper right corner and then "Create a new repository".
- The repository name must start with `airdrop-` (e.g., `airdrop-<external system>-snap-in`).

2\. Open the project in your IDE and set up project environment variables, by following these steps:

- Rename `.env.example` to `.env`.
- In `.env` set the slug of your organization, and your email.

4\. Build the Snap-in using the following command:

```bash
make build
```

5\. Deploy the Snap-in to the organization:

```bash
make deploy
```

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.

6\. After the Snap-in draft is created, install the Snap-in in the DevRev UI (`Settings` -> `Snap-ins` -> `Install snap-in`).

7\. Start the import (`Imports` -> `Start import` -> `<your Snap-in>`).

## Common Pitfalls

#### Q: `Conflict` error after the `Creating snap-in package...` output during `make deploy`.

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`.

#### Q: Snap-in version `build/deployment failed` after the `Waiting for snap-in version to be ready...` message

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`

### Q: `Token is expired` when deploying or cleaning up.

A: Authentication token to the `DEV_ORG` has expired. Run `make auth` to reconnect to the organization.
4 changes: 4 additions & 0 deletions code/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.env
extracted_files
1 change: 1 addition & 0 deletions code/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
1 change: 1 addition & 0 deletions code/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/**/*
15 changes: 15 additions & 0 deletions code/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxSingleQuote": false,
"arrowParens": "always",
"proseWrap": "never",
"htmlWhitespaceSensitivity": "strict",
"endOfLine": "lf",
"organizeImportsSkipDestructiveCodeActions": true
}
6 changes: 6 additions & 0 deletions code/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
};
4 changes: 4 additions & 0 deletions code/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
6 changes: 6 additions & 0 deletions code/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"execMap": {
"ts": "ts-node",
"watch": ["src"]
}
}
Loading