v1
Double column
API
CLI
JS Client

Jobs /

Update job deployment

Updates the deployment settings of the given job.

Required permission

Project > Services > Deployment > Update Deployment

Path parameters

    • projectId

      string required

      ID of the project

    • jobId

      string required

      ID of the job

Request body

  • {object}

    An external deployment

    • external

      {object} required
      • imagePath

        string required

        Image to be deployed. When not deploying from Dockerhub the URL must be specified.

        pattern
        ^(?:(?:https?:\/\/)?([a-zA-Z0-9\-]+\.[a-zA-Z0-9\.\-]+)(\/v1)?)?(?:\/)?([a-zA-Z/-9\.\-_]+)(?:\:([a-zA-Z/-9\.\-_\:]+)|\@([a-zA-Z/-9\.\-_\:]+))$
      • credentials

        string

        ID of the saved credentials to use to access this external image.

        pattern
        ^[A-Za-z0-9-]+$
OR
  • {object}

    An internal deployment

    • internal

      {object} required
      • id

        string

        ID of the build service to deploy

        pattern
        ^[A-Za-z0-9-]+$
      • branch

        string

        Branch to deploy

      • buildSHA

        Commit SHA to deploy, or 'latest' to deploy the most recent commit

      • buildId

        string

        ID of the build that should be deployed

API
CLI
JS Client

POST /v1/projects/{projectId}/jobs/{jobId}/deployment

Example request

Request body
An external deployment
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"external":{"imagePath":"nginx:latest","credentials":"example-credentials"}}' \
  http://api.northflank.com/v1/projects/{projectId}/jobs/{jobId}/deployment
OR
An internal deployment
curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"internal":{"id":"example-build-service","branch":"master","buildSHA":"latest","buildId":"premium-guide-6393"}}' \
  http://api.northflank.com/v1/projects/{projectId}/jobs/{jobId}/deployment

Example response

200 OK

success

© 2022 Northflank Ltd. All rights reserved.