Skip to content

Commit c31e6df

Browse files
authored
Merge pull request #20 from navicore/devenv
my testkit
2 parents 6aa1477 + ecdfd35 commit c31e6df

File tree

6 files changed

+256
-0
lines changed

6 files changed

+256
-0
lines changed

testing/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# DEVELOPMENT ENVIRONMENT
2+
3+
I use these pipelines and docker-compose to test the Teams connector.
4+
5+
Feel free to contribute examples of pipelines that you use and for which you
6+
would like to ensure regression protection.
7+
8+
```
9+
docker-compose up -d
10+
```
11+
12+
User:pwd is `test:test`. I shouldn't have to say don't expose this to a network.

testing/docker-compose.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: '3'
2+
3+
services:
4+
concourse-db:
5+
image: postgres
6+
environment:
7+
POSTGRES_DB: concourse
8+
POSTGRES_PASSWORD: concourse_pass
9+
POSTGRES_USER: concourse_user
10+
PGDATA: /database
11+
12+
concourse:
13+
image: concourse/concourse
14+
command: quickstart
15+
privileged: true
16+
depends_on: [concourse-db]
17+
ports: ["8080:8080"]
18+
environment:
19+
CONCOURSE_POSTGRES_HOST: concourse-db
20+
CONCOURSE_POSTGRES_USER: concourse_user
21+
CONCOURSE_POSTGRES_PASSWORD: concourse_pass
22+
CONCOURSE_POSTGRES_DATABASE: concourse
23+
CONCOURSE_EXTERNAL_URL: http://localhost:8080
24+
CONCOURSE_ADD_LOCAL_USER: test:test
25+
CONCOURSE_MAIN_TEAM_LOCAL_USER: test
26+
# instead of relying on the default "detect"
27+
CONCOURSE_WORKER_BAGGAGECLAIM_DRIVER: overlay
28+
CONCOURSE_CLIENT_SECRET: Y29uY291cnNlLXdlYgo=
29+
CONCOURSE_TSA_CLIENT_SECRET: Y29uY291cnNlLXdvcmtlcgo=
30+
CONCOURSE_X_FRAME_OPTIONS: allow
31+
CONCOURSE_CONTENT_SECURITY_POLICY: "*"
32+
CONCOURSE_CLUSTER_NAME: tutorial
33+
CONCOURSE_WORKER_CONTAINERD_DNS_SERVER: "8.8.8.8"
34+
CONCOURSE_WORKER_RUNTIME: "containerd"

testing/hello-world-failing.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
task-config: &task-config
2+
platform: linux
3+
image_resource:
4+
type: registry-image
5+
source: { repository: navicore/navibox }
6+
resources:
7+
- name: alert
8+
type: teams-notification
9+
source:
10+
url: "PUT YOUR WEBHOOK HERE"
11+
resource_types:
12+
- name: teams-notification
13+
type: docker-image
14+
source:
15+
repository: navicore/teams-notification-resource
16+
tag: dev
17+
jobs:
18+
- name: hello-world-failing-job
19+
plan:
20+
- task: hello-world-failing-task
21+
config:
22+
platform: linux
23+
image_resource:
24+
type: registry-image
25+
source:
26+
repository: navicore/navibox
27+
run:
28+
path: ifail # 'ifail' signals on_failure. for on_success, use 'isucceed'
29+
on_success:
30+
task: job-success
31+
config:
32+
<< : *task-config
33+
run:
34+
path: echo
35+
args: ["This job succeeded!"]
36+
on_success:
37+
do:
38+
- put: alert
39+
params:
40+
text: |
41+
task tested: with no errors
42+
title: hello-world-failing tested good
43+
actionName: hello-world-failing Pipeline
44+
actionTarget: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
45+
on_failure:
46+
do:
47+
- put: alert
48+
params:
49+
color: FF0000
50+
text: |
51+
something failed in env.
52+
title: something error
53+
actionName: hello-world-failing Pipeline
54+
actionTarget: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME

