Skip to content

Commit

Permalink
Merge pull request #339 from garden-io/improve-ci
Browse files Browse the repository at this point in the history
chore(ci): Clean up circleci configs
  • Loading branch information
edvald authored Oct 24, 2018
2 parents b533a6b + 333201f commit c11b16a
Showing 1 changed file with 27 additions and 87 deletions.
114 changes: 27 additions & 87 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,33 @@
#
version: 2
jobs:
build:
test-node:
docker:
# specify the version you desire here
- image: circleci/node:10

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/repo

steps:
- checkout

- setup_remote_docker:
docker_layer_caching: true

- run:
name: Install apt dependencies
command: sudo apt install rsync cmake libicu-dev pkg-config

- run:
name: Install kubectl
command: |
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- run: sudo apt-get update && sudo apt-get install rsync

# Download and cache dependencies
- restore_cache:
keys:
- v3-dependencies-{{ checksum "package-lock.json" }}

# install using package-lock only
- root-{{ checksum "package-lock.json" }}
- restore_cache:
keys:
- garden-service-{{ checksum "garden-service/package-lock.json" }}
# Install npm deps
- run: npm ci
- run: node_modules/.bin/lerna bootstrap --ci

- save_cache:
paths:
- node_modules
- garden-service/node_modules
key: v3-dependencies-{{ checksum "package-lock.json" }}

# a couple of special cases needed just for local builds
- run: |
if [[ $CIRCLE_SHELL_ENV == *"localbuild"* ]]; then
sudo chown $(whoami): /var/run/docker.sock
npm rebuild
fi
paths: [node_modules]
key: root-{{ checksum "package-lock.json" }}
- save_cache:
paths: [garden-service/node_modules]
key: garden-service-{{ checksum "garden-service/package-lock.json" }}

- run:
name: Make sure generated docs are up-to-date
Expand All @@ -60,57 +39,18 @@ jobs:
npm run check-docs
# build, lint and run tests
- run: npm run build
- run: npm run lint
- run: npm test

# minikube-tests:
# # got this from https://github.com/gavinzhou/ci-minikube/blob/master/.circleci/config.yml
# machine: true
# environment:
# CHANGE_MINIKUBE_NONE_USER: true
# BASH_ENV: ~/.bashrc
# steps:
# - checkout
# - run:
# command: |
# curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# - run:
# command: |
# ## only run 0.25.0 , not work after 0.25.0+
# ## because circleci machine run ubuntu 14
# curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
# - run: sudo minikube start --vm-driver=none
# - run: sudo minikube update-context
# - run:
# name: Install node@8
# # https://discuss.circleci.com/t/how-to-change-node-version-in-circleci-2-0/17455
# command: |
# set +e
# touch $BASH_ENV
# curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
# echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
# echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
# echo 'nvm install 8' >> $BASH_ENV
# echo 'nvm alias default 8' >> $BASH_ENV
# - run:
# # for some reason we need to manually source $BASH_ENV (CircleCI machine executer is poorly documented...)
# command: |
# source $BASH_ENV
# npm install
# npm run build
# - run:
# command: |
# JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until sudo kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
# - run: sudo kubectl cluster-info
# - run:
# command: |
# source $BASH_ENV
# ./bin/integ
#
#workflows:
# version: 2
# all-tests:
# jobs:
# - unit-tests
# - minikube-tests
- run:
name: npm build
command: npm run build
- run:
name: npm lint
command: npm run lint
- run:
name: npm test
command: npm test

workflows:
version: 2
all-tests:
jobs:
- test-node

0 comments on commit c11b16a

Please sign in to comment.