github.com/dmvolod/operator-sdk@v0.8.2/.travis.yml (about)

     1  language: go
     2  go_import_path: github.com/operator-framework/operator-sdk
     3  sudo: required
     4  
     5  cache:
     6    directories:
     7      - $HOME/.cache/go-build
     8      - $GOPATH/pkg/mod
     9  
    10  go:
    11  - 1.12.x
    12  
    13  # The `x_base_steps` top-level key is unknown to travis,
    14  # so we can use it to create a bunch of common build step
    15  # YAML anchors which we use in our build jobs.
    16  x_base_steps:
    17    # before_install for jobs that require dep
    18    - &dep_before_install
    19      before_install:
    20        - curl -Lo dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/
    21        - travis_retry dep ensure -v
    22    # before_install for jobs that require go builds and do not run for doc-only changes
    23    - &go_before_install
    24      before_install:
    25        # hack/ci/check-doc-only-update.sh needs to be sourced so
    26        # that it can properly exit the test early with success
    27        - source hack/ci/check-doc-only-update.sh
    28        - curl -Lo dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/
    29        - travis_retry dep ensure -v
    30  
    31    # Base go, ansbile, and helm job
    32    - &test
    33      stage: test
    34      env: CLUSTER=openshift
    35      <<: *go_before_install
    36      install:
    37        - make install
    38        - hack/ci/setup-openshift.sh
    39      after_success:
    40        - echo "Build succeeded, operator was generated, memcached operator is running on $CLUSTER, and unit/integration tests pass"
    41      after_failure:
    42        - echo "Build failed, operator failed to generate, memcached operator is not running on $CLUSTER, or unit/integration tests failed"
    43        - kubectl get all --all-namespaces
    44        - kubectl get events --all-namespaces --field-selector=type=Warning
    45      services:
    46        - docker
    47  
    48    # Base deploy job
    49    - &deploy
    50      stage: deploy
    51      if: type != pull_request AND ( tag IS present OR branch = master OR commit_message =~ /\[travis deploy\]/ )
    52      <<: *go_before_install
    53      install: make install
    54      before_script:
    55        - git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
    56        - git fetch --unshallow --tags
    57      after_success:
    58        - echo "Image build succeeded, and docker image tagged and pushed to repository"
    59      after_failure:
    60        - echo "Image build, docker image tagging, or docker image pushing to repository failed"
    61      services:
    62        - docker
    63  
    64  jobs:
    65    include:
    66      # Build and test go
    67      - <<: *test
    68        name: Go on OpenShift
    69        script: make test/ci-go ARGS="-v"
    70  
    71      # Build and test ansible
    72      - <<: *test
    73        name: Ansible on OpenShift
    74        before_script: sudo pip install ansible
    75        script: make test/ci-ansible
    76  
    77      # Build and test helm
    78      - <<: *test
    79        name: Helm on OpenShift
    80        script: make test/ci-helm
    81  
    82      # Run the unit, sanity, and markdown tests
    83      - stage: test
    84        name: Unit, Sanity, and Markdown Tests
    85        # Currently, prow/api-ci tests all PRs that target master; use travis for post merge testing and non-master PRs
    86        if: type != pull_request OR branch != master
    87        <<: *dep_before_install
    88        script: make test/sanity test/unit test/markdown
    89        after_success: echo 'Tests Passed'
    90        after_failure: echo 'Failure in unit, sanity, or markdown test'
    91  
    92      # Build and deploy ansible-operator docker image
    93      - <<: *deploy
    94        name: Docker image for ansible-operator
    95        script:
    96          - make image/build/ansible
    97          - make image/push/ansible
    98  
    99      # Build and deploy helm-operator docker image
   100      - <<: *deploy
   101        name: Docker image for helm-operator
   102        script:
   103          - make image/build/helm
   104          - make image/push/helm
   105  
   106      # Build and deploy scorecard-proxy docker image
   107      - <<: *deploy
   108        name: Docker image for scorecard-proxy
   109        script:
   110          - make image/build/scorecard-proxy
   111          - make image/push/scorecard-proxy