2018-10-30 04:36:14 +01:00
|
|
|
version: 2.1
|
2018-10-29 13:48:35 +01:00
|
|
|
|
2018-10-30 04:36:14 +01:00
|
|
|
executors:
|
2019-05-12 11:04:39 +02:00
|
|
|
v11-node11:
|
2019-02-09 18:17:43 +01:00
|
|
|
working_directory: /tmp/workspace
|
|
|
|
docker:
|
2019-05-12 10:27:27 +02:00
|
|
|
- image: misskey/ci:v11-node11
|
2019-05-12 11:04:39 +02:00
|
|
|
- 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
|
2019-05-12 10:38:37 +02:00
|
|
|
- image: circleci/mongo:latest
|
2019-05-12 11:04:39 +02:00
|
|
|
v10-node8:
|
2019-05-12 10:38:37 +02:00
|
|
|
working_directory: /tmp/workspace
|
|
|
|
docker:
|
2019-05-12 11:04:39 +02:00
|
|
|
- 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
|
2019-05-12 10:38:37 +02:00
|
|
|
- image: circleci/mongo:latest
|
2018-10-30 04:36:14 +01:00
|
|
|
- image: circleci/redis:latest
|
|
|
|
docker:
|
|
|
|
working_directory: /tmp/workspace
|
2018-10-26 20:46:48 +02:00
|
|
|
docker:
|
2019-05-12 11:04:39 +02:00
|
|
|
- image: misskey/ci:docker
|
2018-10-30 04:36:14 +01:00
|
|
|
|
|
|
|
jobs:
|
2019-05-12 11:04:39 +02:00
|
|
|
nodejs-build:
|
|
|
|
parameters:
|
|
|
|
executor:
|
|
|
|
type: string
|
|
|
|
default: "v11-node11"
|
|
|
|
executor: <<parameters.executor>>
|
2018-10-26 20:46:48 +02:00
|
|
|
steps:
|
|
|
|
- checkout
|
2019-01-27 12:19:24 +01:00
|
|
|
- run:
|
|
|
|
name: Ensure yarn.lock
|
|
|
|
command: |
|
|
|
|
touch yarn.lock
|
2018-10-30 04:36:14 +01:00
|
|
|
- restore_cache:
|
|
|
|
name: Restore npm package caches
|
|
|
|
keys:
|
2019-01-27 12:13:06 +01:00
|
|
|
- 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-
|
2018-10-26 20:46:48 +02:00
|
|
|
- run:
|
2018-10-30 04:36:14 +01:00
|
|
|
name: Install Dependencies
|
2018-10-26 20:46:48 +02:00
|
|
|
command: |
|
2019-02-03 08:57:36 +01:00
|
|
|
yarn install
|
2018-10-26 20:46:48 +02:00
|
|
|
- run:
|
2018-10-30 04:36:14 +01:00
|
|
|
name: Configure
|
2018-10-26 20:46:48 +02:00
|
|
|
command: |
|
2019-05-12 11:04:39 +02:00
|
|
|
cp .circleci/<<parameters.executor>>/default.yml .config
|
|
|
|
cp .circleci/<<parameters.executor>>/test.yml .config
|
2018-10-26 20:46:48 +02:00
|
|
|
- run:
|
2018-10-30 04:36:14 +01:00
|
|
|
name: Build
|
2018-10-26 20:46:48 +02:00
|
|
|
command: |
|
2019-01-27 12:13:06 +01:00
|
|
|
yarn build
|
2019-01-27 12:19:24 +01:00
|
|
|
touch yarn.lock
|
2018-10-30 04:36:14 +01:00
|
|
|
- save_cache:
|
|
|
|
name: Cache npm packages
|
2019-01-27 12:13:06 +01:00
|
|
|
key: yarn-v1-arch-{{ arch }}-env-{{ .Environment.variableName }}-package-{{ checksum "package.json" }}-lock-{{ checksum "yarn.lock" }}
|
2018-10-30 04:36:14 +01:00
|
|
|
paths:
|
|
|
|
- node_modules
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- .
|
2019-05-12 11:04:39 +02:00
|
|
|
nodejs-test:
|
2018-10-30 04:36:14 +01:00
|
|
|
parameters:
|
2019-02-09 18:17:43 +01:00
|
|
|
executor:
|
2018-10-30 04:36:14 +01:00
|
|
|
type: string
|
2019-02-09 18:17:43 +01:00
|
|
|
default: "default"
|
|
|
|
executor: <<parameters.executor>>
|
2018-10-30 04:36:14 +01:00
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /tmp/workspace
|
2018-10-26 20:46:48 +02:00
|
|
|
- run:
|
2018-10-30 04:36:14 +01:00
|
|
|
name: Test
|
2018-10-26 20:46:48 +02:00
|
|
|
command: |
|
2019-01-27 12:13:06 +01:00
|
|
|
yarn test
|
2019-01-27 12:19:24 +01:00
|
|
|
touch yarn.lock
|
2018-10-30 04:36:14 +01:00
|
|
|
- save_cache:
|
|
|
|
name: Cache npm packages
|
2019-01-27 12:13:06 +01:00
|
|
|
key: yarn-v1-arch-{{ arch }}-env-{{ .Environment.variableName }}-package-{{ checksum "package.json" }}-lock-{{ checksum "yarn.lock" }}
|
2018-10-30 04:36:14 +01:00
|
|
|
paths:
|
|
|
|
- node_modules
|
2019-05-12 11:04:39 +02:00
|
|
|
docker-build:
|
2018-10-30 04:36:14 +01:00
|
|
|
executor: docker
|
2018-10-26 20:46:48 +02:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- setup_remote_docker
|
|
|
|
- run:
|
2018-10-30 04:36:14 +01:00
|
|
|
name: Build
|
2018-10-26 20:46:48 +02:00
|
|
|
command: |
|
2018-11-06 18:06:32 +01:00
|
|
|
docker build -t misskey/misskey .
|
2019-05-12 11:04:39 +02:00
|
|
|
- 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
|
2018-10-26 20:46:48 +02:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
2019-02-09 18:17:43 +01:00
|
|
|
nodejs:
|
2018-10-26 20:46:48 +02:00
|
|
|
jobs:
|
2019-05-12 11:04:39 +02:00
|
|
|
- nodejs-build:
|
|
|
|
name: auto-build-v11-node11
|
|
|
|
executor: v11-node11
|
2019-02-16 03:10:06 +01:00
|
|
|
filters:
|
|
|
|
branches:
|
2019-05-12 11:04:39 +02:00
|
|
|
ignore:
|
|
|
|
- l10n_develop
|
|
|
|
- imgbot
|
|
|
|
- patch/autogen/v10
|
|
|
|
- patch/autogen/v11
|
|
|
|
- v10
|
|
|
|
- tnodejs-est:
|
|
|
|
name: auto-test-v11-node11
|
|
|
|
executor: v11-node11
|
2019-02-16 03:10:06 +01:00
|
|
|
requires:
|
2019-05-12 11:04:39 +02:00
|
|
|
- auto-build-v11-node11
|
2019-02-17 18:44:46 +01:00
|
|
|
filters:
|
|
|
|
branches:
|
2019-05-12 11:04:39 +02:00
|
|
|
ignore:
|
|
|
|
- l10n_develop
|
|
|
|
- imgbot
|
|
|
|
- patch/autogen/v10
|
|
|
|
- patch/autogen/v11
|
|
|
|
- v10
|
|
|
|
- nodejs-build:
|
|
|
|
name: auto-build-v11-node8
|
|
|
|
executor: v11-node8
|
2019-02-17 18:44:46 +01:00
|
|
|
filters:
|
|
|
|
branches:
|
2019-05-12 11:04:39 +02:00
|
|
|
ignore:
|
|
|
|
- l10n_develop
|
|
|
|
- imgbot
|
|
|
|
- patch/autogen/v10
|
|
|
|
- patch/autogen/v11
|
|
|
|
- v10
|
|
|
|
- nodejs-test:
|
|
|
|
name: auto-test-v11-node8
|
|
|
|
executor: v11-node8
|
2019-05-12 10:39:03 +02:00
|
|
|
requires:
|
2019-05-12 11:04:39 +02:00
|
|
|
- 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
|
2019-05-12 10:39:03 +02:00
|
|
|
filters:
|
|
|
|
branches:
|
2019-05-12 11:04:39 +02:00
|
|
|
only: v10
|
|
|
|
- nodejs-test:
|
|
|
|
name: auto-test-v10-node11
|
|
|
|
executor: v10-node11
|
2019-05-12 10:39:03 +02:00
|
|
|
requires:
|
2019-05-12 11:04:39 +02:00
|
|
|
- auto-build-v10-node11
|
2019-05-12 10:39:03 +02:00
|
|
|
filters:
|
|
|
|
branches:
|
2019-05-12 11:04:39 +02:00
|
|
|
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
|
2018-10-30 04:36:14 +01:00
|
|
|
requires:
|
2019-05-12 11:04:39 +02:00
|
|
|
- auto-build-v10-node11-redis
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: v10
|
|
|
|
- nodejs-build:
|
|
|
|
name: auto-build-v10-node8
|
|
|
|
executor: v10-node8
|
2019-02-16 09:05:56 +01:00
|
|
|
filters:
|
|
|
|
branches:
|
2019-05-12 11:04:39 +02:00
|
|
|
only: v10
|
|
|
|
- nodejs-test:
|
|
|
|
name: auto-test-v10-node8
|
|
|
|
executor: v10-node8
|
2019-02-17 18:44:46 +01:00
|
|
|
requires:
|
2019-05-12 11:04:39 +02:00
|
|
|
- auto-build-v10-node8
|
2019-02-17 18:44:46 +01:00
|
|
|
filters:
|
|
|
|
branches:
|
2019-05-12 11:04:39 +02:00
|
|
|
only: v10
|
|
|
|
- nodejs-build:
|
|
|
|
name: auto-build-v10-node8-redis
|
|
|
|
executor: v10-node8-redis
|
2019-02-09 18:17:43 +01:00
|
|
|
filters:
|
|
|
|
branches:
|
2019-05-12 11:04:39 +02:00
|
|
|
only: v10
|
|
|
|
- nodejs-test:
|
|
|
|
name: auto-test-v10-node8-redis
|
|
|
|
executor: v10-node8-redis
|
2019-02-09 18:17:43 +01:00
|
|
|
requires:
|
2019-05-12 11:04:39 +02:00
|
|
|
- auto-build-v10-node8-redis
|
2019-02-09 18:17:43 +01:00
|
|
|
filters:
|
|
|
|
branches:
|
2019-05-12 11:04:39 +02:00
|
|
|
only: v10
|
|
|
|
docker:
|
|
|
|
jobs:
|
|
|
|
- docker-build:
|
2019-02-17 18:44:46 +01:00
|
|
|
name: auto-build
|
2019-05-12 11:04:39 +02:00
|
|
|
- docker-deploy:
|
|
|
|
name: auto-deploy
|
|
|
|
requires:
|
|
|
|
- auto-build
|
2018-10-30 04:36:14 +01:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|