Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Merges app-rewrite branch to master #1

Merged
merged 12 commits into from
Oct 26, 2022
Prev Previous commit
Next Next commit
skip circle
  • Loading branch information
tonypls committed Oct 26, 2022
commit 62f09c5466cbb7b6877a521f5f65330cc93ed761
215 changes: 111 additions & 104 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,110 +1,117 @@
# version: 2.1
version: 2.1

# executors:
# js-exec:
# docker:
# - image: cimg/node:16.15
executors:
js-exec:
docker:
- image: cimg/node:16.15

# jobs:
# verify_python:
# docker:
# - image: circleci/python:3.8.12
# steps:
# - checkout
# - restore_cache:
# key: venv-{{ checksum "poetry.lock" }}
# - run:
# name: Upgrade pip
# command: sudo pip install -q --upgrade pip
# - run:
# name: Install dependencies
# command: |
# set -eux -o pipefail
# sudo apt-get update
# sudo apt-get install libxml2-dev tesseract-ocr tesseract-ocr-eng
# poetry install -E parsers
# - run:
# name: Verify changes
# command: |
# set -eux -o pipefail
# poetry run check
# - save_cache:
# key: venv-{{ checksum "poetry.lock" }}
# paths:
# - ".venv"
jobs:
skip-ci:
docker:
- image: circleci/python:3.8.12
steps:
- checkout
- run: exit 1

# lint_json:
# executor: js-exec
# steps:
# - checkout
# - run:
# command: |
# npm install -g jsonlint-mod
# jsonlint -q web/public/locales/*.json
# verify_python:
# docker:
# - image: circleci/python:3.8.12
# steps:
# - checkout
# - restore_cache:
# key: venv-{{ checksum "poetry.lock" }}
# - run:
# name: Upgrade pip
# command: sudo pip install -q --upgrade pip
# - run:
# name: Install dependencies
# command: |
# set -eux -o pipefail
# sudo apt-get update
# sudo apt-get install libxml2-dev tesseract-ocr tesseract-ocr-eng
# poetry install -E parsers
# - run:
# name: Verify changes
# command: |
# set -eux -o pipefail
# poetry run check
# - save_cache:
# key: venv-{{ checksum "poetry.lock" }}
# paths:
# - ".venv"

# verify_web_js:
# executor: js-exec
# steps:
# - checkout
# - restore_cache:
# key: node_modules-{{ .Branch }}-{{ checksum "web/yarn.lock" }}
# - run:
# command: |
# set -eux -o pipefail
# cd web
# yarn install --frozen-lockfile
# yarn verify
# - save_cache:
# key: node_modules-{{ .Branch }}-{{ checksum "web/yarn.lock" }}
# paths:
# - web/node_modules
# lint_json:
# executor: js-exec
# steps:
# - checkout
# - run:
# command: |
# npm install -g jsonlint-mod
# jsonlint -q web/public/locales/*.json

# build_test:
# machine:
# image: ubuntu-2004:202201-02
# docker_layer_caching: true
# steps:
# - checkout
# - run:
# name: Build
# command: |
# set -euo pipefail
# docker-compose build web
# # Make sure files are available outside of container
# CONTAINER_ID=$(docker create eu.gcr.io/tmrow-152415/electricitymap_web:latest)
# docker cp $CONTAINER_ID:/home/src/electricitymap/contrib/web/public/dist web/public/dist
# no_output_timeout: 30m
# - run:
# name: Start environment
# command: |
# set -euo pipefail
# # Only start the `web` container
# # and avoid the `watch` container from starting and compiling
# # the already built frontend
# docker-compose up -d web
# sleep 20
# docker-compose logs web
# - run:
# name: Run tests
# command: |
# docker-compose ps
# curl --fail -i https://localhost:8000/
# curl --fail -i https://localhost:8000/v1/co2?countryCode=FR
# curl --fail -i https://localhost:8000/v1/exchanges?countryCode=FR
# curl --fail -i https://localhost:8000/v1/production?countryCode=FR
# curl --fail -i https://localhost:8000/v1/price?countryCode=FR
# curl --fail -i https://localhost:8000/v2/history?countryCode=FR
# verify_web_js:
# executor: js-exec
# steps:
# - checkout
# - restore_cache:
# key: node_modules-{{ .Branch }}-{{ checksum "web/yarn.lock" }}
# - run:
# command: |
# set -eux -o pipefail
# cd web
# yarn install --frozen-lockfile
# yarn verify
# - save_cache:
# key: node_modules-{{ .Branch }}-{{ checksum "web/yarn.lock" }}
# paths:
# - web/node_modules

# workflows:
# version: 2
# all:
# jobs:
# - ignore-branch
# - verify_python
# - verify_web_js
# - lint_json
# - build_test:
# requires:
# - verify_python
# - verify_web_js
# - lint_json
# build_test:
# machine:
# image: ubuntu-2004:202201-02
# docker_layer_caching: true
# steps:
# - checkout
# - run:
# name: Build
# command: |
# set -euo pipefail
# docker-compose build web
# # Make sure files are available outside of container
# CONTAINER_ID=$(docker create eu.gcr.io/tmrow-152415/electricitymap_web:latest)
# docker cp $CONTAINER_ID:/home/src/electricitymap/contrib/web/public/dist web/public/dist
# no_output_timeout: 30m
# - run:
# name: Start environment
# command: |
# set -euo pipefail
# # Only start the `web` container
# # and avoid the `watch` container from starting and compiling
# # the already built frontend
# docker-compose up -d web
# sleep 20
# docker-compose logs web
# - run:
# name: Run tests
# command: |
# docker-compose ps
# curl --fail -i https://localhost:8000/
# curl --fail -i https://localhost:8000/v1/co2?countryCode=FR
# curl --fail -i https://localhost:8000/v1/exchanges?countryCode=FR
# curl --fail -i https://localhost:8000/v1/production?countryCode=FR
# curl --fail -i https://localhost:8000/v1/price?countryCode=FR
# curl --fail -i https://localhost:8000/v2/history?countryCode=FR

workflows:
version: 2
all:
jobs:
- skip-ci
# - verify_python
# - verify_web_js
# - lint_json
# - build_test:
# requires:
# - verify_python
# - verify_web_js
# - lint_json