Skip to content

Instantly share code, notes, and snippets.

@velp
Created April 3, 2020 10:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velp/17799756c08f35fb2966324447abd9f7 to your computer and use it in GitHub Desktop.
Save velp/17799756c08f35fb2966324447abd9f7 to your computer and use it in GitHub Desktop.
How to use Jexia application hosting via CURL

How to use Jexia application hosting via CURL

Step 1: set credentials

export JEXIA_EMAIL="<HERE_YOUR_EMAIL>"
export JEXIA_PASSWORD="<HERE_YOUR_PASSWORD>"
export JEXIA_PROJECT="<HERE_YOUR_PROJECT>"

Step 2: get token

export JEXIA_TOKEN=`curl -H "Accept: application/json" -H "Content-Type: application/json" -d '{"email": "'"$JEXIA_EMAIL"'", "password": "'"$JEXIA_PASSWORD"'"}' -X POST "https://services.jexia.com/auth/signin"`

Step 3: get list of applications

curl -H "Authorization: Bearer $JEXIA_TOKEN" -H "Accept: application/json"  -X GET "https://services.jexia.com/project/${JEXIA_PROJECT}/app" | jq .

Step 4: deploy/redeploy application

In follow commands ${JEXIA_APP_ID} is application ID from step 3.

Full deployment (will build the application from the latest version of source code and then deploy it)

curl -v -H "Authorization: Bearer $JEXIA_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"api_key": "", "api_secret": "", "skip_build": false}' "https://services.jexia.com/project/${JEXIA_PROJECT}/app/${JEXIA_APP_ID}/deploy"

Just re-deploy application (to update custom domains or environment variables)

curl -v -H "Authorization: Bearer $JEXIA_TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"api_key": "", "api_secret": "", "skip_build": true}' "https://services.jexia.com/project/${JEXIA_PROJECT}/app/${JEXIA_APP_ID}/deploy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment