|
| 1 | +# |
| 2 | +# dobi.yaml - resources for building and testing docker images |
| 3 | +# |
| 4 | + |
| 5 | +meta: |
| 6 | + project: cbmc |
| 7 | + default: distros |
| 8 | + |
| 9 | +# |
| 10 | +# Mounts |
| 11 | +# |
| 12 | + |
| 13 | +mount=source: |
| 14 | + bind: ./cbmc/ |
| 15 | + path: /src/cbmc/ |
| 16 | + |
| 17 | +## Alpine Mounts |
| 18 | + |
| 19 | +mount=alpine-tmp: |
| 20 | + bind: ./alpine-tmp |
| 21 | + path: /tmp/projects |
| 22 | + |
| 23 | +mount=alpine-dist: |
| 24 | + bind: ./alpine-dist/ |
| 25 | + path: /dist/ |
| 26 | + |
| 27 | +## Ubuntu Mounts |
| 28 | + |
| 29 | +mount=ubuntu-tmp: |
| 30 | + bind: ./ubuntu-tmp |
| 31 | + path: /tmp/projects |
| 32 | + |
| 33 | +mount=ubuntu-dist: |
| 34 | + bind: ./ubuntu-dist/ |
| 35 | + path: /dist/ |
| 36 | + |
| 37 | +# |
| 38 | +# Images |
| 39 | +# |
| 40 | + |
| 41 | +## Alpine Images |
| 42 | + |
| 43 | +image=alpine-builder: |
| 44 | + image: diffblue/cbmc-builder |
| 45 | + context: alpine/ |
| 46 | + dockerfile: Dockerfile |
| 47 | + tags: |
| 48 | + - 'alpine' |
| 49 | + - 'alpine-{env.BUILDER_TAG}' |
| 50 | + |
| 51 | +image=alpine-distro: |
| 52 | + image: diffblue/cbmc |
| 53 | + dockerfile: alpine/Dockerfile.distro |
| 54 | + depends: ["alpine-copy-binaries"] |
| 55 | + description: "Build the distribution image" |
| 56 | + tags: |
| 57 | + - 'alpine' |
| 58 | + - 'alpine-{env.BUILDER_TAG}' |
| 59 | + |
| 60 | +## Ubuntu Images |
| 61 | + |
| 62 | +image=ubuntu-builder: |
| 63 | + image: diffblue/cbmc-builder |
| 64 | + context: ubuntu/ |
| 65 | + dockerfile: Dockerfile |
| 66 | + tags: |
| 67 | + - 'latest' |
| 68 | + - 'xenial' |
| 69 | + - 'xenial-{env.BUILDER_TAG}' |
| 70 | + |
| 71 | +image=ubuntu-distro: |
| 72 | + image: diffblue/cbmc |
| 73 | + dockerfile: ubuntu/Dockerfile.distro |
| 74 | + depends: ["ubuntu-copy-binaries"] |
| 75 | + description: "Build the distribution image" |
| 76 | + tags: |
| 77 | + - 'latest' |
| 78 | + - 'xenial' |
| 79 | + - 'xenial-{env.BUILDER_TAG}' |
| 80 | + |
| 81 | +# |
| 82 | +# Jobs |
| 83 | +# |
| 84 | + |
| 85 | +## Alpine Jobs |
| 86 | + |
| 87 | +job=alpine-copy-src: |
| 88 | + use: alpine-builder |
| 89 | + mounts: [source, alpine-tmp] |
| 90 | + artifact: alpine-tmp/cbmc |
| 91 | + command: "bash -c \"cp -r /src/cbmc /tmp/projects/\"" |
| 92 | + description: "Copy source to temporary folder." |
| 93 | + |
| 94 | +job=alpine-prebuild: |
| 95 | + use: alpine-builder |
| 96 | + depends: ["alpine-copy-src"] |
| 97 | + mounts: [alpine-tmp] |
| 98 | + artifact: alpine-tmp/cbmc/minisat-2.2.1 |
| 99 | + command: "bash -c \"make -C /tmp/projects/cbmc/src minisat2-download\"" |
| 100 | + description: "Do make prebuild actions." |
| 101 | + |
| 102 | +job=alpine-build: |
| 103 | + use: alpine-builder |
| 104 | + depends: ["alpine-prebuild"] |
| 105 | + mounts: [alpine-tmp] |
| 106 | + artifact: alpine-tmp/cbmc/src/cbmc/cbmc |
| 107 | + command: "bash -c \"make -C /tmp/projects/cbmc/src -j$(getconf _NPROCESSORS_ONLN)\"" |
| 108 | + description: "Do make build." |
| 109 | + |
| 110 | +job=alpine-test: |
| 111 | + use: alpine-builder |
| 112 | + depends: ["alpine-build"] |
| 113 | + mounts: [alpine-tmp] |
| 114 | + command: "bash -c \"make -C /tmp/projects/cbmc/regression test\"" |
| 115 | + description: "Do make tests." |
| 116 | + |
| 117 | +job=alpine-copy-binaries: |
| 118 | + use: alpine-builder |
| 119 | + depends: ["alpine-build"] |
| 120 | + mounts: [alpine-tmp, alpine-dist] |
| 121 | + artifact: alpine-dist/bin |
| 122 | + command: "bash -c \"mkdir -p /dist/bin && cp -r /tmp/projects/cbmc/src/cbmc/cbmc /dist/bin/ && cp -r /tmp/projects/cbmc/src/goto-*/goto-* /dist/bin/ && rm /dist/bin/*.a\"" |
| 123 | + description: "Copy binaries to dist folder." |
| 124 | + |
| 125 | +job=alpine-clean: |
| 126 | + use: alpine-builder |
| 127 | + mounts: [alpine-tmp, alpine-dist] |
| 128 | + command: "bash -c \"rm -rf /tmp/projects/* && rm -rf /dist/*\"" |
| 129 | + description: "Delete temporary files and binaries" |
| 130 | + |
| 131 | +## Ubuntu Jobs |
| 132 | + |
| 133 | +job=ubuntu-copy-src: |
| 134 | + use: ubuntu-builder |
| 135 | + mounts: [source, ubuntu-tmp] |
| 136 | + artifact: ubuntu-tmp/cbmc |
| 137 | + command: "bash -c \"cp -r /src/cbmc /tmp/projects/\"" |
| 138 | + description: "Copy source to temporary folder." |
| 139 | + |
| 140 | +job=ubuntu-prebuild: |
| 141 | + use: ubuntu-builder |
| 142 | + depends: ["ubuntu-copy-src"] |
| 143 | + mounts: [ubuntu-tmp] |
| 144 | + artifact: ubuntu-tmp/cbmc/minisat-2.2.1 |
| 145 | + command: "bash -c \"make -C /tmp/projects/cbmc/src minisat2-download\"" |
| 146 | + description: "Do make prebuild actions." |
| 147 | + |
| 148 | +job=ubuntu-build: |
| 149 | + use: ubuntu-builder |
| 150 | + depends: ["ubuntu-prebuild"] |
| 151 | + mounts: [ubuntu-tmp] |
| 152 | + artifact: ubuntu-tmp/cbmc/src/cbmc/cbmc |
| 153 | + command: "bash -c \"make -C /tmp/projects/cbmc/src -j$(getconf _NPROCESSORS_ONLN)\"" |
| 154 | + description: "Do make build." |
| 155 | + |
| 156 | +job=ubuntu-test: |
| 157 | + use: ubuntu-builder |
| 158 | + depends: ["ubuntu-build"] |
| 159 | + mounts: [ubuntu-tmp] |
| 160 | + command: "bash -c \"make -C /tmp/projects/cbmc/regression test\"" |
| 161 | + description: "Do make tests." |
| 162 | + |
| 163 | +job=ubuntu-copy-binaries: |
| 164 | + use: ubuntu-builder |
| 165 | + depends: ["ubuntu-build"] |
| 166 | + mounts: [ubuntu-tmp, ubuntu-dist] |
| 167 | + artifact: ubuntu-dist/bin |
| 168 | + command: "bash -c \"mkdir -p /dist/bin && cp -r /tmp/projects/cbmc/src/cbmc/cbmc /dist/bin/ && cp -r /tmp/projects/cbmc/src/goto-*/goto-* /dist/bin/ && rm /dist/bin/*.a\"" |
| 169 | + description: "Copy binaries to dist folder." |
| 170 | + |
| 171 | +job=ubuntu-clean: |
| 172 | + use: ubuntu-builder |
| 173 | + mounts: [ubuntu-tmp, ubuntu-dist] |
| 174 | + command: "bash -c \"rm -rf /tmp/projects/* && rm -rf /dist/*\"" |
| 175 | + description: "Delete temporary files and binaries" |
| 176 | + |
| 177 | +# |
| 178 | +# Aliases |
| 179 | +# |
| 180 | + |
| 181 | +alias=alpine: |
| 182 | + tasks: [alpine-copy-src, alpine-prebuild, alpine-build, alpine-test, alpine-copy-binaries] |
| 183 | + description: "Run all containers and jobs for Alpine" |
| 184 | + |
| 185 | +alias=ubuntu: |
| 186 | + tasks: [ubuntu-copy-src, ubuntu-prebuild, ubuntu-build, ubuntu-test, ubuntu-copy-binaries] |
| 187 | + description: "Run all containers and jobs for Ubuntu" |
| 188 | + |
| 189 | +alias=test: |
| 190 | + tasks: [alpine-test, ubuntu-test] |
| 191 | + description: "Run all tests for all distros." |
| 192 | + |
| 193 | +alias=distros: |
| 194 | + tasks: [alpine-distro, ubuntu-distro] |
| 195 | + description: "Create all distro images." |
| 196 | + |
| 197 | +alias=clean: |
| 198 | + tasks: [alpine-clean, ubuntu-clean] |
| 199 | + description: "Delete temporary files and binaries for all distros." |
| 200 | + |
| 201 | +alias=all: |
| 202 | + tasks: [alpine, ubuntu] |
| 203 | + description: "Run all jobs for all distros." |
0 commit comments