diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0ed3832c..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,173 +0,0 @@ -commands: - early_return_for_forked_pull_requests: - description: >- - If this build is from a fork, stop executing the current job and return success. - This is useful to avoid steps that will fail due to missing credentials. - steps: - - run: - name: Early return if this build is from a forked PR - command: | - if [ -n "$CIRCLE_PR_NUMBER" ]; then - echo "Nothing to do for forked PRs, so marking this step successful" - circleci step halt - fi - installing_s2h_deps: - description: > - Install samsahai required tools and dependencies - steps: - - checkout - - restore_cache: - key: gopkg-1.13.6-{{ .Branch }}-{{ checksum "go.mod" }} - paths: - - /home/circleci/go/pkg/mod - - run: - name: Install Go - command: | - go version - go env GOROOT - mkdir tmp - cd tmp - sudo rm -rf /usr/local/go - wget https://storage.googleapis.com/golang/go$GOVERSION.$OS-$ARCH.tar.gz - sudo tar -C /usr/local -xzf go$GOVERSION.$OS-$ARCH.tar.gz - go version - - run: - name: Install Dependencies - command: | - sudo mkdir -p $GOPATH/bin - sudo chmod -R ugo+rw $GOPATH/bin - - make install-dep SUDO="sudo " DEBUG=1 - - echo 'export GO111MODULE="on"' >> $BASH_ENV - echo 'export PATH=$PATH:/usr/local/go/bin:/usr/local/kubebuilder/bin:$GOPATH/bin' >> $BASH_ENV - - export GO111MODULE=on - go mod tidy - - save_cache: - key: gopkg-1.13.6-{{ .Branch }}-{{ checksum "go.mod" }} - paths: - - /home/circleci/go/pkg/mod - - -version: 2.1 -jobs: - build: - machine: - image: ubuntu-1604:201903-01 - - environment: - CI: true - KUBECONFIG: /tmp/s2h/k3s-kubeconfig - GOPATH: /home/circleci/go - INSTALL_DIR: /home/circleci/go/bin/ - POD_NAMESPACE: default - GOVERSION: 1.13.6 - OS: linux - ARCH: amd64 - - working_directory: /home/circleci/go/src/github.com/agoda-com/samsahai - steps: - - - installing_s2h_deps - - # run unit test - - run: - name: Run Unit Test - command: | - make unit-test - - - run: - name: Unit Test Coverage - command: | - make overall-coverage - - - run: - name: Prepare E2E Test Environment - command: | - make prepare-env-e2e-k3d - - # run e2e test - - run: - name: Run E2E Test - command: | - kubectl version - kubectl cluster-info - helm version - - make e2e-test-k3d DEBUG=1 - no_output_timeout: 30m - - - run: - name: E2E Test Coverage - command: | - make overall-coverage - curl -s https://codecov.io/bash | bash -s - -t $CODECOV_TOKEN - - - run: - name: Save test results - command: | - mkdir -p ./test/result/ - find . -type f -regex "./.*unit-test.xml" -exec cp {} ./test/result/ \; - ls -al ./test/result/ - when: always - - - store_test_results: - path: ./test/result - - - store_artifacts: - path: ./test/result - - release: - machine: - image: ubuntu-1604:201903-01 - - environment: - CI: true - KUBECONFIG: /tmp/s2h/k3s-kubeconfig - GOPATH: /home/circleci/go - INSTALL_DIR: /home/circleci/go/bin/ - POD_NAMESPACE: default - GOVERSION: 1.13.6 - OS: linux - ARCH: amd64 - - working_directory: /home/circleci/go/src/github.com/agoda-com/samsahai - steps: - - early_return_for_forked_pull_requests - - installing_s2h_deps - - - run: - name: Prepared Env vars. - command: | - echo 'export DOCKER_USER="$QUAY_DOCKER_USER"' >> $BASH_ENV - echo 'export DOCKER_PASSWORD="$QUAY_DOCKER_TOKEN"' >> $BASH_ENV - echo 'export GITHUB_TOKEN="$GITHUB_TOKEN"' >> $BASH_ENV - echo 'export GITHUB_REPO="agoda-com/samsahai"' >> $BASH_ENV - echo 'export INSTALL_DIR="$(pwd)/bin/"' >> $BASH_ENV - - - run: - name: Release - command: | - ls -al - rm -rf tmp - make auto-release - - - run: - name: Docker logout - when: always - command: | - make .docker-logout - -workflows: - version: 2 - build-deploy: - jobs: - - build -# - release: -# requires: -# - build -# filters: -# branches: -# only: -# - master diff --git a/README.md b/README.md index cdf63319..f4046938 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # Samsahai (S2H) -[![CircleCI](https://circleci.com/gh/agoda-com/samsahai.svg?style=svg)](https://circleci.com/gh/agoda-com/samsahai) ![Samsahai](https://github.com/agoda-com/samsahai/workflows/Samsahai/badge.svg) [![codecov](https://codecov.io/gh/agoda-com/samsahai/branch/master/graph/badge.svg?token=mt0oLjFy0k)](https://codecov.io/gh/agoda-com/samsahai) [![Docker Repository on Quay](https://quay.io/repository/samsahai/samsahai/status "Docker Repository on Quay")](https://quay.io/repository/samsahai/samsahai)