summaryrefslogtreecommitdiffstats
path: root/ci/build.yaml
blob: e8db98c322d4d6d7f9cb5a74cc1d0fca7a2a55fb (plain)
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
resources:
- name: repo
  type: git
  source:
    uri: ssh://git@git.jnsn.dev:52502/~/git-host-c.git
    branch: main
    private_key: ((vbump.repo-key))
- name: final-image
  type: registry-image
  icon: docker
  source:
    repository: registry.jnsn.dev/git-host-c
    username: ((vbump.username))
    password: ((vbump.password))
    tag: latest

jobs:
- name: update-pipeline
  plan:
    - get: repo
      trigger: true
    - set_pipeline: self
      file: repo/ci/build.yaml

# The whole point of a C rewrite was to have one binary with no moving parts, so
# the gate is: compile it under the strictest warnings the compiler has, run the
# unit suite and the behavioural suite, and run both again under the sanitizers.
# Alpine, because that is the libc the image is built against - a suite that
# passes against glibc and segfaults on musl has told us nothing.
#
# The container suite (../git-host-integration) is deliberately not here: it
# needs a container runtime inside the build, and a suite that fails because the
# sandbox cannot mount an overlay is not a signal about the policy.
- name: test
  plan:
  - get: repo
    trigger: true
  - task: build-and-test
    config:
      platform: linux
      image_resource:
        type: registry-image
        source:
          repository: alpine
          tag: "3.22"
      inputs:
        - name: repo
      run:
        path: sh
        args:
          - -ec
          - |
            apk add --no-cache build-base git >/dev/null
            cd repo
            make clean
            make WARN="-Wall -Wextra -Wpedantic -Werror" 2>&1 | tail -3
            make test | tail -1
            make clean
            make sanitizer | tail -1
            printf 'install: '
            make install DESTDIR=/tmp/stage >/dev/null && \
              readlink /tmp/stage/usr/local/share/git-host/hooks/pre-receive

- name: build-container
  plan:
  - get: repo
    trigger: true
    passed: [test]
    privileged: true
    config:
      platform: linux
      image_resource:
        type: registry-image
        source:
          repository: concourse/oci-build-task
      inputs:
        - name: repo
      outputs:
        - name: image
      params:
        CONTEXT: repo
        DOCKERFILE: repo/container/Dockerfile
        UNPACK_ROOTFS: "true"
      run:
        path: build
  - put: final-image
    params:
      image: image/image.tar