forked from codefreshdemo/cf-example-golang-hello-world
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codefresh.yml
48 lines (44 loc) · 1.48 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
version: '1.0'
steps:
perform_tests:
image: golang:latest
working_directory: ${{main_clone}}
description: Performing unit tests...
commands:
# Need to have the source in the correct GOPATH folder - let's do that
- mkdir -p /go/src/github.com/${{CF_REPO_OWNER}}
- ln -s /codefresh/volume/${{CF_REPO_NAME}} /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
# Install pre-requisites and execute tests
- cd /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} && go get
- cd /go/src/github.com/${{CF_REPO_OWNER}}/${{CF_REPO_NAME}} && go test
build_image:
type: build
description: Building the image...
image_name: ${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}
tag: '${{CF_BRANCH}}'
launch_composition:
type: launch-composition
description: Launching an environment from a composition...
composition:
version: '2'
services:
prest:
image: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}:${{CF_BRANCH}}'
environment:
- PREST_PG_HOST=postgres
- PREST_PG_USER=prest
- PREST_PG_PASS=prest
- PREST_PG_DATABASE=prest
- PREST_PG_PORT=5432
depends_on:
- postgres
ports:
- '3000'
postgres:
image: mbrung/postgres-no-volume
environment:
- POSTGRES_USER=prest
- POSTGRES_DB=prest
- POSTGRES_PASSWORD=prest
ports:
- '5432'