CircleCI
Prodvana supports CircleCI directly via a dedicated Orb.
Getting Started
- Enable "Uncertified Orbs" for your CircleCI Project.
Uncertified?!
Enabling uncertified orbs sounds scary, but don't worry! It just means our orb was not written by CircleCI.
According to CircleCI: "Currently, only orbs created by CircleCI are considered certified. Any other orbs, including partner orbs, and not certified."
This Orb was created by Prodvana; you can find the code here: https://github.com/prodvana/prodvana-orb
- Find or add the
orbs
key to your.circleci/confg.yml
file and add the prodvana orb:
version: 2.1
orbs:
prodvana: prodvana/[email protected]
-
Create a new Prodvana API Token and add it to CircleCI as an Environment Variable Secret named
PRODVANA_API_TOKEN
. -
You're now ready to use the Prodvana orb! See Examples below or the orb documentation for usage examples.
Examples
Push Service with One Image
version: 2.1
orbs:
prodvana: prodvana/[email protected]
aws-ecr: circleci/[email protected]
jobs:
deploy:
docker:
- image: cimg/base:stable
steps:
- checkout
- aws-ecr/build-and-push-image:
create-repo: true
path: api
tag: "${CIRCLE_SHA1},latest"
repo: demo_api
- prodvana/push:
org: my-org
app: my-app # pass 'default' here if you never created an app, but instead configured your release channels using `pvnctl release-channels configure ...`
service: my-service
docker-image: ${AWS_ECR_REGISTRY_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/demo_api:${CIRCLE_SHA1}
# optional list of Release Channels that this deploy
# must succeed in before proceeding
wait-channels: dogfood,staging
Push Service with Multiple Programs
If you have a service with multiple programs, you can pass docker-image
a comma separated list of program_name=image_url
; e.g, <program_name_1>=<image_url_1>,<program_name_2>=<image_url_2>,...
.
version: 2.1
orbs:
prodvana: prodvana/[email protected]
aws-ecr: circleci/[email protected]
jobs:
deploy:
docker:
- image: cimg/base:stable
steps:
- checkout
- aws-ecr/build-and-push-image:
create-repo: true
path: api
tag: "${CIRCLE_SHA1},latest"
repo: demo_api
- aws-ecr/build-and-push-image:
create-repo: true
path: api_sidecar
tag: "${CIRCLE_SHA1},latest"
repo: demo_api_sidecar
- prodvana/push:
org: my-org
app: my-app # pass 'default' here if you never created an app, but instead configured your release channels using `pvnctl release-channels configure ...`
service: my-service
# when passing multiple images, use comma-separated pairs of program=image, e.g.
# <program_name_1>=<image_url_1>,<program_name_2>=<image_url_2>,...
docker-image: api=${AWS_ECR_REGISTRY_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/demo_api:${CIRCLE_SHA1},api_sidecar=${AWS_ECR_REGISTRY_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/demo_api_sidecar:${CIRCLE_SHA1}
# optional list of Release Channels that this deploy
# must succeed in before proceeding
wait-channels: dogfood,staging
Push Service with Different Images By Release Channel
If you have a service that needs different images in each Release Channel, you can pass docker-image-by-release-channel
a comma separated list of release_channel=image_url
; e.g, <release_channel_1>=<image_url_1>,<release_channel_2>=<image_url_2>,...
.
If your service has multiple programs, you can pass per program images like this:
<release_channel_1>=<program_1>=<image_url_1>|<program_2>=<image_url_2>
version: 2.1
orbs:
prodvana: prodvana/[email protected]
aws-ecr: circleci/[email protected]
jobs:
deploy:
docker:
- image: cimg/base:stable
steps:
- checkout
- aws-ecr/build-and-push-image:
create-repo: true
path: api
tag: "${CIRCLE_SHA1},latest"
repo: demo_api_staging
- aws-ecr/build-and-push-image:
create-repo: true
path: api
tag: "${CIRCLE_SHA1},latest"
repo: demo_api_dogfood
- prodvana/push:
org: my-org
app: my-app # pass 'default' here if you never created an app, but instead configured your release channels using `pvnctl release-channels configure ...`
service: my-service
docker-image-by-release-channel: dogfood=${AWS_ECR_REGISTRY_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/demo_api_dogfood:${CIRCLE_SHA1},staging=${AWS_ECR_REGISTRY_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/demo_api_staging:${CIRCLE_SHA1}
# optional list of Release Channels that this deploy
# must succeed in before proceeding
wait-channels: dogfood,staging
Updated 7 months ago