Skip to content

Commit

Permalink
[KED-2742] Setup ci for deployment (#555)
Browse files Browse the repository at this point in the history
* v3.14.0

* added S3 deploy script to circleCI config

* update deploy to S3 setup

* install python and awscli in run job

* remove sudo in pip install command

* use pip3 to install

* change CI branch variable reference
  • Loading branch information
studioswong authored Sep 7, 2021
1 parent b101d61 commit b69314a
Showing 1 changed file with 39 additions and 15 deletions.
54 changes: 39 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,27 @@ commands:
name: Check for legal compliance
command: make legal

deploy_to_s3:
steps:
- checkout
- restore_cache:
keys:
- v${CACHE_VERSION}-dependencies-{{ checksum "package.json" }}
- v${CACHE_VERSION}-dependencies-
- install_node_dependencies
- build_npm_package
- run:
name: Install python3
command: |
sudo apt update
sudo apt install python3 python3-pip
- run:
name: install_aw_cli
command: pip3 install awscli
- run:
name: Publish to S3
command: aws s3 cp --recursive build s3://kedro-viz-fe/${CIRCLE_BRANCH}

deploy_gh_pages:
steps:
- checkout
Expand All @@ -146,7 +167,7 @@ commands:
- build_npm_package
- add_ssh_keys:
fingerprints:
- "9a:fe:61:f4:d6:c2:c1:58:75:c9:72:56:6e:53:fd:8b"
- '9a:fe:61:f4:d6:c2:c1:58:75:c9:72:56:6e:53:fd:8b'
- run:
name: Deploy to GitHub Pages
command: |
Expand Down Expand Up @@ -189,8 +210,6 @@ commands:
- package_app
- check_legal_compliance



# Windows-related commands
win_setup_conda:
# Miniconda3 is pre-installed on the machine:
Expand Down Expand Up @@ -249,46 +268,50 @@ jobs:
build_36:
executor: circleci_machine
environment:
CONDA_ENV_PY_VERSION: "3.6"
CONDA_ENV_PY_VERSION: '3.6'
steps: [build]

build_37:
executor: circleci_machine
environment:
CONDA_ENV_PY_VERSION: "3.7"
CONDA_ENV_PY_VERSION: '3.7'
steps: [build]

build_38:
executor: circleci_machine
environment:
CONDA_ENV_PY_VERSION: "3.8"
CONDA_ENV_PY_VERSION: '3.8'
steps: [build]

deploy_demo:
executor: circleci_machine
steps: [deploy_gh_pages]

deploy_s3:
executor: circleci_machine
steps: [deploy_to_s3]

# Windows-related jobs
win_build_36:
executor: win/default
working_directory: ~/repo
environment:
CONDA_ENV_PY_VERSION: "3.6"
CONDA_ENV_PY_VERSION: '3.6'
steps: [win_build]

win_build_37:
executor: win/default
working_directory: ~/repo
environment:
CONDA_ENV_PY_VERSION: "3.7"
CONDA_ENV_PY_VERSION: '3.7'
steps: [win_build]

win_build_38:
executor: win/default
working_directory: ~/repo
environment:
CONDA_ENV_PY_VERSION: "3.8"
NODE_OPTIONS: "--max-old-space-size=8192"
CONDA_ENV_PY_VERSION: '3.8'
NODE_OPTIONS: '--max-old-space-size=8192'
steps: [win_build]

release_to_npm:
Expand All @@ -307,13 +330,13 @@ jobs:
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
- run:
name: Publish to npm
command: npm publish
command: npm publish

release_to_pypi:
executor: circleci_machine
description: Build Kedro-Viz as a Python package and push it to PyPI
environment:
CONDA_ENV_PY_VERSION: "3.8"
CONDA_ENV_PY_VERSION: '3.8'
steps:
- checkout
- restore_cache:
Expand All @@ -338,7 +361,7 @@ release_filter: &release_filter
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
branches:
ignore: /.*/

workflows:
version: 2
build:
Expand All @@ -349,6 +372,7 @@ workflows:
# - win_build_36
# - win_build_37
- win_build_38
- deploy_s3
- deploy_demo:
requires:
# - build_36
Expand All @@ -363,7 +387,7 @@ workflows:
daily:
triggers:
- schedule:
cron: "0 1 * * *"
cron: '0 1 * * *'
filters:
branches:
only:
Expand Down

0 comments on commit b69314a

Please sign in to comment.