Concourse Examples

From Knowledge Center
Jump to: navigation, search

References:

Examples

pipeline.yml:

resources:
  - name: pysup
    type: git
    source:
      uri: git@github.com:postmates/pysup.git
      access_token: {{github-access-token}}
      private_key: {{github-private-key}}
  - name: pysup-test-image
    type: docker-image
    source:
      email: {{quay-email}}
      username: {{quay-username}}
      password: {{quay-password}}
      repository: quay.io/postmates/pysup-image

jobs:
  #
  # master_build
  #
  - name: pysup-master-test-img
    plan:
      - get: pysup
        trigger: true
      - put: pysup-test-image
        params:
          build: pysup
          dockerfile: pysup/Dockerfile

  - name: master-test
    plan:
      - get: pysup-test-image
        passed:
          - pysup-master-test-img
      - get: pysup
        passed:
          - pysup-master-test-img
      - task: test
        image: pysup-master-test-img
        config:
          platform: linux
          inputs:
            - name: pysup
          run:
            dir: pysup
            path: sh
            args:
              - -exc
              - |
                make test

Dockerfile

FROM alpine:3.5

RUN apk add --update --no-cache alpine-sdk python py-pip python2-dev && \
    pip install --upgrade pip

ADD . /pysup

RUN cd /pysup && \
    pip install -r dev-requirements.txt && \
    pip install -r requirements.txt && \
    cd / && \
    rm -rf /pysup