--- dist: trusty sudo: false # We do not test pushes to branches, since they are redundant with the pull_request build # for each branch. Take that, Big CI! branches: only: - master stages: - name: test - name: docker-deploy if: branch = master AND type != pull_request jobs: include: # Compile the application and run tests. - stage: test language: rust rust: stable cache: cargo install: - cargo fetch --locked script: - cargo test --frozen - language: go go: 1.9 go_import_path: github.com/runconduit/conduit cache: directories: - vendor install: - ./bin/dep ensure script: # TODO decide whether protoc should be committed or not. If so, we shouldn't do # this or we should error if it dirties the repo. - ./bin/protoc-go.sh - go test -race -v ./... - go vet ./... - language: node_js node_js: - "8" cache: directories: - web/app/node_modules before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2 - export PATH="$HOME/.yarn/bin:$PATH" install: - cd web/app && yarn && yarn webpack script: - yarn karma start --single-run --reporters dots - language: generic script: - | ( . bin/_tag.sh for f in $( grep -lR --include=Dockerfile\* go-deps: . ) ; do validate_go_deps_tag $f done ) # Push container images to Google Container Registry. - stage: docker-deploy language: generic services: - docker cache: directories: - "$HOME/google-cloud-sdk/" before_install: - docker version - | # Install gcloud and kubectl. dir="${CLOUDSDK_INSTALL_DIR:-${HOME}}/google-cloud-sdk" export CLOUDSDK_CORE_DISABLE_PROMPTS=1 if [ -d "$dir/bin" ]; then . "$dir/path.bash.inc" gcloud components update else rm -rf "$dir" curl https://sdk.cloud.google.com | bash . "$dir/path.bash.inc" fi gcloud components install kubectl - | # Configure gcloud with a service account. openssl aes-256-cbc -K $encrypted_6af64675f81c_key -iv $encrypted_6af64675f81c_iv -in .gcp.json.enc -out .gcp.json -d gcloud auth activate-service-account --key-file .gcp.json gcloud config set core/project "$GCP_PROJECT" gcloud config set compute/zone "$GCP_ZONE" gcloud config set container/cluster "$GKE_CLUSTER" - | # Get a kubernetes context. (. bin/_gcp.sh ; get_k8s_ctx "$GCP_PROJECT" "$GCP_ZONE" "$GKE_CLUSTER") - gcloud version - kubectl version --short before_script: - gcloud docker --authorize-only - bin/docker-pull-deps - bin/docker-pull master - | export CONDUIT_TAG=$(. bin/_tag.sh ; clean_head_root_tag) echo "CONDUIT_TAG=${CONDUIT_TAG}" - export BUILD_DEBUG=1 DOCKER_TRACE=1 script: # Proxy tests are run in the `test` stage, re-running them here would be # redundant/slow. #280 - PROXY_SKIP_TESTS=1 bin/docker-build after_success: - bin/docker-push-deps - bin/docker-push $CONDUIT_TAG - bin/docker-retag-all $CONDUIT_TAG master && bin/docker-push master - target/cli/linux/conduit install --conduit-version=$CONDUIT_TAG |tee conduit.yml - kubectl -n conduit apply -f conduit.yml --prune --selector='conduit.io/control-plane-component' notifications: email: on_success: never