XYZ - Developer Guide
  • Introduction
  • Licence
  • Deploying
    • Local Deployments
  • Access
    • Access Control List (ACL)
    • User account registration
    • Password reset
    • Failed login attempts
  • Environment Settings
    • Hosting
    • Access Control
    • Workspace Connections
    • 3rd party API keys
  • Workspaces
    • Title
    • Documentation
    • Locate
    • Locales
      • Gazetteer
    • Layers
      • Tile Layer
      • PostGIS Data Layers
      • Cluster Layer
      • GeoJSON Layer
      • MapBox Vector Tile (MVT) Layer
      • Grid (Hex) Layer
      • Filter
    • Locations
      • infoj
        • Groups
        • Filter
        • Lookups
        • withSelect
        • Table definition
        • Ordered list
        • Geometry
    • Editing
    • Access Restrictions & Filter
    • Workspace Checks
  • Routes
    • / (root)
    • /proxy/request
    • /api
      • /gazetteer
        • /autocomplete
        • /googleplaces
      • /layer
        • /cluster
        • /extent
        • /geojson
        • /grid
        • /mvt/:z/:x/:y
      • /location
        • /edit
          • /delete
          • /image/delete
          • /image/upload
          • /draw
          • /draw/catchment
          • /catchment/create
          • /catchment/delete
          • /update
        • /select
          • /id
          • /cluster
          • /latlng/contains
          • /latlng/nnearest
          • /latlng/intersects
          • /aggregate
        • /field/range
    • /auth
      • /login
      • /register
      • /token
        • /api
        • /renew
      • /user
        • /admin
        • /verify
        • /approve
        • /update
        • /delete
    • /workspace
      • /get
      • /load
      • /admin
      • /admin/json
  • Infrastructure
    • _xyz
      • host
      • layer
      • location
      • mapview
      • tableview
    • Dependencies
      • Webpack
      • SASS
    • Testing
    • Security
      • JWT token
      • Strategy
      • SQL Injections
    • Server
    • Client
Powered by GitBook
On this page
  • Deploying serverless with Zeit Now
  • Deploying on a Ubuntu server
  • Deploying on AWS (Elastic Beanstalk)

Deploying

PreviousLicenceNextLocal Deployments

Last updated 6 years ago

Deploying serverless with Zeit Now

Node/npm will be required on your machine in order to deploy XYZ. Installing node will vary depending on your operating system. npm is required to install the .

With the Zeit Now CLI installed an XYZ instance can be deployed directly from the GitHub repository.

now geolytix/xyz

This will deploy the XYZ master branch from the GitHub repository with zero configurations.

You can now follow the link from the now deployment output and will see the zero configuration map in your browser.

now geolytix/xyz \
-e DIR="/demo" \
-e ALIAS=”geolytix.xyz” \
-e PRIVATE="postgres://user:***@pg.xyz.geolytix.net:5432/xyz|demo.users" \
-e SECRET="***" \
-e TRANSPORT="smtps:xyz%40geolytix.co.uk:***@smtp.gmail.com" \
-e WORKSPACE="postgres://user:***@pg.xyz.geolytix.net:5432/xyz|demo.settings" \
-e DBS_XYZ="postgres://user:***@pg.xyz.geolytix.net:5432/xyz" \
-e KEY_MAPBOX="access_token=**.***.***"

Deploying on a Ubuntu server

pm2 start myapplication.json

Deploying on AWS (Elastic Beanstalk)

Another requirement before deploying will be to create AWS access keys to your AWS resources. Log into the AWS Console, and seach under find services for 'IAM'.

Navigate to the 'Users' and then select 'Add User'

Provide a username and give the user the access type of 'Programmatic access', hit next.

The next step will be to attach a Policy to the User. The Policy that we are going to attach will be the 'AdministratorAccess' . Hit next once complete. Skip the add tags section. And then hit Create User

Once the user is created the Access Key ID and Secret Access Key will be available for use.

Keep these keys on hand, as we will need them later on to configure the CLI.

To ensure that you have installed EB CLI correctly run the following : eb --version

Next navigate to the directory of the XYZ application that is ready for deployment. Once at the root directory we need to initiate a EB CLI configuration. eb init

The first setting for the deployment will be to select a region, where the application will be deployed.

The next step will be to set the aws-access-id and secret.

The Next step will to select a current application or create a new application. The next setting will be to make use of CodeCommit. This will depend on whether or not you make use of this.

The next step will be to create a .ebignore file that will upload only files that are not ignored, similar to a .gitignore. Create this in the root of your application.

Use the following in the .ebignore

.idea/
.vscode/
.env
.DS_Store
.sass-cache/
.git
node_modules
public/css/.sass-cache/

The next step is to define the instance environment properties. These will differ from instance to instance. These settings need to go into a directory called .ebextensions create a file with the *.config extension. This file is what AWS will read to create environment properties that are crucial to the XYZ framework. The configuration makes use of YAML.

option_settings:
  - option_name: DIR
    value: /test
  - option_name: ALIAS
    value: geolytix.xyz
  - option_name: PRIVATE
    value: 
  - option_name: SECRET
    value: 
  - option_name: TRANSPORT
    value: 
  - option_name: WORKSPACE
    value: 
  - option_name: DBS_XYZ
    value: 
  - option_name: CLOUDINARY
    value: 
  - option_name: KEY_GOOGLE
    value: 
  - option_name: KEY_HERE
    value: 
  - option_name: KEY_MAPBOX
    value: option_name: LOG_LEVEL
    value: info

Once created, we are ready to deploy. To create an instance use the following command eb create {name_of_instance}

If all goes well, then once the process is complete you can open exacly what you just deployed with the command eb open

For future deployments, you would make use of the command eb deploy {name_of_instance}

can be added using the -e option. These environment variables which are available to the Node process allow to configure a custom environment for a deployment.

For deployments on Ubuntu we use the process manager to run multiple instances of the framework on different ports on the same server. Environment settings for PM2 instances can be provided from a JSON document.

The first requirement will be to become an AWS customer, if you are not already signed up follow the following link to .

The next step will be to install the Elastic Beanstalk Command Line Interface (EB CLI). There are different requirments for various operating systems. The following will provide you with an overview specific to your .

Zeit Now environment variables
PM2
Sign up
environment
Zeit Now CLI
Navigating to IAM
IAM User Creation
User Policy Association
User Creation
User Creation Access Key and Secret Access Key
EB CLI Version
Region Selection
Security Details