forked from hound-search/hound
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
concourse.yml
97 lines (85 loc) · 2.53 KB
/
concourse.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# see concourse.md for deployment instructions
resource_types:
- name: pull-request
type: docker-image
source:
repository: teliaoss/github-pr-resource
resources:
- name: pr
type: pull-request
check_every: 24h
webhook_token: ((webhook-token))
source:
repository: itpp-labs/hound
access_token: ((github-token))
- name: docker-registry
type: docker-image
source:
repository: docker.pkg.github.com/itpp-labs/hound/pr
username: ((github-username))
password: ((github-token))
jobs:
- name: review-pull-request
plan:
- get: pr
trigger: true
version: latest
- put: set-status-pending
resource: pr
params:
path: pr
status: pending
- task: analyze-pr
config:
platform: linux
image_resource:
type: docker-image
source: {repository: alpine, tag: "latest"}
inputs:
- name: pr
outputs:
- name: pr-info
run:
path: /bin/sh
args:
- -xce
- |
BASE_SHA=$(cat pr/.git/resource/base_sha | cut -c 1-7)
HEAD_SHA=$(cat pr/.git/resource/head_sha | cut -c 1-7)
PR_NUM=$(cat pr/.git/resource/pr)
TAG="pr-$PR_NUM-head-$HEAD_SHA-base-$BASE_SHA"
echo $TAG > pr-info/tag.txt
echo "To test updates run:
# normal
docker run -p 6080:6080 --rm docker.pkg.github.com/itpp-labs/hound/pr:$TAG
# dev
docker run -p 6080:6080 -p 9000:9000 --rm docker.pkg.github.com/itpp-labs/hound/pr:$TAG --dev
You may need be [authenticated](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line):
docker login docker.pkg.github.com -u GITHUB_USERNAME -p GITHUB_TOKEN
> Posted from Concourse CI (see concourse.yml)" > pr-info/comment.txt
on_failure:
put: set-status-failure
resource: pr
params:
path: pr
status: failure
- put: docker-registry
params:
build: pr
dockerfile: pr/DockerfilePR
tag_file: pr-info/tag.txt
get_params: {skip_download: true}
on_failure:
put: set-status-failure
resource: pr
params:
path: pr
status: failure
- put: set-status-success
resource: pr
params:
path: pr
status: success
target_url: $ATC_EXTERNAL_URL/builds/$BUILD_ID
# it's not neccesary to post comment if we print it as a log in the pipeline
comment_file: pr-info/comment.txt