misskey/.circleci/config.yml
Acid Chicken (硫酸鶏) be48df62b3
Fix typo
2019-05-12 18:06:06 +09:00

255 lines
6.9 KiB
YAML

version: 2.1
executors:
v11-node11:
working_directory: /tmp/workspace
docker:
- image: misskey/ci:v11-node11
- image: circleci/postgres:latest
- image: circleci/redis:latest
v11-node8:
working_directory: /tmp/workspace
docker:
- image: misskey/ci:v11-node8
- image: circleci/postgres:latest
- image: circleci/redis:latest
v10-node11:
working_directory: /tmp/workspace
docker:
- image: misskey/ci:v10-node11
- image: circleci/mongo:latest
v10-node11-redis:
working_directory: /tmp/workspace
docker:
- image: misskey/ci:v10-node11
- image: circleci/mongo:latest
v10-node8:
working_directory: /tmp/workspace
docker:
- image: misskey/ci:v10-node8
- image: circleci/mongo:latest
- image: circleci/redis:latest
v10-node8-redis:
working_directory: /tmp/workspace
docker:
- image: misskey/ci:v10-node8
- image: circleci/mongo:latest
- image: circleci/redis:latest
docker:
working_directory: /tmp/workspace
docker:
- image: misskey/ci:docker
jobs:
nodejs-build:
parameters:
executor:
type: string
default: "v11-node11"
executor: <<parameters.executor>>
steps:
- checkout
- run:
name: Ensure yarn.lock
command: |
touch yarn.lock
- restore_cache:
name: Restore npm package caches
keys:
- yarn-v1-arch-{{ arch }}-env-{{ .Environment.variableName }}-package-{{ checksum "package.json" }}-lock-{{ checksum "yarn.lock" }}
- yarn-v1-arch-{{ arch }}-env-{{ .Environment.variableName }}-package-{{ checksum "package.json" }}-
- yarn-v1-arch-{{ arch }}-env-{{ .Environment.variableName }}-
- yarn-v1-arch-{{ arch }}-
- yarn-v1-
- run:
name: Install Dependencies
command: |
yarn install
- run:
name: Configure
command: |
cp .circleci/<<parameters.executor>>/default.yml .config
cp .circleci/<<parameters.executor>>/test.yml .config
- run:
name: Build
command: |
yarn build
touch yarn.lock
- save_cache:
name: Cache npm packages
key: yarn-v1-arch-{{ arch }}-env-{{ .Environment.variableName }}-package-{{ checksum "package.json" }}-lock-{{ checksum "yarn.lock" }}
paths:
- node_modules
- persist_to_workspace:
root: .
paths:
- .
nodejs-test:
parameters:
executor:
type: string
default: "default"
executor: <<parameters.executor>>
steps:
- attach_workspace:
at: /tmp/workspace
- run:
name: Test
command: |
yarn test
touch yarn.lock
- save_cache:
name: Cache npm packages
key: yarn-v1-arch-{{ arch }}-env-{{ .Environment.variableName }}-package-{{ checksum "package.json" }}-lock-{{ checksum "yarn.lock" }}
paths:
- node_modules
docker-build:
executor: docker
steps:
- checkout
- setup_remote_docker
- run:
name: Build
command: |
docker build -t misskey/misskey .
- persist_to_workspace:
root: .
paths:
- .
docker-deploy:
executor: docker
steps:
- attach_workspace:
at: /tmp/workspace
- run:
name: Deploy
command: |
if [ "$DOCKERHUB_USERNAME$DOCKERHUB_PASSWORD" ]
then
docker tag misskey/misskey misskey/misskey:$(cat package.json | jq -r .version)
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
docker push misskey/misskey
else
echo -e '\033[0;33mAborted deploying to Docker Hub\033[0;39m'
fi
workflows:
version: 2
nodejs:
jobs:
- nodejs-build:
name: auto-build-v11-node11
executor: v11-node11
filters:
branches:
ignore:
- l10n_develop
- imgbot
- patch/autogen/v10
- patch/autogen/v11
- v10
- nodejs-test:
name: auto-test-v11-node11
executor: v11-node11
requires:
- auto-build-v11-node11
filters:
branches:
ignore:
- l10n_develop
- imgbot
- patch/autogen/v10
- patch/autogen/v11
- v10
- nodejs-build:
name: auto-build-v11-node8
executor: v11-node8
filters:
branches:
ignore:
- l10n_develop
- imgbot
- patch/autogen/v10
- patch/autogen/v11
- v10
- nodejs-test:
name: auto-test-v11-node8
executor: v11-node8
requires:
- auto-build-v11-node8
filters:
branches:
ignore:
- l10n_develop
- imgbot
- patch/autogen/v10
- patch/autogen/v11
- v10
- nodejs-build:
name: auto-build-v10-node11
executor: v10-node11
filters:
branches:
only: v10
- nodejs-test:
name: auto-test-v10-node11
executor: v10-node11
requires:
- auto-build-v10-node11
filters:
branches:
only: v10
- nodejs-build:
name: auto-build-v10-node11-redis
executor: v10-node11-redis
filters:
branches:
only: v10
- nodejs-test:
name: auto-test-v10-node11-redis
executor: v10-node11-redis
requires:
- auto-build-v10-node11-redis
filters:
branches:
only: v10
- nodejs-build:
name: auto-build-v10-node8
executor: v10-node8
filters:
branches:
only: v10
- nodejs-test:
name: auto-test-v10-node8
executor: v10-node8
requires:
- auto-build-v10-node8
filters:
branches:
only: v10
- nodejs-build:
name: auto-build-v10-node8-redis
executor: v10-node8-redis
filters:
branches:
only: v10
- nodejs-test:
name: auto-test-v10-node8-redis
executor: v10-node8-redis
requires:
- auto-build-v10-node8-redis
filters:
branches:
only: v10
docker:
jobs:
- docker-build:
name: auto-build
- docker-deploy:
name: auto-deploy
requires:
- auto-build
filters:
branches:
only: master