2018-07-10 13:01:02 +03:00
|
|
|
# anchor refs to be used elsewhere
|
|
|
|
refs:
|
2019-03-07 08:58:03 +03:00
|
|
|
skip_job_on_ciignore: &skip_job_on_ciignore
|
|
|
|
run:
|
|
|
|
name: checking if job should be terminated or not
|
|
|
|
command: |
|
|
|
|
if [ -f /build/ciignore/skip_job.txt ]; then
|
|
|
|
echo "halting job due to /build/ciignore/skip_job.txt"
|
|
|
|
circleci-agent step halt
|
|
|
|
else
|
|
|
|
echo "no skip_job file present, full steam ahead"
|
|
|
|
fi
|
2018-07-10 13:01:02 +03:00
|
|
|
wait_for_postgres: &wait_for_postgres
|
|
|
|
run:
|
|
|
|
name: waiting for postgres to be ready
|
|
|
|
command: |
|
|
|
|
for i in `seq 1 60`;
|
|
|
|
do
|
|
|
|
nc -z localhost 5432 && echo Success && exit 0
|
|
|
|
echo -n .
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
echo Failed waiting for Postgres && exit 1
|
2018-10-05 15:37:19 +03:00
|
|
|
wait_for_hge: &wait_for_hge
|
|
|
|
run:
|
|
|
|
name: waiting for graphql-engine to be ready
|
|
|
|
command: |
|
|
|
|
for i in `seq 1 60`;
|
|
|
|
do
|
|
|
|
nc -z localhost 8080 && echo Success && exit 0
|
|
|
|
echo -n .
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
echo Failed waiting for graphql-engine && exit 1
|
|
|
|
|
2018-07-10 13:01:02 +03:00
|
|
|
filter_only_vtags: &filter_only_vtags
|
|
|
|
filters:
|
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
|
|
|
filter_only_release_branches: &filter_only_release_branches
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: /^release-v.*/
|
|
|
|
filter_only_dev_branches: &filter_only_dev_branches
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: /^dev.*/
|
2020-04-01 15:56:54 +03:00
|
|
|
filter_only_vtags_channel_branches: &filter_only_vtags_channel_branches
|
2018-07-10 14:52:13 +03:00
|
|
|
filters:
|
2018-07-11 11:37:34 +03:00
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2018-07-10 14:52:13 +03:00
|
|
|
branches:
|
2020-04-01 15:56:54 +03:00
|
|
|
only: /^(stable|alpha|beta)$/
|
2018-07-10 13:01:02 +03:00
|
|
|
filter_ignore_branches: &filter_ignore_branches
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2018-07-26 08:47:21 +03:00
|
|
|
filter_ignore_dev_release_branches: &filter_ignore_dev_release_branches
|
2018-07-10 13:01:02 +03:00
|
|
|
filters:
|
|
|
|
branches:
|
2018-07-26 08:47:21 +03:00
|
|
|
ignore: /^(dev|release).*/
|
2018-07-11 15:02:29 +03:00
|
|
|
|
2018-07-26 08:47:21 +03:00
|
|
|
setup_remote_docker: &setup_remote_docker
|
|
|
|
setup_remote_docker:
|
|
|
|
version: 17.09.0-ce
|
|
|
|
docker_layer_caching: true
|
|
|
|
|
|
|
|
# ref pg environment for testing
|
|
|
|
test_pg_env: &test_pg_env
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: gql_test
|
|
|
|
POSTGRES_DB: gql_test
|
|
|
|
|
|
|
|
# ref test server job
|
|
|
|
test_server: &test_server
|
2018-09-18 09:21:57 +03:00
|
|
|
working_directory: ~/graphql-engine
|
|
|
|
steps:
|
2019-03-07 08:58:03 +03:00
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
|
|
|
- *skip_job_on_ciignore
|
2018-09-18 09:21:57 +03:00
|
|
|
- checkout
|
|
|
|
- *wait_for_postgres
|
2019-03-12 08:46:27 +03:00
|
|
|
- run:
|
2019-03-25 07:19:23 +03:00
|
|
|
name: Install deps
|
|
|
|
# if the man directories are missing, postgresql-client fails
|
|
|
|
# to install in debian
|
2019-03-12 08:46:27 +03:00
|
|
|
command: |
|
2019-03-14 17:55:33 +03:00
|
|
|
mkdir -p /usr/share/man/man{1,7}
|
2019-03-12 08:46:27 +03:00
|
|
|
apt-get update
|
2019-10-26 08:39:57 +03:00
|
|
|
apt install --yes pgbouncer jq curl postgresql-client-12
|
2019-04-08 10:22:38 +03:00
|
|
|
- run:
|
|
|
|
name: Ensure databases are present
|
|
|
|
environment:
|
2019-11-29 08:14:26 +03:00
|
|
|
# sqlalchemy throws warnings with postgres://
|
|
|
|
DATABASE_URL: 'postgresql://gql_test:@localhost:5432/gql_test'
|
2019-04-08 10:22:38 +03:00
|
|
|
command: |
|
|
|
|
psql "$DATABASE_URL" -c "SELECT 1 FROM pg_database WHERE datname = 'gql_test2'" | grep -q -F '(1 row)' || psql "$DATABASE_URL" -c 'CREATE DATABASE gql_test2;'
|
2018-09-18 09:21:57 +03:00
|
|
|
- run:
|
2019-10-21 19:01:05 +03:00
|
|
|
name: Run tests
|
2018-09-18 09:21:57 +03:00
|
|
|
environment:
|
2019-10-02 09:36:27 +03:00
|
|
|
# Setting default number of threads to 2
|
|
|
|
# since circleci allocates 2 cpus per test container
|
|
|
|
GHCRTS: -N2
|
2020-03-18 20:15:41 +03:00
|
|
|
# Until we can use a real webserver for TestEventFlood, limit concurrency:
|
|
|
|
HASURA_GRAPHQL_EVENTS_HTTP_POOL_SIZE: 8
|
2020-01-18 01:07:15 +03:00
|
|
|
HASURA_GRAPHQL_DATABASE_URL: postgresql://gql_test:@localhost:5432/gql_test
|
|
|
|
HASURA_GRAPHQL_DATABASE_URL_2: postgresql://gql_test:@localhost:5432/gql_test2
|
|
|
|
GRAPHQL_ENGINE: /build/_server_output/graphql-engine
|
|
|
|
GRAPHQL_ENGINE_TESTS: /build/_server_output/graphql-engine-tests
|
|
|
|
MIX_FILES_FOLDER: /build/_server_output/mix
|
|
|
|
command: OUTPUT_FOLDER="/build/_server_test_output/$PG_VERSION" .circleci/test-server.sh
|
2018-09-18 09:21:57 +03:00
|
|
|
- store_artifacts:
|
|
|
|
path: /build/_server_test_output
|
|
|
|
destination: server_test
|
2018-07-10 13:01:02 +03:00
|
|
|
|
2018-06-29 16:09:21 +03:00
|
|
|
version: 2
|
|
|
|
jobs:
|
2018-07-18 08:30:52 +03:00
|
|
|
# check if this should be built or not, fails if
|
|
|
|
# changes only contains files in .ciignore
|
|
|
|
check_build_worthiness:
|
|
|
|
docker:
|
2020-01-11 00:15:47 +03:00
|
|
|
- image: hasura/graphql-engine-cli-builder:20191205
|
2018-07-18 08:30:52 +03:00
|
|
|
working_directory: ~/graphql-engine
|
|
|
|
steps:
|
2019-03-07 08:58:03 +03:00
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
2018-07-18 08:30:52 +03:00
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: check build worthiness
|
|
|
|
command: .circleci/ciignore.sh
|
2019-03-07 08:58:03 +03:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: /build
|
|
|
|
paths:
|
2019-03-14 17:55:33 +03:00
|
|
|
- ciignore
|
2018-07-26 08:47:21 +03:00
|
|
|
|
|
|
|
build_server:
|
2018-06-29 16:09:21 +03:00
|
|
|
docker:
|
2020-01-18 01:07:15 +03:00
|
|
|
- image: hasura/graphql-engine-server-builder:2020-01-14
|
2019-12-09 01:17:39 +03:00
|
|
|
resource_class: large
|
2018-07-03 20:10:13 +03:00
|
|
|
working_directory: ~/graphql-engine
|
2018-06-29 16:09:21 +03:00
|
|
|
steps:
|
2019-03-07 08:58:03 +03:00
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
|
|
|
- *skip_job_on_ciignore
|
2018-07-10 13:01:02 +03:00
|
|
|
- checkout
|
2019-03-25 07:19:23 +03:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2020-01-18 01:07:15 +03:00
|
|
|
- cabal-store-v1-{{ checksum "server/cabal.project" }}-{{ checksum "server/graphql-engine.cabal" }}-{{ checksum "server/cabal.project.freeze" }}
|
|
|
|
- cabal-store-v1-{{ checksum "server/cabal.project" }}-{{ checksum "server/graphql-engine.cabal" }}-
|
|
|
|
- cabal-store-v1-{{ checksum "server/cabal.project" }}-
|
|
|
|
- cabal-store-v1-
|
2019-04-30 11:34:08 +03:00
|
|
|
- run:
|
|
|
|
name: Install latest postgresql client tools
|
|
|
|
command: |
|
|
|
|
apt-get -y update
|
2019-10-26 08:39:57 +03:00
|
|
|
apt-get -y install postgresql-client-12
|
2018-07-10 13:01:02 +03:00
|
|
|
- run:
|
2019-05-16 10:45:29 +03:00
|
|
|
name: Build the binary
|
2018-07-10 13:01:02 +03:00
|
|
|
working_directory: ./server
|
|
|
|
command: |
|
2018-07-26 08:47:21 +03:00
|
|
|
# for PRs non-optimized build, else optimized build
|
|
|
|
if [[ "$CIRCLE_BRANCH" =~ ^(dev|release) || "$CIRCLE_TAG" =~ ^v ]]; then
|
|
|
|
echo "Branch starts with dev or release, or tagged commit starts with v. Optimized build"
|
2020-01-18 01:07:15 +03:00
|
|
|
make ci-build
|
2018-07-26 08:47:21 +03:00
|
|
|
else
|
2019-10-30 19:07:57 +03:00
|
|
|
echo "Non-release branch, build with coverage"
|
2020-01-18 01:07:15 +03:00
|
|
|
make enable_coverage=true ci-build
|
2018-07-26 08:47:21 +03:00
|
|
|
fi
|
2020-01-18 01:07:15 +03:00
|
|
|
- save_cache:
|
|
|
|
key: cabal-store-v1-{{ checksum "server/cabal.project" }}-{{ checksum "server/graphql-engine.cabal" }}-{{ checksum "server/cabal.project.freeze" }}
|
|
|
|
paths:
|
|
|
|
- ~/.cabal/packages
|
|
|
|
- ~/.cabal/store
|
|
|
|
- store_artifacts:
|
|
|
|
path: /build/_server_output
|
|
|
|
destination: server
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: /build
|
|
|
|
paths: [_server_output]
|
|
|
|
|
|
|
|
build_image:
|
|
|
|
docker:
|
|
|
|
- image: hasura/graphql-engine-server-builder:2020-01-14
|
|
|
|
working_directory: ~/graphql-engine
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
|
|
|
- *skip_job_on_ciignore
|
|
|
|
- checkout
|
|
|
|
- *setup_remote_docker
|
2019-05-16 10:45:29 +03:00
|
|
|
- run:
|
|
|
|
name: Build the docker image
|
|
|
|
working_directory: ./server
|
|
|
|
command: |
|
|
|
|
# copy console assets to the rootfs - packaging/build/rootfs
|
|
|
|
export ROOTFS=packaging/build/rootfs
|
|
|
|
mkdir -p "$ROOTFS/srv"
|
|
|
|
cp -r /build/_console_output/assets "$ROOTFS/srv/console-assets"
|
|
|
|
|
|
|
|
# build and save the image
|
2018-07-10 13:01:02 +03:00
|
|
|
make ci-image
|
|
|
|
make ci-save-image
|
|
|
|
- store_artifacts:
|
2020-01-18 01:07:15 +03:00
|
|
|
path: /build/_server_output/image.tar
|
|
|
|
destination: server/image.tar
|
2018-07-10 13:01:02 +03:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: /build
|
2020-01-18 01:07:15 +03:00
|
|
|
paths: [_server_output/image.tar]
|
2018-07-26 08:47:21 +03:00
|
|
|
|
|
|
|
# job to execute when all server tests pass. later we can collect test
|
|
|
|
# reports and publish them etc.
|
|
|
|
all_server_tests_pass:
|
|
|
|
docker:
|
|
|
|
- image: alpine:edge
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: All server tests passed
|
2018-10-05 15:37:19 +03:00
|
|
|
command: echo 'all server tests passed!'
|
2018-07-26 08:47:21 +03:00
|
|
|
|
2018-09-18 09:21:57 +03:00
|
|
|
# pytest the server with postgres versions >= 9.5
|
2019-10-26 08:39:57 +03:00
|
|
|
test_server_pg_12:
|
2019-10-21 19:01:05 +03:00
|
|
|
<<: *test_server
|
2018-09-18 09:21:57 +03:00
|
|
|
environment:
|
2019-10-26 08:39:57 +03:00
|
|
|
PG_VERSION: "12"
|
2019-12-19 04:32:15 +03:00
|
|
|
POSTGIS_VERSION: "3.0.0"
|
2018-09-18 09:21:57 +03:00
|
|
|
docker:
|
2020-01-18 01:07:15 +03:00
|
|
|
- image: hasura/graphql-engine-server-builder:2020-01-14
|
2019-12-19 04:32:15 +03:00
|
|
|
- image: hasura/postgres-12.0-alpine-postgis3:6cbd863d47c0
|
2019-10-26 08:39:57 +03:00
|
|
|
<<: *test_pg_env
|
2019-12-14 09:47:38 +03:00
|
|
|
|
2019-10-26 08:39:57 +03:00
|
|
|
test_server_pg_11:
|
|
|
|
<<: *test_server
|
|
|
|
environment:
|
|
|
|
PG_VERSION: "11"
|
|
|
|
docker:
|
2020-01-18 01:07:15 +03:00
|
|
|
- image: hasura/graphql-engine-server-builder:2020-01-14
|
2019-11-26 15:14:21 +03:00
|
|
|
- image: circleci/postgres:11-alpine-postgis
|
2018-12-14 09:00:36 +03:00
|
|
|
<<: *test_pg_env
|
|
|
|
|
2019-10-26 08:39:57 +03:00
|
|
|
test_server_pg_10:
|
2019-10-21 19:01:05 +03:00
|
|
|
<<: *test_server
|
2018-12-14 09:00:36 +03:00
|
|
|
environment:
|
2019-10-26 08:39:57 +03:00
|
|
|
PG_VERSION: "10"
|
2018-12-14 09:00:36 +03:00
|
|
|
docker:
|
2020-01-18 01:07:15 +03:00
|
|
|
- image: hasura/graphql-engine-server-builder:2020-01-14
|
2019-10-26 08:39:57 +03:00
|
|
|
- image: circleci/postgres:10-alpine-postgis
|
2018-09-18 09:21:57 +03:00
|
|
|
<<: *test_pg_env
|
|
|
|
|
2019-10-21 19:01:05 +03:00
|
|
|
test_server_pg_9.6:
|
|
|
|
<<: *test_server
|
2018-09-18 09:21:57 +03:00
|
|
|
environment:
|
|
|
|
PG_VERSION: "9_6"
|
|
|
|
docker:
|
2020-01-18 01:07:15 +03:00
|
|
|
- image: hasura/graphql-engine-server-builder:2020-01-14
|
2018-10-24 11:21:37 +03:00
|
|
|
- image: circleci/postgres:9.6-alpine-postgis
|
2018-09-18 09:21:57 +03:00
|
|
|
<<: *test_pg_env
|
|
|
|
|
2019-10-21 19:01:05 +03:00
|
|
|
test_server_pg_9.5:
|
|
|
|
<<: *test_server
|
2018-09-18 09:21:57 +03:00
|
|
|
environment:
|
|
|
|
PG_VERSION: "9_5"
|
|
|
|
docker:
|
2020-01-18 01:07:15 +03:00
|
|
|
- image: hasura/graphql-engine-server-builder:2020-01-14
|
2018-10-24 11:21:37 +03:00
|
|
|
- image: circleci/postgres:9.5-alpine-postgis
|
2018-09-18 09:21:57 +03:00
|
|
|
<<: *test_pg_env
|
|
|
|
|
2019-11-18 21:45:54 +03:00
|
|
|
server_unit_tests:
|
2019-12-14 09:47:38 +03:00
|
|
|
resource_class: large
|
|
|
|
docker:
|
2020-01-18 01:07:15 +03:00
|
|
|
- image: hasura/graphql-engine-server-builder:2020-01-14
|
2019-12-14 09:47:38 +03:00
|
|
|
working_directory: ~/graphql-engine
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
|
|
|
- *skip_job_on_ciignore
|
|
|
|
- checkout
|
|
|
|
- run:
|
2019-11-18 21:45:54 +03:00
|
|
|
name: Run unit tests
|
2019-12-14 09:47:38 +03:00
|
|
|
environment:
|
|
|
|
GHCRTS: -N2
|
2020-01-18 01:07:15 +03:00
|
|
|
command: /build/_server_output/graphql-engine-tests unit
|
2019-12-14 09:47:38 +03:00
|
|
|
|
2019-02-14 12:37:47 +03:00
|
|
|
test_cli_with_last_release:
|
|
|
|
docker:
|
2019-12-12 08:37:26 +03:00
|
|
|
- image: hasura/graphql-engine-cli-builder:20191205
|
2019-02-14 12:37:47 +03:00
|
|
|
- image: circleci/postgres:10-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: gql_test
|
|
|
|
POSTGRES_DB: gql_test
|
2019-12-12 08:37:26 +03:00
|
|
|
working_directory: ~/graphql-engine
|
2019-02-14 12:37:47 +03:00
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
2019-03-07 08:58:03 +03:00
|
|
|
- *skip_job_on_ciignore
|
|
|
|
- checkout
|
2019-02-14 12:37:47 +03:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2019-12-12 08:37:26 +03:00
|
|
|
- cli-gopkg-{{ checksum "cli/go.mod" }}-{{ checksum "cli/go.sum" }}
|
2019-02-14 12:37:47 +03:00
|
|
|
- run:
|
|
|
|
name: get cli dependencies
|
|
|
|
working_directory: cli
|
|
|
|
command: make deps
|
|
|
|
- save_cache:
|
2019-12-12 08:37:26 +03:00
|
|
|
key: cli-gopkg-{{ checksum "cli/go.mod" }}-{{ checksum "cli/go.sum" }}
|
2019-02-14 12:37:47 +03:00
|
|
|
paths:
|
2019-12-12 08:37:26 +03:00
|
|
|
- /go/pkg
|
2019-02-14 12:37:47 +03:00
|
|
|
- *wait_for_postgres
|
|
|
|
- run:
|
|
|
|
name: test cli
|
|
|
|
command: .circleci/test-cli-with-last-release.sh
|
|
|
|
- store_artifacts:
|
|
|
|
path: /build/_cli_output
|
|
|
|
destination: cli
|
|
|
|
|
2018-07-10 13:01:02 +03:00
|
|
|
# test and build cli
|
|
|
|
test_and_build_cli:
|
2018-06-29 16:09:21 +03:00
|
|
|
docker:
|
2019-12-12 08:37:26 +03:00
|
|
|
- image: hasura/graphql-engine-cli-builder:20191205
|
2018-07-10 13:01:02 +03:00
|
|
|
- image: circleci/postgres:10-alpine
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: gql_test
|
|
|
|
POSTGRES_DB: gql_test
|
2019-12-12 08:37:26 +03:00
|
|
|
working_directory: ~/graphql-engine
|
2018-06-29 16:09:21 +03:00
|
|
|
steps:
|
2018-07-10 13:01:02 +03:00
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
2019-03-07 08:58:03 +03:00
|
|
|
- *skip_job_on_ciignore
|
|
|
|
- checkout
|
2018-06-29 16:09:21 +03:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2019-12-12 08:37:26 +03:00
|
|
|
- cli-gopkg-{{ checksum "cli/go.mod" }}-{{ checksum "cli/go.sum" }}
|
2018-06-29 16:09:21 +03:00
|
|
|
- run:
|
2018-07-03 20:10:13 +03:00
|
|
|
name: get cli dependencies
|
2018-07-10 13:01:02 +03:00
|
|
|
working_directory: cli
|
2018-06-29 16:09:21 +03:00
|
|
|
command: make deps
|
|
|
|
- save_cache:
|
2019-12-12 08:37:26 +03:00
|
|
|
key: cli-gopkg-{{ checksum "cli/go.mod" }}-{{ checksum "cli/go.sum" }}
|
2018-06-29 16:09:21 +03:00
|
|
|
paths:
|
2019-12-12 08:37:26 +03:00
|
|
|
- /go/pkg
|
2018-07-10 13:01:02 +03:00
|
|
|
- *wait_for_postgres
|
|
|
|
- run:
|
|
|
|
name: test cli
|
|
|
|
command: .circleci/test-cli.sh
|
2018-06-29 16:09:21 +03:00
|
|
|
- run:
|
|
|
|
name: build cli
|
2018-07-10 13:01:02 +03:00
|
|
|
working_directory: cli
|
2018-06-29 16:09:21 +03:00
|
|
|
command: |
|
|
|
|
make build
|
|
|
|
make compress
|
2018-07-10 13:01:02 +03:00
|
|
|
make ci-copy-binary
|
2018-06-29 16:09:21 +03:00
|
|
|
- store_artifacts:
|
2018-07-10 13:01:02 +03:00
|
|
|
path: /build/_cli_output
|
2018-07-03 20:10:13 +03:00
|
|
|
destination: cli
|
|
|
|
- persist_to_workspace:
|
2018-07-10 13:01:02 +03:00
|
|
|
root: /build
|
2018-07-03 20:10:13 +03:00
|
|
|
paths:
|
2018-07-10 13:01:02 +03:00
|
|
|
- _cli_output
|
2020-02-24 19:14:46 +03:00
|
|
|
|
|
|
|
test_and_build_cli_ext:
|
|
|
|
docker:
|
2020-02-25 17:58:28 +03:00
|
|
|
- image: hasura/graphql-engine-extension-cli-builder:20200225
|
2020-02-24 19:14:46 +03:00
|
|
|
working_directory: ~/graphql-engine
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
|
|
|
- *skip_job_on_ciignore
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key:
|
2020-02-25 09:46:11 +03:00
|
|
|
cli-ext-npm-cache-v2-{{ checksum "cli-ext/package.json" }}-{{ checksum "cli-ext/package-lock.json" }}
|
2020-02-24 19:14:46 +03:00
|
|
|
- run:
|
|
|
|
name: install dependencies
|
|
|
|
working_directory: cli-ext
|
|
|
|
command: make ci-deps
|
|
|
|
- save_cache:
|
|
|
|
key:
|
2020-02-25 09:46:11 +03:00
|
|
|
cli-ext-npm-cache-v2-{{ checksum "cli-ext/package.json" }}-{{ checksum "cli-ext/package-lock.json" }}
|
2020-02-24 19:14:46 +03:00
|
|
|
paths:
|
|
|
|
- cli-ext/node_modules
|
|
|
|
- ~/.npm
|
|
|
|
- ~/.cache
|
|
|
|
- run:
|
|
|
|
name: build extension cli
|
|
|
|
working_directory: cli-ext
|
|
|
|
command: |
|
|
|
|
npm install -g pkg
|
|
|
|
npm run build
|
|
|
|
make deploy
|
|
|
|
make ci-copy-assets
|
|
|
|
- store_artifacts:
|
|
|
|
path: /build/_cli_ext_output
|
|
|
|
destination: cli_ext
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: /build
|
|
|
|
paths:
|
|
|
|
- _cli_ext_output
|
2018-07-10 13:01:02 +03:00
|
|
|
|
2019-05-16 10:45:29 +03:00
|
|
|
# build console assets
|
|
|
|
build_console:
|
2018-07-10 13:01:02 +03:00
|
|
|
docker:
|
2019-05-16 10:45:29 +03:00
|
|
|
- image: hasura/graphql-engine-console-builder:20190515
|
2018-07-10 13:01:02 +03:00
|
|
|
working_directory: ~/graphql-engine
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
2019-03-07 08:58:03 +03:00
|
|
|
- *skip_job_on_ciignore
|
|
|
|
- checkout
|
2018-07-10 13:01:02 +03:00
|
|
|
- restore_cache:
|
2018-07-11 15:02:29 +03:00
|
|
|
key:
|
2018-07-10 13:01:02 +03:00
|
|
|
console-npm-cache-{{ checksum "console/package.json" }}-{{ checksum "console/package-lock.json" }}
|
|
|
|
- run:
|
|
|
|
name: install dependencies
|
|
|
|
working_directory: console
|
|
|
|
command: make ci-deps
|
|
|
|
- save_cache:
|
2018-07-11 15:02:29 +03:00
|
|
|
key:
|
2018-07-10 13:01:02 +03:00
|
|
|
console-npm-cache-{{ checksum "console/package.json" }}-{{ checksum "console/package-lock.json" }}
|
|
|
|
paths:
|
|
|
|
- console/node_modules
|
|
|
|
- ~/.npm
|
|
|
|
- ~/.cache
|
|
|
|
- run:
|
|
|
|
name: build console
|
|
|
|
working_directory: console
|
|
|
|
command: |
|
|
|
|
make build
|
|
|
|
make ci-copy-assets
|
2019-05-16 10:45:29 +03:00
|
|
|
- run:
|
|
|
|
name: setup assets directory
|
|
|
|
command: |
|
|
|
|
export ASSETS_PATH=/build/_console_output/assets
|
|
|
|
mkdir -p "$ASSETS_PATH"
|
|
|
|
gsutil -m cp -r gs://graphql-engine-cdn.hasura.io/console/assets/common "$ASSETS_PATH"
|
|
|
|
# gsutil decompresses files automatically, need to compress font-awesome again
|
|
|
|
# (see https://github.com/GoogleCloudPlatform/gsutil/issues/515)
|
|
|
|
mv "$ASSETS_PATH/common/css/font-awesome.min.css.gz" "$ASSETS_PATH/common/css/font-awesome.min.css"
|
|
|
|
gzip "$ASSETS_PATH/common/css/font-awesome.min.css"
|
|
|
|
# copy versioned assets and compress them
|
|
|
|
mkdir -p "$ASSETS_PATH/versioned"
|
|
|
|
cp "$ASSETS_PATH"/../{main.js,main.css,vendor.js} "$ASSETS_PATH/versioned/"
|
|
|
|
gzip -r "$ASSETS_PATH/versioned/"
|
2018-07-10 13:01:02 +03:00
|
|
|
- store_artifacts:
|
|
|
|
path: /build/_console_output
|
|
|
|
destination: console
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: /build
|
|
|
|
paths:
|
|
|
|
- _console_output
|
|
|
|
|
2019-05-16 10:45:29 +03:00
|
|
|
# test console
|
|
|
|
test_console:
|
|
|
|
docker:
|
2020-01-11 00:15:47 +03:00
|
|
|
- image: hasura/graphql-engine-console-builder:v0.3
|
2019-05-16 10:45:29 +03:00
|
|
|
environment:
|
|
|
|
CYPRESS_KEY: 983be0db-0f19-40cc-bfc4-194fcacd85e1
|
2019-07-12 08:25:15 +03:00
|
|
|
GHCRTS: -N1
|
2019-05-16 10:45:29 +03:00
|
|
|
- image: circleci/postgres:10-alpine-postgis
|
|
|
|
environment:
|
|
|
|
POSTGRES_USER: gql_test
|
|
|
|
POSTGRES_DB: gql_test
|
|
|
|
working_directory: ~/graphql-engine
|
|
|
|
parallelism: 4
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
|
|
|
- *skip_job_on_ciignore
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
key:
|
|
|
|
console-npm-cache-{{ checksum "console/package.json" }}-{{ checksum "console/package-lock.json" }}
|
|
|
|
- run:
|
|
|
|
name: install dependencies
|
|
|
|
working_directory: console
|
|
|
|
command: make ci-deps
|
|
|
|
- save_cache:
|
|
|
|
key:
|
|
|
|
console-npm-cache-{{ checksum "console/package.json" }}-{{ checksum "console/package-lock.json" }}
|
|
|
|
paths:
|
|
|
|
- console/node_modules
|
|
|
|
- ~/.npm
|
|
|
|
- ~/.cache
|
|
|
|
- *wait_for_postgres
|
|
|
|
- run:
|
|
|
|
name: test console
|
|
|
|
command: .circleci/test-console.sh
|
|
|
|
|
2019-02-27 18:12:47 +03:00
|
|
|
# test server upgrade from last version to current build
|
|
|
|
test_server_upgrade:
|
|
|
|
docker:
|
2020-02-13 12:14:02 +03:00
|
|
|
# Using the image for pytests, since server upgrade tests are now a bunch of pytests
|
|
|
|
- image: hasura/graphql-engine-server-builder:2020-01-14
|
2019-02-27 18:12:47 +03:00
|
|
|
environment:
|
2019-11-29 08:14:26 +03:00
|
|
|
HASURA_GRAPHQL_DATABASE_URL: postgresql://gql_test:@localhost:5432/gql_test
|
2020-02-13 12:14:02 +03:00
|
|
|
- image: circleci/postgres:11-alpine-postgis
|
2019-02-27 18:12:47 +03:00
|
|
|
environment:
|
|
|
|
POSTGRES_USER: gql_test
|
|
|
|
POSTGRES_DB: gql_test
|
|
|
|
working_directory: ~/graphql-engine
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
2019-03-07 08:58:03 +03:00
|
|
|
- *skip_job_on_ciignore
|
|
|
|
- checkout
|
2020-02-13 12:14:02 +03:00
|
|
|
- run:
|
|
|
|
name: install_necessary_packages
|
|
|
|
command: |
|
|
|
|
apt-get update
|
|
|
|
apt install -y curl procps
|
2019-02-27 18:12:47 +03:00
|
|
|
- run:
|
2019-03-14 17:55:33 +03:00
|
|
|
name: upgrade_test
|
2019-02-27 18:12:47 +03:00
|
|
|
command: .circleci/server-upgrade/run.sh
|
2020-02-13 12:14:02 +03:00
|
|
|
environment:
|
|
|
|
HASURA_GRAPHQL_DATABASE_URL: postgresql://gql_test:@localhost:5432/gql_test
|
2019-02-27 18:12:47 +03:00
|
|
|
- store_artifacts:
|
|
|
|
path: /build/_server_output
|
|
|
|
destination: server
|
2019-03-14 17:55:33 +03:00
|
|
|
|
2018-07-10 13:01:02 +03:00
|
|
|
deploy:
|
|
|
|
docker:
|
2020-04-02 04:42:18 +03:00
|
|
|
- image: hasura/graphql-engine-deployer:v0.4
|
2018-07-10 13:01:02 +03:00
|
|
|
working_directory: ~/graphql-engine
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: /build
|
2019-03-07 08:58:03 +03:00
|
|
|
- *skip_job_on_ciignore
|
|
|
|
- *setup_remote_docker
|
|
|
|
- checkout
|
2018-07-10 13:01:02 +03:00
|
|
|
- run:
|
|
|
|
name: deploy
|
|
|
|
command: .circleci/deploy.sh
|
|
|
|
|
2018-06-29 16:09:21 +03:00
|
|
|
workflows:
|
|
|
|
version: 2
|
2020-01-20 13:04:00 +03:00
|
|
|
workflow_v20200120:
|
2018-06-29 16:09:21 +03:00
|
|
|
jobs:
|
2018-07-18 08:30:52 +03:00
|
|
|
- check_build_worthiness: *filter_only_vtags
|
2020-02-24 19:14:46 +03:00
|
|
|
- test_and_build_cli_ext:
|
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- check_build_worthiness
|
2019-05-16 10:45:29 +03:00
|
|
|
- build_console:
|
2018-07-18 08:30:52 +03:00
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- check_build_worthiness
|
2019-05-16 10:45:29 +03:00
|
|
|
- build_server:
|
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
2020-01-18 01:07:15 +03:00
|
|
|
- check_build_worthiness
|
2020-02-24 19:14:46 +03:00
|
|
|
- test_cli_with_last_release:
|
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- test_and_build_cli_ext
|
|
|
|
- check_build_worthiness
|
2020-01-18 01:07:15 +03:00
|
|
|
- build_image:
|
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- build_server
|
2019-05-16 10:45:29 +03:00
|
|
|
- build_console
|
2019-10-26 08:39:57 +03:00
|
|
|
- test_server_pg_12:
|
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- build_server
|
|
|
|
- test_server_pg_11:
|
2018-12-14 09:00:36 +03:00
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- build_server
|
2019-10-26 08:39:57 +03:00
|
|
|
- test_server_pg_10:
|
2018-09-18 09:21:57 +03:00
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- build_server
|
2019-10-21 19:01:05 +03:00
|
|
|
- test_server_pg_9.6:
|
2018-09-18 09:21:57 +03:00
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- build_server
|
2019-10-21 19:01:05 +03:00
|
|
|
- test_server_pg_9.5:
|
2018-09-18 09:21:57 +03:00
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- build_server
|
2019-11-18 21:45:54 +03:00
|
|
|
- server_unit_tests:
|
2019-12-14 09:47:38 +03:00
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- build_server
|
2019-02-27 18:12:47 +03:00
|
|
|
- test_server_upgrade:
|
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
|
|
|
- build_server
|
2018-07-26 08:47:21 +03:00
|
|
|
- all_server_tests_pass:
|
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
2019-10-26 08:39:57 +03:00
|
|
|
- test_server_pg_12
|
|
|
|
- test_server_pg_11
|
|
|
|
- test_server_pg_10
|
2019-10-21 19:01:05 +03:00
|
|
|
- test_server_pg_9.6
|
|
|
|
- test_server_pg_9.5
|
2019-11-18 21:45:54 +03:00
|
|
|
- server_unit_tests
|
2019-02-27 18:12:47 +03:00
|
|
|
- test_server_upgrade
|
2018-07-11 15:02:29 +03:00
|
|
|
- test_and_build_cli:
|
2018-07-10 13:01:02 +03:00
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
2020-02-24 19:14:46 +03:00
|
|
|
- test_and_build_cli_ext
|
2018-07-26 08:47:21 +03:00
|
|
|
- build_server
|
2019-05-16 10:45:29 +03:00
|
|
|
- test_console:
|
2018-07-10 13:01:02 +03:00
|
|
|
<<: *filter_only_vtags
|
|
|
|
requires:
|
2020-01-18 01:07:15 +03:00
|
|
|
- build_console
|
2018-07-10 13:01:02 +03:00
|
|
|
- test_and_build_cli
|
2019-02-14 12:37:47 +03:00
|
|
|
- test_cli_with_last_release
|
2018-07-11 15:02:29 +03:00
|
|
|
- deploy:
|
2020-04-01 15:56:54 +03:00
|
|
|
<<: *filter_only_vtags_channel_branches
|
2018-07-10 13:01:02 +03:00
|
|
|
requires:
|
2020-01-18 01:07:15 +03:00
|
|
|
- build_image
|
2019-05-16 10:45:29 +03:00
|
|
|
- test_console
|
2018-07-26 08:47:21 +03:00
|
|
|
- all_server_tests_pass
|