Last active
January 15, 2018 10:55
-
-
Save jdolitsky/2a5905a9ceafac0563d548e3bb461c06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '1.0' | |
steps: | |
unit_test: | |
image: golang:1.8 | |
description: grab dependencies, run unit tests | |
commands: | |
- mkdir -p /go/src/github.com/kubernetes-helm | |
- >- | |
ln -s /codefresh/volume/${{CF_REPO_NAME}} | |
/go/src/github.com/kubernetes-helm/chartmuseum | |
- cd /go/src/github.com/kubernetes-helm/chartmuseum && make bootstrap test | |
build_docker_image: | |
type: build | |
description: build docker image | |
image_name: ${{CF_REPO_NAME}} | |
tag: ${{CF_SHORT_REVISION}} | |
# Get the URL of the running ChartMuseum service, add it as a local helm repo, | |
# then fetch the last built release candidate of the helm chart. | |
grab_latest_chart: | |
image: codefresh/plugin-helm:2.7.2 | |
commands: | |
- kubectl config use-context ${{KUBE_CONTEXT}} | |
- >- | |
CM_URL="http://$(kubectl -n ${{NAMESPACE}} | |
get service "${{RELEASE_NAME}}-${{CHART_NAME}}" | |
-o=jsonpath='{.status.loadBalancer.ingress[0].ip}'):8080" | |
- helm init --client-only | |
- helm repo add chartmuseum $CM_URL | |
- helm fetch chartmuseum/${{CHART_NAME}} --devel | |
- cf_export CHART_NAME="$(find . -name ${{CHART_NAME}}\*.tgz -maxdepth 1)" | |
deploy_to_staging: | |
image: codefresh/plugin-helm:2.7.2 | |
# If the "helm install" worked above, the image was able to | |
# startup successfully, so we will add the latest tag. The helm chart | |
# will then reference this tag when its repo's pipeline is triggered. | |
promote_docker_image: | |
image: codefresh/cli:0.6.91 | |
commands: | |
- codefresh auth create-context --api-key ${{API_KEY}} | |
- >- | |
codefresh tag | |
$(codefresh get images | grep -m 1 -F ${{CF_REPO_NAME}} | awk '{print $1}') | |
latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment