Skip to content

Commit

Permalink
Updated codefresh deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
elaygl committed Jan 20, 2020
1 parent b141655 commit be9097f
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 30 deletions.
76 changes: 76 additions & 0 deletions deployment/codefresh/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
version: '1.0'
kind: pipeline
metadata:
name: airbag/publish
project: airbag
spec:
terminationPolicy:
- type: branch
event: onCreate
variables:
- key: IMAGE_NAME
value: soluto/airbag
contexts:
- acreastus
triggers:
- repo: Soluto/airbag
name: github
type: git
events:
- push.tags
pullRequestAllowForkEvents: false
commentRegex: /.*/gi
branchRegex: /.*/gi
branchRegexInput: regex
provider: github
disabled: false
verified: true
context: github-verified
contexts: []
variables: []

stages:
- build
- push

steps:
CloneRepository:
type: git-clone
description: Cloning repository
repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
revision: ${{CF_REVISION}}
stage: build
git: github

BuildImage:
stage: build
title: Building sidecar Docker Image
type: build
image_name: ${{IMAGE_NAME}}
tag: ${{CF_REVISION}}
working_directory: ${{CloneRepository}}
dockerfile: deployment/Dockerfile

PushApproval:
fail_fast: false
stage: push
type: pending-approval
title: Push image to Docker Hub?
timeout:
duration: 24
finalState: denied

Push:
type: push
stage: push
title: Pushing Image to Docker Hub
registry: dockerhub-tweek
image_name: ${{IMAGE_NAME}}
candidate: ${{BuildImage}}
tags:
- latest
- '${{CF_BRANCH}}'
when:
condition:
all:
approved: steps.PushApproval.result == 'approved'
31 changes: 1 addition & 30 deletions deployment/codefresh.yaml → deployment/codefresh/test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '1.0'
kind: pipeline
metadata:
name: airbag/build&publish
name: airbag/test
project: airbag
spec:
terminationPolicy:
Expand Down Expand Up @@ -35,7 +35,6 @@ spec:
stages:
- build
- test
- push

steps:
CloneRepository:
Expand Down Expand Up @@ -92,31 +91,3 @@ spec:
- AUTH_SERVER_DIFFERENT_ISSUER_URL=http://auth_server_with_different_issuer
- AUTH_SERVER_DIFFERENT_SIGNATURE_URL=http://auth_server_with_different_signature
- AIRBAG_WITHOUT_AUD_URL=http://airbag-without-aud-validation:5001

PushApproval:
fail_fast: false
stage: push
type: pending-approval
when:
branch:
only:
- master
title: Push image to Docker Hub?
timeout:
duration: 24
finalState: denied

Push:
type: push
stage: push
title: Pushing Image to Docker Hub
registry: dockerhub-tweek
image_name: ${{IMAGE_NAME}}
candidate: ${{BuildImage}}
tags:
- latest
- "2.2.0"
when:
condition:
all:
approved: steps.PushApproval.result == 'approved'

0 comments on commit be9097f

Please sign in to comment.