LogoLogo
Join our community
  • AdminJS
  • Contribute
  • Demo
  • Addons Marketplace
  • Installation
    • Getting started
    • Plugins
      • Adonis
      • Express
      • Nest
      • Fastify
      • Hapi
      • Koa
      • Community Plugins
        • FeathersJS
        • AdonisJS
      • Matrix
    • Adapters
      • TypeORM
      • Sequelize
      • Prisma
      • MikroORM
      • Objection
      • SQL
      • Mongoose
      • Community Adapters
        • AdonisJS
    • What's new in v7?
    • Migration Guide v7
  • Basics
    • Resource
    • Action
    • Property
    • Features
      • Relations
      • Upload
      • Logger
      • Import & Export
      • Password
      • Leaflet Maps
      • Writing your own features
    • API
      • List
      • New
      • Search
      • Show
      • Edit
      • Delete
      • Bulk Delete
    • Themes
    • Authentication
      • FirebaseAuthProvider
      • MatrixAuthProvider
  • How to write an addon?
  • UI Customization
    • Writing your own Components
    • Overwriting CSS styles
    • Dashboard customization
    • Changing the form view
    • Storybook
  • Tutorials
    • Role-Based Access Control
    • Internationalization (i18n)
    • Content Management System
    • Custom components library
    • Custom component internationalization
  • FAQ
    • PDF Generator
    • Charts
    • Forgot Password
  • ⚠️Legacy documentation
Powered by GitBook
On this page
  • Requierments
  • Installation
  • Configuration
  • Options
  • Example
  • Starting the application
  • Commands
  • #create
  • #deploy
  1. Deployment

Creating and Deploying the application using CLI

AdminJS Cloud Hosting comes with a CLI tool which you can use locally or inside your CI/CD to deploy your application.

Requierments

Before you will make installation and configuration steps make sure you met all the requirements below.

  • Node.js >=18 (we recommend latest LTS version)

  • yarn installed globally (npm install --global yarn)

Installation

$ yarn global add @adminjs/cloud-cli

Configuration

@adminjs/cloud-cli relies on configuration file to be present in your source code. The default file name is adminjs-cloud.json but you can provide a custom file path using --config option in a CLI command.

Options

include        string[]        A list of files/directories you wish to deploy.

Example

adminjs-cloud.json
{
  "include": [
    "public",
    "dist",
    "src",
    ".env",
    "package.json",
    "tsconfig.json",
    "yarn.lock"
  ]
}

Starting the application

Currently, AdminJS Cloud Hosting requires start script to be present in your package.json file. This is the command you use to start your application:

package.json
{
  ...,
  "scripts": {
    ...,
    "start": "node app.js"
  }
}

In the future, we plan to extend application's configuration so that you can provide a custom start command.

Commands

As of version 1.2.0 the CLI only allows you to create and deploy your application.

#create

The create command allows you to create basic AdminJS application with basic authentication. The CLI generates only code for running it, you have to use commands yarn && yarn build && yarn start to check if setup is complete succesfully, if you follow all the steps correctly.

Parameters

name          string        required        The name of your application
database      string        required        The connection string to database eg. `postgres://adminjs:adminjs@localhost:5432/adminjs`
apiKey        string        required        Your API Key
apiSecret     string        required        Your API Secret
config        string        optional        Path to your configuration file (relative to PWD)

Usage

$ adminjs-cloud create --name=<string> --database=<string> --apiKey=<string> --apiSecret=<string>

#deploy

The deploy command allows you to deploy your source code. The CLI assumes your code is already built and whatever files you choose to include in your configuration file are enough to start your application.

Parameters

apiKey        string        required        Your API Key
apiSecret     string        required        Your API Secret
config        string        optional        Path to your configuration file (relative to PWD)

Usage

$ adminjs-cloud deploy --apiKey=<string> --apiSecret=<string> --config=[string]

Last updated 1 year ago

To use @adminjs/cloud-cli you must first request an application in page and generate an API Key & API Secret.

☁️
Pricing