2021-06-14 11:29:03 +02:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
commands:
|
|
|
|
install_dependencies:
|
|
|
|
description: "Installs dependencies and uses CircleCI's cache"
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- dependencies-{{ checksum "yarn.lock" }}
|
|
|
|
- dependencies-
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
yarn install
|
|
|
|
- save_cache:
|
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
key: dependencies-{{ checksum "yarn.lock" }}
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
style:
|
|
|
|
docker:
|
|
|
|
- image: node:latest
|
|
|
|
steps:
|
|
|
|
- install_dependencies
|
|
|
|
- run:
|
|
|
|
name: prettier
|
|
|
|
command: |
|
|
|
|
yarn prettier --check
|
|
|
|
- run:
|
|
|
|
name: lint
|
|
|
|
command: |
|
|
|
|
yarn lint
|
|
|
|
|
2021-06-14 11:30:46 +02:00
|
|
|
dashboard:
|
2021-06-14 11:29:03 +02:00
|
|
|
docker:
|
|
|
|
- image: node:latest
|
|
|
|
steps:
|
|
|
|
- install_dependencies
|
|
|
|
- run:
|
|
|
|
name: typecheck
|
|
|
|
command: |
|
|
|
|
yarn typecheck
|
|
|
|
- run:
|
|
|
|
name: test
|
|
|
|
command: |
|
2021-06-24 12:25:31 +02:00
|
|
|
yarn test --coverage
|
2021-06-14 11:29:03 +02:00
|
|
|
- run:
|
|
|
|
name: coverage
|
|
|
|
command: |
|
|
|
|
yarn coverage
|
|
|
|
|
2021-11-22 20:55:10 +01:00
|
|
|
build:
|
|
|
|
docker:
|
|
|
|
- image: docker:latest
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- setup_remote_docker:
|
|
|
|
version: 20.10.7
|
|
|
|
- run:
|
2021-11-30 23:06:50 +01:00
|
|
|
name: Log in to Docker
|
2021-11-22 20:55:10 +01:00
|
|
|
command: |
|
2021-11-30 23:06:50 +01:00
|
|
|
docker login --username ${DOCKER_USER} --password ${DOCKER_PASSWORD}
|
2021-11-22 20:55:10 +01:00
|
|
|
- run:
|
2021-11-30 23:06:50 +01:00
|
|
|
name: Install docker buildx
|
2021-11-22 20:55:10 +01:00
|
|
|
command: |
|
2021-11-30 23:06:50 +01:00
|
|
|
apk add --no-cache curl
|
|
|
|
mkdir -p ~/.docker/cli-plugins
|
|
|
|
baseUrl="https://github.com/docker/buildx/releases/download"
|
|
|
|
fileName="buildx-v0.7.1.linux-amd64"
|
|
|
|
url="${baseUrl}/v0.7.1/${fileName}"
|
|
|
|
curl -sSL -o ~/.docker/cli-plugins/docker-buildx $url
|
|
|
|
chmod a+x ~/.docker/cli-plugins/docker-buildx
|
|
|
|
echo 'export DOCKER_CLI_EXPERIMENTAL="enabled"' >> $BASH_ENV
|
2021-11-22 20:55:10 +01:00
|
|
|
- run:
|
2021-11-30 23:06:50 +01:00
|
|
|
name: Prepare docker buildx
|
2021-11-22 20:55:10 +01:00
|
|
|
command: |
|
2021-11-30 23:06:50 +01:00
|
|
|
docker buildx install
|
|
|
|
docker version
|
|
|
|
docker buildx version
|
|
|
|
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
|
|
|
docker context create xbuilder
|
|
|
|
docker buildx create xbuilder --name xbuilder --driver-opt image=moby/buildkit:master --use
|
|
|
|
docker buildx inspect --bootstrap
|
|
|
|
- run:
|
|
|
|
name: Build all platforms
|
2021-11-22 20:55:10 +01:00
|
|
|
command: |
|
2021-11-30 23:06:50 +01:00
|
|
|
docker buildx build \
|
2021-11-30 23:09:51 +01:00
|
|
|
--platform=linux/amd64,linux/arm64/v8,linux/arm/v7 \
|
2021-11-30 23:06:50 +01:00
|
|
|
-t phntxx/dashboard:latest --push .
|
2021-11-22 20:55:10 +01:00
|
|
|
|
2021-06-14 11:29:03 +02:00
|
|
|
workflows:
|
|
|
|
version: 2
|
2021-06-14 11:30:46 +02:00
|
|
|
dashboard:
|
2021-06-14 11:29:03 +02:00
|
|
|
jobs:
|
|
|
|
- style
|
2021-06-14 11:30:46 +02:00
|
|
|
- dashboard
|
2021-11-22 20:55:10 +01:00
|
|
|
- build:
|
|
|
|
requires:
|
|
|
|
- style
|
|
|
|
- dashboard
|