INTEGRATE

Buildkite

You can use the Phase CLI to effortlessly inject or expose secret inside your CI pipelines or jobs.

Prerequisites

  • Have signed up for the Phase Console and created an application.
  • PHASE_SERVICE_TOKEN.

For detailed cli install options, please see: Installation

Setting PHASE_SERVICE_TOKEN:

  1. In your Buildkite Dashboard, navigate to the desired pipeline's settings.
  2. Click on Environment Variables.
  3. Add a new environment variable named PHASE_SERVICE_TOKEN and set its value.

Single staged

In your pipeline.yml:

steps:
  - label: 'Prepare'
    command:
      - 'curl -fsSL https://pkg.phase.dev/install.sh | bash'
      - 'export $(phase secrets export --app "my application name" --env prod DOCKERHUB_USERNAME DOCKERHUB_TOKEN | xargs)'

  - label: 'Build and Push'
    command:
      - 'docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_TOKEN'
      - 'docker build -t my-image .'
      - 'docker push my-image:latest'