on master help sign in
sc-build/README.md
64 lines 1.2 kB history raw
1# sc-build
3Need both manual weebohook and app.
5Installation id needs to be configured manually.
7## Usage
9You want to have some predefined docker container with maximum dependencies cached.
12Exmaple:
14```dockerfile
15FROM fpco/stack-build:lts-14.27
17RUN stack update
18RUN stack build tasty tasty-hspec aeson containers bytestring
20WORKDIR /
21```
23You need to build that container and git it a name:
25```bash
26docker build -t fast-lts-14.27 - < FastDockerFile
27```
29After that you can use it in your `tasks.yaml`:
31```yaml
32test-task:
33 prebuild: |
34 cp -f ../../test-task/package.yaml .
35 cp -f ../../test-task/stack.yaml .
36 cp -f -R ../../test-task/test .
37 dockerfile: |
38 FROM fast-lts-14.27
39 COPY . src
40 WORKDIR /src
41 ENTRYPOINT stack test --fast
42 timeoutMinutes: 10
43```
45The docker container is expected to write json to stdout, conating test results:
47```json
49 "test1": true,
50 "test2": false
52```
54For macos docker API:
56```bash
57socat TCP-LISTEN:1234,range=127.0.0.1/32,reuseaddr,fork UNIX-CLIENT:/var/run/docker.sock
58```
60or this (didn't work for me):
62```bash
63docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:2357:1234 bobrik/socat TCP-LISTEN:1234,fork UNIX-CONNECT:/var/run/docker.sock
64```