testing/hello-world-proxy.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
task-config: &task-config
2+
platform: linux
3+
image_resource:
4+
type: registry-image
5+
source: { repository: busybox }
6+
resources:
7+
- name: alert
8+
type: teams-notification
9+
source:
10+
url: "PUT YOUR WEBHOOK HERE"
11+
proxy_url: http://192.168.0.47
12+
proxy_port: 1234
13+
resource_types:
14+
- name: teams-notification
15+
type: docker-image
16+
source:
17+
repository: navicore/teams-notification-resource
18+
tag: dev
19+
jobs:
20+
- name: hello-world-proxy-job
21+
plan:
22+
- task: hello-world-proxy-task
23+
config:
24+
# Tells Concourse which type of worker this task should run on
25+
platform: linux
26+
# This is one way of telling Concourse which container image to use for a
27+
# task. We'll explain this more when talking about resources
28+
image_resource:
29+
type: registry-image
30+
source:
31+
repository: busybox # images are pulled from docker hub by default
32+
# The command Concourse will run inside the container
33+
# echo "Hello world!"
34+
run:
35+
path: echo
36+
args: ["Hello world!"]
37+
on_success:
38+
task: job-success
39+
config:
40+
<< : *task-config
41+
run:
42+
path: echo
43+
args: ["This job succeeded!"]
44+
on_success:
45+
put: alert
46+
params:
47+
text: |
48+
task tested: with no errors
49+
title: hello-world-proxy tested good
50+
actionName: hello-world-proxy Pipeline
51+
actionTarget: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
52+

testing/hello-world-pwd.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
task-config: &task-config
2+
platform: linux
3+
image_resource:
4+
type: registry-image
5+
source: { repository: busybox }
6+
resources:
7+
- name: alert
8+
type: teams-notification
9+
source:
10+
url: "PUT YOUR WEBHOOK HERE"
11+
proxy_url: http://192.168.0.47
12+
proxy_port: 1234
13+
proxy_username: myapp
14+
proxy_password: mysecret
15+
resource_types:
16+
- name: teams-notification
17+
type: docker-image
18+
source:
19+
repository: navicore/teams-notification-resource
20+
tag: dev
21+
jobs:
22+
- name: hello-world-pwd-job
23+
plan:
24+
- task: hello-world-pwd-task
25+
config:
26+
# Tells Concourse which type of worker this task should run on
27+
platform: linux
28+
# This is one way of telling Concourse which container image to use for a
29+
# task. We'll explain this more when talking about resources
30+
image_resource:
31+
type: registry-image
32+
source:
33+
repository: busybox # images are pulled from docker hub by default
34+
# The command Concourse will run inside the container
35+
# echo "Hello world!"
36+
run:
37+
path: echo
38+
args: ["Hello world!"]
39+
on_success:
40+
task: job-success
41+
config:
42+
<< : *task-config
43+
run:
44+
path: echo
45+
args: ["This job succeeded!"]
46+
on_success:
47+
put: alert
48+
params:
49+
text: |
50+
task tested: with no errors
51+
title: hello-world-pwd tested good
52+
actionName: hello-world-pwd Pipeline
53+
actionTarget: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
54+

testing/hello-world.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
task-config: &task-config
2+
platform: linux
3+
image_resource:
4+
type: registry-image
5+
source: { repository: busybox }
6+
resources:
7+
- name: alert
8+
type: teams-notification
9+
source:
10+
url: "PUT YOUR WEBHOOK HERE"
11+
resource_types:
12+
- name: teams-notification
13+
type: docker-image
14+
source:
15+
repository: navicore/teams-notification-resource
16+
tag: dev
17+
jobs:
18+
- name: hello-world-job
19+
plan:
20+
- task: hello-world-task
21+
config:
22+
# Tells Concourse which type of worker this task should run on
23+
platform: linux
24+
# This is one way of telling Concourse which container image to use for a
25+
# task. We'll explain this more when talking about resources
26+
image_resource:
27+
type: registry-image
28+
source:
29+
repository: busybox # images are pulled from docker hub by default
30+
# The command Concourse will run inside the container
31+
# echo "Hello world!"
32+
run:
33+
path: echo
34+
args: ["Hello world!"]
35+
on_success:
36+
task: job-success
37+
config:
38+
<< : *task-config
39+
run:
40+
path: echo
41+
args: ["This job succeeded!"]
42+
on_success:
43+
put: alert
44+
params:
45+
text: |
46+
task tested: with no errors
47+
title: hello-world tested good
48+
actionName: hello-world Pipeline
49+
actionTarget: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME
50+

0 commit comments

Comments
 (0)