Skip to content

Commit

Permalink
Merge pull request #898 from kuzzleio/4-dev
Browse files Browse the repository at this point in the history
Release of the Admin Console v4
  • Loading branch information
xbill82 authored Feb 4, 2021
2 parents aae7895 + 9ca706e commit d9364a7
Show file tree
Hide file tree
Showing 272 changed files with 39,795 additions and 27,670 deletions.
14 changes: 0 additions & 14 deletions .aws_deploy.yml

This file was deleted.

17 changes: 5 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ module.exports = {

env: {
es6: true,
node: true,
jquery: true
node: true
},

extends: ["plugin:vue/essential", "@vue/prettier"],
extends: ["plugin:vue/essential", "@vue/prettier", '@vue/typescript'],

rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"no-console": "error",
"no-debugger": "error",
"require-atomic-updates": "off"
},

Expand All @@ -21,16 +20,10 @@ module.exports = {

overrides: [
{
files: ["**/__tests__/*.{j,t}s?(x)"],
files: ["test/**/*.js"],
env: {
mocha: true
}
}
],

'extends': [
'plugin:vue/essential',
'@vue/prettier',
'@vue/typescript'
]
};
54 changes: 54 additions & 0 deletions .github/actions/deploy-to-s3/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy to AWS S3
description: Build admin console, upload it to S3 and invalidate Cloudfront cache

inputs:
AWS_ACCESS_KEY_ID:
description: AWS Access key ID
required: true
AWS_SECRET_ACCESS_KEY:
description: AWS secret key
required: true
S3_BUCKET:
description: S3 bucket name
required: true
CLOUDFRONT_ID:
description: Cloudfront distribution ID
required: true
REGION:
description: AWS default region
required: true
default: 'us-west-2'
GA_ID:
description: Google Analytics ID
required: true
TARGET_DIST:
description: Build artifact folder to deploy
required: true
default: dist

runs:
using: "composite"
steps:
- name: Install AWS CLI
run: |
sudo apt-get update
sudo apt-get install python python-pip
pip install awscli --upgrade --user
shell: bash
- name: Build
run: |
npm ci
npm run build
env:
NODE_ENV: production
GA_ID: ${{ inputs.GA_ID }}
shell: bash
- name: Deploy
run: |
aws s3 rm s3://${{ inputs.S3_BUCKET }} --recursive --region ${{ inputs.REGION }}
aws s3 sync ${{ inputs.TARGET_DIST }} s3://${{ inputs.S3_BUCKET }}
aws cloudfront create-invalidation --distribution-id ${{ inputs.CLOUDFRONT_ID }} --paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
shell: bash
22 changes: 22 additions & 0 deletions .github/actions/e2e-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: E2E Cypress tests
description: E2E tests using Cypress and different Kuzzle setup

inputs:
backend_config:
description: Kuzzle setup configuration (1 or 2 or multi)
required: true
CYPRESS_RECORD_KEY:
description: Kuzzle setup configuration (1 or 2 or multi)
required: true

runs:
using: "composite"
steps:
- run: npm ci --silent
shell: bash
- run: cd test/e2e/run-test && npm ci && cd -
shell: bash
- run: npm run test:e2e -- --backend=${{ inputs.backend_config}}
env:
CYPRESS_RECORD_KEY: ${{ inputs.CYPRESS_RECORD_KEY }}
shell: bash
9 changes: 9 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Lint
description: Run ESLint
runs:
using: "composite"
steps:
- run: npm ci
shell: bash
- run: npm run test:lint
shell: bash
59 changes: 59 additions & 0 deletions .github/workflows/pull_request.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Pull request checks

on: [pull_request]

jobs:
lint:
name: Lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: "10"
- uses: ./.github/actions/lint

e2e-tests:
name: E2E Cypress tests - Kuzzle ${{ matrix.backend_config}}
needs: ['lint']
strategy:
matrix:
backend_config: ['1', '2', 'multi']
fail-fast: false
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: 10
- uses: ./.github/actions/e2e-tests
with:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
backend_config: ${{ matrix.backend_config }}

92 changes: 92 additions & 0 deletions .github/workflows/push_dev.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Dev branches push checks

on:
push:
branches:
- 4-dev

jobs:
lint:
name: Lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: "10"
- uses: ./.github/actions/lint

e2e-tests:
name: E2E Cypress tests - Kuzzle ${{ matrix.backend_config}}
needs: ['lint']
strategy:
matrix:
backend_config: ['1', '2', 'multi']
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: 10
- uses: ./.github/actions/e2e-tests
with:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
backend_config: ${{ matrix.backend_config }}

deploy-staging:
name: Deploy Admin Console to staging - next-console.kuzzle.io
needs: ['e2e-tests']
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.cache/pip
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: ./.github/actions/deploy-to-s3
with:
REGION: us-west-2
S3_BUCKET: next.console.kuzzle.io
CLOUDFRONT_ID: E35G0B414M3IWU
GA_ID: G-4EDTRNC8S9
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
92 changes: 92 additions & 0 deletions .github/workflows/push_master.workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Main branches push checks

on:
push:
branches:
- master

jobs:
lint:
name: Lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: "10"
- uses: ./.github/actions/lint

e2e-tests:
name: E2E Cypress tests - Kuzzle ${{ matrix.backend_config}}
needs: ['lint']
strategy:
matrix:
backend_config: ['1', '2', 'multi']
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: 10
- uses: ./.github/actions/e2e-tests
with:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
backend_config: ${{ matrix.backend_config }}

deploy-production:
name: Deploy Admin Console to production - console.kuzzle.io
needs: ['e2e-tests']
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.cache/pip
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: 12
- uses: ./.github/actions/deploy-to-s3
with:
REGION: us-west-2
S3_BUCKET: console.kuzzle.io
CLOUDFRONT_ID: E2GPBJ9T0QR37G
GA_ID: G-4EDTRNC8S9
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Loading

0 comments on commit d9364a7

Please sign in to comment.