forked from otomato-gh/cf-plugin-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codefresh.yml
52 lines (52 loc) · 1.64 KB
/
codefresh.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
version: '1.0'
steps:
BuildImage:
title: Building Docker Image
type: build
image_name: codefreshplugins/cf-plugin-example
ScanImage:
type: composition
composition:
version: '2'
services:
imagebuild:
image: ${{BuildImage}}
command: sh -c "exit 0"
labels:
build.image.id: ${{CF_BUILD_ID}}
composition_candidates:
scan_service:
image: codefreshplugins/cf-twistlock
environment:
- TL_CONSOLE_HOSTNAME=${{TL_CONSOLE_HOSTNAME}}
- TL_CONSOLE_PORT=${{TL_CONSOLE_PORT}}
- TL_CONSOLE_USERNAME=${{TL_CONSOLE_USERNAME}}
- TL_CONSOLE_PASSWORD=${{TL_CONSOLE_PASSWORD}}
- TL_ONLY=${{TL_ONLY}}
command: twistlock.py -i "$$(docker inspect $$(docker inspect $$(docker ps -aqf label=build.image.id=${{CF_BUILD_ID}}) -f {{.Config.Image}}) -f {{.Id}} | sed 's/sha256://g')"
depends_on:
- imagebuild
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker:/var/lib/docker
# Everything below this line is Optional for CF_METADATA
- '${{CF_VOLUME_NAME}}:/codefresh/volume'
add_flow_volume_to_composition: true
TestSuccess:
title: Running success test
description: This should succeed
image: ${{BuildImage}}
environment:
- PLUGIN_RESULT=SUCCESS
TestFailure:
fail_fast: false
title: Running failure test
description: This should fail
image: ${{BuildImage}}
environment:
- PLUGIN_RESULT=FAILURE
PushingToRegistry:
type: push
title: Pushing To Registry
candidate: ${{BuildImage}}
tag: "0.2"