There’s a step for that…

Codefresh has out-of-the box steps for just about everything
with lots of community contributions.

Learn how to create your own

Cloud

Cloud

Copy files to S3 bucket

Use this segment into your codefresh.yml file

Copy to S3:
image: 'codefresh/s3copy'
environment:
- SOURCE="path/to/somefile"
- DESTINATION="s3://path-to-s3-bucket"

Kubernetes

Kubernetes

Deploy to Kubernetes with Canaries

Use this segment into your codefresh.yml file

canaryDeploy:
title: "Deploying new version ${{CF_SHORT_REVISION}}"
image: codefresh/k8s-canary:master
environment:
- WORKING_VOLUME=.
- SERVICE_NAME=my-demo-app
- DEPLOYMENT_NAME=my-demo-app
- TRAFFIC_INCREMENT=20
- NEW_VERSION=${{CF_SHORT_REVISION}}
- SLEEP_SECONDS=40
- NAMESPACE=canary
- KUBE_CONTEXT=myDemoAKSCluster

Deploy to Kubernetes with blue/green sets

Use this segment into your codefresh.yml file

blueGreenDeploy:
title: "Deploying new version ${{CF_SHORT_REVISION}}"
image: codefresh/k8s-blue-green:master
environment:
- SERVICE_NAME=my-demo-app
- DEPLOYMENT_NAME=my-demo-app
- NEW_VERSION=${{CF_SHORT_REVISION}}
- HEALTH_SECONDS=60
- NAMESPACE=colors
- KUBE_CONTEXT=myDemoAKSCluster

Deploy to Kubernetes

Use this segment into your codefresh.yml file

deploy-to-kubernetes:
image: codefresh/cf-deploy-kubernetes
tag: latest
working-directory: ${{initial-clone}}
commands:
- /cf-deploy-kubernetes deployment.yml
environment:
- KUBECONTEXT=my-clusterg@my-staging
- KUBERNETES_NAMESPACE=mynamespace

Deploys to Helm repos, prepares Helm charts

Use this segment into your codefresh.yml file

deploy:
image: codefresh/cfstep-helm:2.9.0
environment:
- CHART_REF=mychart
- RELEASE_NAME=mychart-prod
- KUBE_CONTEXT=kube-prod

Integrations

Integrations

Import external Docker images

Use this segment into your codefresh.yml file

import_images:
title: Importing images ...
description: import Docker images from external registry
image: codefresh/import-images
environment:
- IMAGES= - REGISTRY=
- USERNAME=
- PASSWORD=
- CF_URL=
- CF_API_TOKEN=

Run a Jenkins job

Use this segment into your codefresh.yml file

RunJenkins:
title: Triggering Jenkins Job
image: codefresh/cf-run-jenkins-job
environment:
- JENKINS_URL=http://:
- JENKINS_USER=
- JENKINS_TOKEN=
- JENKINS_JOB=

Slack message sender

Use this segment into your codefresh.yml file

send_slack_message
title: Sending slack message
image: codefresh/slack-message-sender
commands
- send --webhook-url value --message value

Call Codefresh API

Use this segment into your codefresh.yml file

triggerstep:
title: trigger
image: codefresh/cli
commands:
- 'codefresh run -b=${{CF_BRANCH}}'

Use JIRA

Use this segment into your codefresh.yml file

UpdatingJira:
title: Update Jira Issue
image: otomato/jira-cli:alpine
commands:
- yes n | jira-cli update ${JIRAID} --comment 'New docker image otomato/bringon:${{CF_SHORT_REVISION}}. Build log is here ${{CF_BUILD_URL}}' --jira-url ${JIRA_URL} -u ${JIRA_USR} -p ${JIRA_PWD}

Deploy

Deploy

Serverless integration

Use this segment into your codefresh.yml file

package:
image: codefresh/serverless:1.28
title: package serverless service
working_directory: ${{main_clone}}/examples/aws-node-simple-http-endpoint
commands:
- serverless package --stage ${AWS_STAGE} --region ${AWS_REGION} --package ${PACKAGE}
deploy:
image: codefresh/serverless:1.28
title: deploy to AWS with serverless framework
working_directory: ${{main_clone}}/examples/aws-node-simple-http-endpoint
commands:
- serverless deploy --conceal --verbose --stage ${AWS_STAGE} --region ${AWS_REGION} --aws-profile ${AWS_PROFILE} --package ${PACKAGE}

