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 |
|
7 | If 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 |
|
9 | All commands should be run in the project root directory - i.e. one level above `marketplace_builder` directory.
|
10 |
|
11 | ### Requirements
|
12 |
|
13 | marketplace-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 |
|
17 | If 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 |
|
21 | If 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 |
|
29 | Authentication is done with your **Partner Portal** account credentials.
|
30 | See 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 |
|
32 | To add your environment to a config file, run the `env add` command, and authenticate with your **Partner Portal** credentials:
|
33 |
|
34 | ```
|
35 | marketplace-kit env add [environment] --email <your email> --url <your marketplace url>
|
36 | ```
|
37 |
|
38 | Example: `marketplace-kit env add staging --email myemail@example.com --url https://example.com`
|
39 |
|
40 | Configuration for environments lays down in `.marketplace-kit` file.
|
41 |
|
42 | ### Syncing changes
|
43 |
|
44 | ```
|
45 | marketplace-kit sync [environment]
|
46 | ```
|
47 |
|
48 | Example: `marketplace-kit sync staging`
|
49 |
|
50 | Enables 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 | ```
|
55 | marketplace-kit deploy [environment]
|
56 | ```
|
57 |
|
58 | Example: `marketplace-kit deploy staging`
|
59 |
|
60 | Deploys 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 |
|
64 | Force 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 | ```
|
67 | marketplace-kit deploy [environment] -f
|
68 | ```
|
69 |
|
70 | Example: `marketplace-kit deploy staging -f`
|
71 |
|
72 | ### Listing environments
|
73 |
|
74 | If you forgot know what your environments are named or the url that is corresponding to any name, use:
|
75 |
|
76 | ```
|
77 | marketplace-kit env list
|
78 | ```
|
79 |
|
80 | ### Initializing required directory structure
|
81 |
|
82 | If you need to create new project from scratch you can init directory structure using:
|
83 |
|
84 | ```
|
85 | marketplace-kit init
|
86 | ```
|
87 |
|
88 | It will download directory structure from official repository and extract it in your current directory.
|
89 |
|
90 | We will try to keep it up to date and also keep it as useful as possible.
|
91 | If 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 |
|
95 | To start http server locally that will serve GUI use:
|
96 |
|
97 | ```
|
98 | marketplace-kit gui serve [environment]
|
99 | ```
|
100 |
|
101 | Example: `marketplace-kit gui serve staging`
|
102 |
|
103 | #### GraphQL Browser
|
104 |
|
105 | To explore your instance database using graphql open [http://localhost:3333/gui/graphql](http://localhost:3333/gui/graphql) in your web browser.
|
106 |
|
107 | In the right sidebar there is a schema documentation should you need it.
|
108 |
|
109 | #### Resources editor
|
110 |
|
111 | To list, edit and create resources open [http://localhost:3333/gui/editor](http://localhost:3333/gui/) in your web browser.
|