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