github.com/dnephin/dobi@v0.15.0/dobi.yaml (about)

     1  #
     2  # dobi.yaml - resources for building, testing, and developing dobi
     3  #
     4  
     5  meta:
     6      project: dobi
     7      default: all
     8  
     9  #
    10  # Mounts
    11  #
    12  
    13  mount=source:
    14      bind: .
    15      path: /go/src/github.com/dnephin/dobi
    16  
    17  mount=dist:
    18      bind: ./dist/bin/
    19      path: /go/bin/
    20  
    21  mount=projectdir:
    22      bind: .
    23      path: '{fs.projectdir}'
    24  
    25  #
    26  # Images
    27  #
    28  
    29  image=builder:
    30      image: dobi-dev
    31      context: dockerfiles/
    32      dockerfile: Dockerfile.build
    33  
    34  image=linter:
    35      image: dobi-linter
    36      dockerfile: dockerfiles/Dockerfile.lint
    37  
    38  image=dist-img:
    39      image: dnephin/dobi
    40      tags: ["{env.DOBI_VERSION}"]
    41      dockerfile: dockerfiles/Dockerfile.dist
    42      annotations:
    43        description: "Build the distribution image"
    44  
    45  image=releaser:
    46      image: dobi-release
    47      context: dockerfiles/
    48      dockerfile: Dockerfile.release
    49  
    50  image=docs-img:
    51      image: dobi-docs-dev
    52      context: dockerfiles/
    53      dockerfile: Dockerfile.docs
    54  
    55  image=example-tester:
    56      image: dobi-test-examples
    57      dockerfile: Dockerfile.test-examples
    58      context: dockerfiles/
    59  
    60  image=circleci-alpine:
    61      image: dnephin/circleci-alpine-step
    62      tags: [latest]
    63      dockerfile: Dockerfile.circleci
    64      context: dockerfiles/ci
    65  
    66  #
    67  # Jobs
    68  #
    69  
    70  job=binary:
    71      use: builder
    72      artifact: ./dist/bin/
    73      mounts: [source, dist]
    74      command: script/build
    75      env:
    76        - "DOBI_BUILD_OSARCH={env.DOBI_BUILD_OSARCH:}"
    77      annotations:
    78        description: "Build the static binary"
    79        tags: [binary]
    80  
    81  job=watch:
    82      use: builder
    83      mounts: [source]
    84      interactive: true
    85      depends: [mocks]
    86      annotations:
    87        description: "Watch for code changes and run the unit tests"
    88        tags: [test]
    89      command: |
    90        filewatcher -x vendor gotestsum -- -test.timeout 10s
    91      env: ["GOTESTSUM_FORMAT=short-verbose"]
    92  
    93  job=shell:
    94      use: builder
    95      mounts: [source, dist]
    96      interactive: true
    97      provide-docker: true
    98      command: bash
    99      annotations:
   100        description: "Start an interactive development environment"
   101  
   102  job=test-unit:
   103      use: builder
   104      mounts: [source]
   105      depends: [mocks]
   106      interactive: true
   107      annotations:
   108        tags: [test]
   109      command: gotestsum
   110      env: ["GOTESTSUM_FORMAT={env.GOTESTSUM_FORMAT:short}"]
   111  
   112  job=lint:
   113      use: linter
   114      mounts: [source]
   115      depends: [mocks]
   116      annotations:
   117        description: "Run static checks"
   118  
   119  job=lint-shell:
   120      use: linter
   121      mounts: [source]
   122      command: bash
   123      interactive: true
   124  
   125  job=github-release:
   126      use: releaser
   127      mounts: [dist]
   128      env:
   129       - "GITHUB_TOKEN={env.GITHUB_TOKEN}"
   130       - "DOBI_VERSION={env.DOBI_VERSION}"
   131  
   132  job=release-version:
   133      use: builder
   134      mounts: [dist]
   135      command: "bash -ec \"dobi-linux --version | awk '{print $3}'\""
   136  
   137  job=docs-build:
   138      use: docs-img
   139      artifact: ./docs/build/html.tar.gz
   140      mounts: [source]
   141      command: docs/script/build
   142      depends: [binary-linux]
   143      annotations:
   144        tags: [docs]
   145  
   146  job=docs-shell:
   147      use: docs-img
   148      mounts: [source]
   149      interactive: true
   150      command: bash
   151      annotations:
   152        tags: [docs]
   153  
   154  job=docs-watch:
   155      use: docs-img
   156      mounts: [source]
   157      interactive: true
   158      command: docs/script/watch
   159      annotations:
   160        tags: [docs]
   161  
   162  job=docs:
   163      use: docs-img
   164      mounts: [source]
   165      interactive: true
   166      ports: ["8080:8080"]
   167      command: docs/script/serve
   168      depends: ['docs-build']
   169      annotations:
   170        description: "Build docs and start an http server to preview the docs"
   171        tags: [docs]
   172  
   173  job=mocks:
   174      use: builder
   175      mounts: [source]
   176      command: "go generate ./..."
   177      annotations:
   178        tags: [test]
   179  
   180  job=deps:
   181      use: builder
   182      mounts: [source]
   183      command: "go mod vendor"
   184      sources: ['go.mod', 'go.sum']
   185      artifact: vendor/
   186      annotations:
   187        description: "Install go modules"
   188  
   189  
   190  job=test-examples:
   191      use: example-tester
   192      provide-docker: true
   193      interactive: true
   194      mounts: [projectdir, dist]
   195      entrypoint: script/test-examples
   196      working-dir: '{fs.projectdir}'
   197      depends: [build-rtf, binary-linux]
   198      env:
   199        - 'DOCKER_API_VERSION={env.DOCKER_API_VERSION:}'
   200        - 'COMPOSE_API_VERSION={env.DOCKER_API_VERSION:}'
   201        - 'DOBI_NO_BIND_MOUNT={env.DOBI_NO_BIND_MOUNT:}'
   202        - 'DOBI_EXAMPLE={env.DOBI_EXAMPLE:}'
   203      artifact: _results/
   204  
   205  job=examples-shell:
   206      use: example-tester
   207      provide-docker: true
   208      interactive: true
   209      mounts: [projectdir, dist]
   210      entrypoint: sh
   211      working-dir: '{fs.projectdir}'
   212  
   213  job=build-rtf:
   214      use: builder
   215      mounts: [source, dist]
   216      command: go get github.com/linuxkit/rtf
   217      artifact: dist/bin/rtf
   218      annotations:
   219        tags: [test]
   220  
   221  image=refactorer:
   222      image: dnephin/go-refactor
   223      tags: [latest]
   224      pull: 72h
   225  
   226  job=refactor-shell:
   227      use: refactorer
   228      mounts: [source]
   229      interactive: true
   230      working-dir: /go/src/github.com/dnephin/dobi
   231      env: [GOPATH=/go]
   232      command: sh
   233      annotations:
   234        description: "Start an interactive shell for running go refactor tools"
   235  
   236  
   237  env=linux-only:
   238      variables: [DOBI_BUILD_OSARCH=linux/amd64]
   239  
   240  #
   241  # Aliases
   242  #
   243  
   244  alias=test:
   245      tasks: [test-unit, test-examples]
   246      annotations:
   247        description: "Run all tests"
   248  
   249  alias=all:
   250      tasks: [lint, test, docs-build, binary]
   251      annotations:
   252        description: "Run all lint and build tasks"
   253  
   254  alias=binary-linux:
   255      tasks: [linux-only, binary]
   256      annotations:
   257        tags: [binary]
   258  
   259  alias=release:
   260      tasks:
   261        - 'binary'
   262        - 'release-version:capture(DOBI_VERSION)'
   263        - 'github-release'
   264        - 'dist-img:push'
   265      annotations:
   266        tags: [release]