chore: CircleCI Images (#3341)
* chore: Upgrade from deprecated images * img * fix: No default postgres user/pass anymore * parallel * config * migrate * split frontend/backend tests * fix * resource_class * node * node
This commit is contained in:
@@ -1,28 +1,36 @@
|
|||||||
version: 2.1
|
version: 2.1
|
||||||
|
|
||||||
|
defaults: &defaults
|
||||||
|
working_directory: ~/outline
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:14.19
|
||||||
|
- image: cimg/redis:5.0
|
||||||
|
- image: cimg/postgres:14.2
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: password
|
||||||
|
POSTGRES_DB: circle_test
|
||||||
|
resource_class: large
|
||||||
|
environment:
|
||||||
|
NODE_ENV: test
|
||||||
|
SECRET_KEY: F0E5AD933D7F6FD8F4DBB3E038C501C052DC0593C686D21ACB30AE205D2F634B
|
||||||
|
DATABASE_URL_TEST: postgres://postgres:password@localhost:5432/circle_test
|
||||||
|
DATABASE_URL: postgres://postgres:password@localhost:5432/circle_test
|
||||||
|
URL: http://localhost:3000
|
||||||
|
SMTP_FROM_EMAIL: hello@example.com
|
||||||
|
AWS_S3_UPLOAD_BUCKET_URL: https://s3.amazonaws.com
|
||||||
|
AWS_S3_UPLOAD_BUCKET_NAME: outline-circle
|
||||||
|
|
||||||
executors:
|
executors:
|
||||||
docker-publisher:
|
docker-publisher:
|
||||||
environment:
|
environment:
|
||||||
IMAGE_NAME: outlinewiki/outline
|
IMAGE_NAME: outlinewiki/outline
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/buildpack-deps:stretch
|
- image: cimg/base
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
working_directory: ~/outline
|
<<: *defaults
|
||||||
docker:
|
|
||||||
- image: circleci/node:14
|
|
||||||
- image: circleci/redis:latest
|
|
||||||
- image: circleci/postgres:9.6.5-alpine-ram
|
|
||||||
environment:
|
|
||||||
NODE_ENV: test
|
|
||||||
SECRET_KEY: F0E5AD933D7F6FD8F4DBB3E038C501C052DC0593C686D21ACB30AE205D2F634B
|
|
||||||
DATABASE_URL_TEST: postgres://root@localhost:5432/circle_test
|
|
||||||
DATABASE_URL: postgres://root@localhost:5432/circle_test
|
|
||||||
URL: http://localhost:3000
|
|
||||||
SMTP_FROM_EMAIL: hello@example.com
|
|
||||||
AWS_S3_UPLOAD_BUCKET_URL: https://s3.amazonaws.com
|
|
||||||
AWS_S3_UPLOAD_BUCKET_NAME: outline-circle
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
@@ -34,18 +42,51 @@ jobs:
|
|||||||
key: dependency-cache-{{ checksum "package.json" }}
|
key: dependency-cache-{{ checksum "package.json" }}
|
||||||
paths:
|
paths:
|
||||||
- ./node_modules
|
- ./node_modules
|
||||||
|
lint:
|
||||||
|
<<: *defaults
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- restore_cache:
|
||||||
|
key: dependency-cache-{{ checksum "package.json" }}
|
||||||
|
- run:
|
||||||
|
name: lint
|
||||||
|
command: yarn lint
|
||||||
|
types:
|
||||||
|
<<: *defaults
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- restore_cache:
|
||||||
|
key: dependency-cache-{{ checksum "package.json" }}
|
||||||
|
- run:
|
||||||
|
name: typescript
|
||||||
|
command: yarn tsc
|
||||||
|
test-app:
|
||||||
|
<<: *defaults
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- restore_cache:
|
||||||
|
key: dependency-cache-{{ checksum "package.json" }}
|
||||||
|
- run:
|
||||||
|
name: test
|
||||||
|
command: yarn test:app
|
||||||
|
test-server:
|
||||||
|
<<: *defaults
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- restore_cache:
|
||||||
|
key: dependency-cache-{{ checksum "package.json" }}
|
||||||
- run:
|
- run:
|
||||||
name: migrate
|
name: migrate
|
||||||
command: ./node_modules/.bin/sequelize db:migrate --url $DATABASE_URL_TEST
|
command: ./node_modules/.bin/sequelize db:migrate --url $DATABASE_URL_TEST
|
||||||
- run:
|
|
||||||
name: lint
|
|
||||||
command: yarn lint
|
|
||||||
- run:
|
|
||||||
name: typescript
|
|
||||||
command: yarn tsc
|
|
||||||
- run:
|
- run:
|
||||||
name: test
|
name: test
|
||||||
command: yarn test
|
command: yarn test:server
|
||||||
|
bundle-size:
|
||||||
|
<<: *defaults
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- restore_cache:
|
||||||
|
key: dependency-cache-{{ checksum "package.json" }}
|
||||||
- run:
|
- run:
|
||||||
name: build-webpack
|
name: build-webpack
|
||||||
command: yarn build:webpack
|
command: yarn build:webpack
|
||||||
@@ -103,12 +144,26 @@ jobs:
|
|||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
build-and-test:
|
all:
|
||||||
jobs:
|
jobs:
|
||||||
- build:
|
- build
|
||||||
filters:
|
- lint:
|
||||||
tags:
|
requires:
|
||||||
ignore: /^v.*/
|
- build
|
||||||
|
- test-server:
|
||||||
|
requires:
|
||||||
|
- build
|
||||||
|
- test-app:
|
||||||
|
requires:
|
||||||
|
- build
|
||||||
|
- types:
|
||||||
|
requires:
|
||||||
|
- build
|
||||||
|
- bundle-size:
|
||||||
|
requires:
|
||||||
|
- test-app
|
||||||
|
- test-server
|
||||||
|
|
||||||
build-docker:
|
build-docker:
|
||||||
jobs:
|
jobs:
|
||||||
- build-image:
|
- build-image:
|
||||||
|
|||||||
Reference in New Issue
Block a user