File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ version : ' 1.0'
2
+
3
+ steps :
4
+
5
+ wait :
6
+ image : codefresh/cli
7
+ commands :
8
+ # Get CF pipeline name programaticlly
9
+ - CF_PIPELINE_NAME=$(codefresh get builds ${{CF_BUILD_ID}}|awk '{print $2}'|egrep -v "PIPELINE-NAME|no available")
10
+ # Verify if there's already another running build, if so, terminate it
11
+ - while [ $(codefresh get builds --status=running --pipeline-name=$CF_PIPELINE_NAME -b ${{CF_BRANCH}} |egrep -v "ID|no available"| wc -l) -gt 1 -a $(codefresh get builds --status=running --pipeline-name=$CF_PIPELINE_NAME -b ${{CF_BRANCH}}|egrep -v "ID|no available"|awk 'NR==1{print $1}') = ${{CF_BUILD_ID}} ]; do TERMINATE_BUILD=$(codefresh get builds --status=running --pipeline-name=$CF_PIPELINE_NAME -b ${{CF_BRANCH}}|egrep -v "ID|no available"|awk 'NR==2{print $1}') && echo "terminating build $TERMINATE_BUILD" && codefresh terminate $TERMINATE_BUILD && sleep 5; done
12
+ sleep :
13
+ image : alpine
14
+ commands :
15
+ - sleep 60
You can’t perform that action at this time.
0 commit comments