Deploy without the CLI
hiraiship deploy is a few HTTP requests. This recipe makes them with curl, for a platform or a pipeline that can't run the CLI. You need a key with the developer role in HIRAISHIP_TOKEN.
Create the project
Skip this step if the project exists: get it by slug instead.
Terminal The response holds the project, its
productionenvironment and its default domain. Keep the environment's id:Terminal Pack the source
The source travels as a gzipped tar, base64-encoded. Pack the project directory, not its build output: Hiraiship installs and builds it. Leave out what the CLI leaves out:
node_modules,.git,.hiraishipand.envfiles.Terminal Start the deployment
Terminal The answer is a
202with the deployment,pending(building) orqueued(waiting for a build slot). Keep itsidasDEPLOYMENT_ID. AddgitShaandcommitMessageto the body to see them in the dashboard. On macOS,base64 -i source.tgzreplacesbase64 -w0 source.tgz.Follow the build
Terminal The stream ends with a
doneevent. WhenstatusissuccessanddispatchStatusislive, the deployment serves traffic at itsdeployedUrl. See Streaming for the events, or poll Get a deployment.
Build settings
Hiraiship detects the framework and its commands. To override them for every deployment, update the project's build settings; for one deployment only, add installCommand, buildCommand, outputDir or machine to the deployment's body.