Deploy with Kompose

Use this segment into your codefresh.yml file

release_to_env:
image: codefresh/plugin-kompose:v1.5.

Deploy to Amazon ECS

Use this segment into your codefresh.yml file

deploy to ecs:
image: codefresh/cf-deploy-ecs
commands:
- cfecs-update
environment:
- AWS_ACCESS_KEY_ID=${{AWS_ACCESS_KEY_ID}}
- AWS_SECRET_ACCESS_KEY=${{AWS_SECRET_ACCESS_KEY}}

Artifact

Artifact

Publish an NPM package

Use this segment into your codefresh.yml file

deploy_to_npm:
title: Publishing To Npm
image: codefresh/npm-publish
commands:

Security

Security

Vault in a docker image

Use this segment into your codefresh.yml file

run_vault_client
title: Running vault client
image: codefresh/cf-vault-client
commands
- bash -c "/opt/codefresh/bin/client"

Use Clair for security scanning

Use this segment into your codefresh.yml file

Scan:
image: codefresh/klar
commands:
- set -o pipefail
- /klar codefresh/demochat:${{CF_BRANCH}} | tee ./report.txt
on_success:
metadata:
set:
- ${{BuildImage.imageId}}:
- CLAIR_SECURITY: true
on_fail:
metadata:
set:
- ${{BuildImage.imageId}}:
- CLAIR_SECURITY: false
fail_fast: false

Google KMS integration

Use this segment into your codefresh.yml file

GoogleKMS:
image: codefresh/google-kms
commands:
- kms encrypt VALUE_1 VALUE_n

Use Twistlock to scan Docker images

Use this segment into your codefresh.yml file

TLScan:
title: Twistlock Scan
image: codefresh/cfstep-twistlock
environment:
- TL_REGISTRY=https://r.cf-cd.com
- TL_IMAGE_NAME=francisco-codefresh/franciscocodefresh/twistlockdemo
- TL_IMAGE_TAG=${{CF_SHORT_REVISION}}

Git

Git

Add comments on Github

Use this segment into your codefresh.yml file

comment_on_github:
title: Commenting github
image: cloudposse/github-commenter
environment:
- GITHUB_TOKEN=
- GITHUB_OWNER=
- GITHUB_REPO=
- GITHUB_COMMENT_TYPE=
- GITHUB_PR_ISSUE_NUMBER=
- GITHUB_COMMENT_FORMAT=
- GITHUB_COMMENT=
commands:
- ./dist/bin/github-commenter

Github status updater

Use this segment into your codefresh.yml file

status_update_on_github:
title: Github status update
image: cloudposse/github-status-updater
environment:
- GITHUB_ACTION=
- GITHUB_TOKEN=
- GITHUB_OWNER=
- GITHUB_REPO=
- GITHUB_REF=
- GITHUB_STATE=
- GITHUB_CONTEXT=
- GITHUB_DESCRIPTION=
- GITHUB_TARGET_URL=
commands:
- ./dist/bin/github-status-updater

Notification

Notification

Send a Slack notification

Use this segment into your codefresh.yml file

notify_slack:
title: Slack notifier
image: cloudposse/slack-notifier
environment:
- SLACK_WEBHOOK_URL="https://hooks.slack.com/services/XXXXXXXX/XXXXXXXX/XXXXXXXXXXXXXXXXXXXXXX"
- SLACK_USER_NAME="CodeFresh"
- SLACK_ICON_EMOJI=":white_check_mark:"
- SLACK_FALLBACK="Deployed to Staging environment"
- SLACK_COLOR="good"
- SLACK_PRETEXT="Added XYZ to feature-104"
- SLACK_AUTHOR_NAME="Auto Deploy Robot"
- SLACK_TEXT="The latest changes have been deployed"
- GITHUB_TARGET_URL=
commands:
- slack-notifier