-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.drone.yml
112 lines (104 loc) · 3.13 KB
/
.drone.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
##
## Activate webhook in GitHub for
## - Branch/Tag creation/deletion
## - Deployments
## - Pull requests
## - Pushes
##
---
kind: pipeline
name: agrammon
type: docker
services:
- name: dbhost
image: postgres
environment:
POSTGRES_USER: postgres
POSTGRES_DB: agrammon_test
POSTGRES_PASSWORD: postgres
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
steps:
- name: buildDockerImage
image: docker
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- IMG=agrammon-runner-ubuntu-18.04
- SHA=$( cat dev/Dockerfile-ubuntu:18.04 dev/META6.json| sha1sum |awk '{print $1}')
- test "$(docker images $IMG:$SHA -q)" = "" || exit 0
- docker build -t $IMG:$SHA -f dev/Dockerfile-ubuntu:18.04 dev
- docker tag $IMG:$SHA $IMG:latest
- name: backend
image: agrammon-runner-ubuntu-18.04:latest
pull: never
depends_on:
- buildDockerImage
privileged: true
environment:
AGRAMMON_DIR: /drone/src
AGRAMMON_CFG: /drone/src/t/test-data/agrammon.cfg.drone.yaml
PGPASSFILE: /drone/src/dev/pgpass
RAKULIB: /opt/rakudo-pkg/share/perl6/site,lib
commands:
- raku -v
- cd $AGRAMMON_DIR
- chmod 0600 $PGPASSFILE
- sleep 10
- psql -U postgres -h dbhost -c "CREATE USER agrammon PASSWORD 'agrammonATwork'" > /dev/null
- psql -U postgres -h dbhost -c "CREATE GROUP agrammon_user USER agrammon" > /dev/null
- psql -U postgres -h dbhost -c "CREATE EXTENSION pgcrypto" agrammon_test > /dev/null
- psql -U postgres -h dbhost --file=/drone/src/t/test-data/agrammon_test.dump.sql agrammon_test > /dev/null
- prove -v -r --exec=raku t
### caching and frontend tests not configured yet
# - name: frontend
# image: oposs/agrammon-runner:latest
# privileged: true
# commands:
# - ln -s /home/agrammon/node_modules /drone/src/frontend/
# - chown -R agrammon:agrammon /drone/src
# - export AGRAMMON_DIR=/drone/src
# - export AGRAMMON_CONFIG=/drone/src/t/test-data/agrammon.cfg.drone.yaml
# - /home/agrammon/entrypoint.sh qx package migrate
# - /home/agrammon/entrypoint.sh test-frontend
# - name: restore-raku-cache
# image: meltwater/drone-cache:dev
# pull: always
# depends_on:
# - buildDockerImage
# settings:
# backend: filesystem
# restore: true
# cache_key: opt-rakudo-pkg-share-$( checksum $AGRAMMON_DIR/META6.json)
# archive_format: gzip
# mount:
# - /opt/rakudo-pkg/share
# volumes:
# - name: cache
# path: /tmp/cache
# - name: store-raku-cache
# image: meltwater/drone-cache:dev
# pull: never
# depends_on:
# - backend
# settings:
# backend: filesystem
# rebuild: true
# cache_key: opt-rakudo-pkg-share-$( checksum $AGRAMMON_DIR/META6.json)
# archive_format: gzip
# mount:
# - /opt/rakudo-pkg/share
# volumes:
# - name: cache
# path: /tmp/cache
# - name: complete
# image: alpine
# # depends_on: [ frontend, backend ]
# depends_on: [ backend ]
# commands:
# - echo "ALL DONE."
#
# END