UNPKG

4.33 kBMarkdownView Raw
1## Overview
2
3[![Greenkeeper badge](https://badges.greenkeeper.io/mdyd-dev/marketplace-kit.svg)](https://greenkeeper.io/)
4
5[Marketplace Kit](https://github.com/mdyd-dev/marketplace-kit) is command line tool, which was developed to allow you to easily deploy your configuration files and assets to the PlatformOS. It expects you to follow a certain file structure in order to correctly communicate with the PlatformOS API. You do not have to use it, however it is highly recommended that you do. It is a CLI tool, hence you are expected to have basic knowledge in working with Terminal.
6
7If you have any feature requests, feedback or problems please head over to the [issues page](https://github.com/mdyd-dev/marketplace-kit/issues) and let us know.
8
9All commands should be run in the project root directory - i.e. one level above `marketplace_builder` directory.
10
11### Requirements
12
13marketplace-kit requires nodejs >= v8 to work properly. [Read more on how to install node on your platform](https://nodejs.org/en/download/).
14
15## Installation and update
16
17If your node is installed for all users you might need to use `sudo` to install npm packages globally:
18
19 sudo npm install -g @platform-os/marketplace-kit
20
21If you are using nvm or node installed on your account, you can omit that:
22
23 npm install -g @platform-os/marketplace-kit
24
25## Usage
26
27### Adding environments and authenticating
28
29Authentication is done with your **Partner Portal** account credentials.
30See this [guide](https://documentation.platform-os.com/get-started/partner-portal/inviting-new-user-to-partner-portal) if you don't have Partner Portal account yet.
31
32To add your environment to a config file, run the `env add` command, and authenticate with your **Partner Portal** credentials:
33
34```
35marketplace-kit env add [environment] --email <your email> --url <your marketplace url>
36```
37
38Example: `marketplace-kit env add staging --email myemail@example.com --url https://example.com`
39
40Configuration for environments lays down in `.marketplace-kit` file.
41
42### Syncing changes
43
44```
45marketplace-kit sync [environment]
46```
47
48Example: `marketplace-kit sync staging`
49
50Enables sync mode - immediately pushes changes made to filesystem to the proper environment. It feels like working on localhost. For obvious reason, it is dangerous to use on production, on a live marketplace - it is recommended to use it only for staging.
51
52### Deploying changes
53
54```
55marketplace-kit deploy [environment]
56```
57
58Example: `marketplace-kit deploy staging`
59
60Deploys all the changes. It is recommended to first deploy to `staging`, test, and only then trigger to production. Effectively, deploy creates a zip file containning all your files and sends it to API. It is then processed in the background. Each zip file is stored by us, in order to allow you to rollback in case something goes wrong.
61
62### Deploying with force flag (`-f` or `--force`)
63
64Force flag is used to override changes made in instance admin. If you see `locked_by_admin` error and you still want to deploy, use `-f` flag.
65
66```
67marketplace-kit deploy [environment] -f
68```
69
70Example: `marketplace-kit deploy staging -f`
71
72### Listing environments
73
74If you forgot know what your environments are named or the url that is corresponding to any name, use:
75
76```
77marketplace-kit env list
78```
79
80### Initializing required directory structure
81
82If you need to create new project from scratch you can init directory structure using:
83
84```
85marketplace-kit init
86```
87
88It will download directory structure from official repository and extract it in your current directory.
89
90We will try to keep it up to date and also keep it as useful as possible.
91If you have any feedback for directory structure go to [github](https://github.com/mdyd-dev/directory-structure) and create an issue.
92
93### Graphical interface
94
95To start http server locally that will serve GUI use:
96
97```
98marketplace-kit gui serve [environment]
99```
100
101Example: `marketplace-kit gui serve staging`
102
103#### GraphQL Browser
104
105To explore your instance database using graphql open [http://localhost:3333/gui/graphql](http://localhost:3333/gui/graphql) in your web browser.
106
107In the right sidebar there is a schema documentation should you need it.
108
109#### Resources editor
110
111To list, edit and create resources open [http://localhost:3333/gui/editor](http://localhost:3333/gui/) in your web browser.