Skip to content

Commit a4fd206

Browse files
Add readme
1 parent bc845d3 commit a4fd206

7 files changed

+117
-6
lines changed

Diff for: .editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[{package.json,*.yml}]
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.md]
16+
trim_trailing_whitespace = false

Diff for: .eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.cache
2+
build
3+
**/node_modules/**

Diff for: .eslintrc

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "eslint:recommended",
4+
"env": {
5+
"commonjs": true,
6+
"es6": true,
7+
"node": true,
8+
"browser": false
9+
},
10+
"parserOptions": {
11+
"ecmaFeatures": {
12+
"experimentalObjectRestSpread": true,
13+
"jsx": false
14+
},
15+
"sourceType": "module"
16+
},
17+
"globals": {
18+
"strapi": true
19+
},
20+
"rules": {
21+
"indent": ["error", 2, { "SwitchCase": 1 }],
22+
"linebreak-style": ["error", "unix"],
23+
"no-console": 0,
24+
"quotes": ["error", "single"],
25+
"semi": ["error", "always"]
26+
}
27+
}

Diff for: README.md

+71-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,85 @@
11
# Vercel Deploy
22

3-
Strapi v4 plugin to trigger and monitor a deployment on Vercel
3+
Strapi v4 plugin to trigger and monitor a deployment on Vercel.
4+
5+
![Vercel Deploy Logo](./assets/strapi-vercel-deploy-logo.png "Vercel Deploy Logo")
6+
7+
## Plugin Preview
8+
9+
Home Page:
10+
11+
![Plugin Home Page](./assets/strapi-vercel-deploy-home.png "Plugin Home Page")
12+
13+
Settings Page:
14+
15+
![Plugin Settings Page](./assets/strapi-vercel-deploy-settings.png "Plugin Settings Page")
16+
17+
## Installation
18+
19+
### Install dependency
20+
21+
Run the following command in your Strapi project to install vercel-deploy:
22+
23+
```shell
24+
yarn add strapi-plugin-vercel-deploy
25+
# or
26+
npm i -S strapi-plugin-vercel-deploy
27+
```
28+
29+
### Enable plugin configuration
30+
31+
Open `config/plugins.js` file and add the vercel-deploy entry:
32+
33+
```
34+
module.exports = ({ env }) => ({
35+
"vercel-deploy": {
36+
enabled: true,
37+
},
38+
});
39+
40+
```
41+
42+
### Run
43+
44+
You can now run Strapi:
45+
46+
```
47+
yarn develop
48+
```
49+
50+
You should see the **Vercel Deploy** menu in the left panel.
51+
52+
**N.B.** You _may_ need to run `yarn build` in order to see the new menu entries.
53+
54+
Then you can proceed with the environment config
455

556
## Environment Conifg
657

7-
In order to use the plugin, you need to set the following environment variables:
58+
### Config properties
59+
60+
The plugin is reading the following environment variable to work:
861

962
- `VERCEL_DEPLOY_PLUGIN_HOOK`: Url of the git deploy hook exposed in Vercel.
63+
1064
- You can follow [this](https://vercel.com/docs/git/deploy-hooks) guide to create a deploy hook on Vercel
11-
- Then you can save the hook url as process env variable (e.g. [this](https://devcenter.heroku.com/articles/config-vars) guide is for Heroku)
1265

13-
- `VERCEL_DEPLOY_PLUGIN_API_TOKEN`: API token of your Vercel account used to fetch the list of deployments
66+
- `VERCEL_DEPLOY_PLUGIN_API_TOKEN`: API token of your Vercel account used to fetch the list of deployments
67+
1468
- Access tokens can be created and managed inside your [account settings](https://vercel.com/account/tokens)
15-
- Then you can save the hook url as process env variable (e.g. [this](https://devcenter.heroku.com/articles/config-vars) guide is for Heroku)
1669

1770
- `VERCEL_DEPLOY_PLUGIN_APP_FILTER`: Name of your Vercel App used to filter the list of deployments
1871
- Set the name of your [Vercel App](https://vercel.com/dashboard) to see only the deployments you need
19-
- Then you can save the hook url as process env variable (e.g. [this](https://devcenter.heroku.com/articles/config-vars) guide is for Heroku)
2072

73+
### Local development
74+
75+
For local development, you can add the config properties in your `.env` file:
76+
77+
```
78+
VERCEL_DEPLOY_PLUGIN_HOOK="https://api.vercel.com/v1/integrations/deploy/prj_<deploy-hook>"
79+
VERCEL_DEPLOY_PLUGIN_API_TOKEN="<vercel-api-token>"
80+
VERCEL_DEPLOY_PLUGIN_APP_FILTER="your-app-name-on-vercel"
81+
```
82+
83+
### Server
84+
85+
You can save these values as process env variable on your server (e.g. [this](https://devcenter.heroku.com/articles/config-vars) guide is for Heroku).

Diff for: assets/strapi-vercel-deploy-home.png

359 KB
Loading

Diff for: assets/strapi-vercel-deploy-logo.png

10.5 KB
Loading

Diff for: assets/strapi-vercel-deploy-settings.png

318 KB
Loading

0 commit comments

Comments
 (0)