Unverified Commit d0e9361e authored by Ruslan Konviser's avatar Ruslan Konviser Committed by GitHub
Browse files

Merge branch 'develop' into l10n_develop

parents b8d8387b c66fe7c0
Loading
Loading
Loading
Loading
+98 −27
Original line number Diff line number Diff line
version: 2
version: 2.1

orbs:
    node: circleci/node@3.0.0

aliases:
    - &install-gradle
@@ -42,23 +45,55 @@ aliases:
          rm -rf ~/.yarn
          curl -o- -L https://yarnpkg.com/install.sh | bash
          echo 'export PATH="${PATH}:${HOME}/.yarn/bin:${HOME}/.config/yarn/global/node_modules/.bin"' >> $BASH_ENV
    - &install-android
      name: Install Android SDK
      command: |
          sudo apt update
          sudo apt install openjdk-8-jdk
          sudo apt install android-sdk
          export ANDROID_HOME=/usr/lib/android-sdk
          wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip
          unzip commandlinetools-linux-6609375_latest.zip -d cmdline-tools
          sudo mv cmdline-tools $ANDROID_HOME/
          export PATH=$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH
          mkdir ~/.android && echo '### User Sources for Android SDK Manager' > ~/.android/repositories.cfg
          sudo chown -R $(whoami) $ANDROID_HOME
          echo "Installing SDK tools"
          yes | sdkmanager "tools" --sdk_root=${ANDROID_HOME} || true
          echo "Installing SDK platform-tools"
          yes | sdkmanager "platform-tools" --sdk_root=${ANDROID_HOME} || true
          echo "Installing SDK platforms;android-28"
          yes | sdkmanager "platforms;android-28" --sdk_root=${ANDROID_HOME} || true
          echo "Installing SDK platforms;android-29"          
          yes | sdkmanager "platforms;android-29" --sdk_root=${ANDROID_HOME} || true
          echo "Installing SDK build-tools;28.0.3"
          yes | sdkmanager "build-tools;28.0.3" --sdk_root=${ANDROID_HOME} || true
          echo "Installing SDK build-tools;29.0.3"
          yes | sdkmanager "build-tools;29.0.3" --sdk_root=${ANDROID_HOME} || true
          echo "Accepting SDK Licenses"
          yes | sdkmanager --licenses --sdk_root=${ANDROID_HOME} || true
          echo "Updating SDK and accepting licenses"
          yes | sudo /usr/lib/android-sdk/cmdline-tools/tools/bin/sdkmanager --update --sdk_root=${ANDROID_HOME} || true

defaults: &defaults
    # put here anything which is common between all jobs
    # we define default work dir, however almost every job redefine it
    working_directory: /tmp/workspace
    environment:
        JVM_OPTS: -Xmx3200m
        ANDROID_HOME: /usr/local/android-sdk-linux
        JVM_OPTS: -Xmx4096m
        ANDROID_HOME: /usr/lib/android-sdk

jobs:
    build-monorepo-root:
        <<: *defaults
        working_directory: /tmp/workspace/monorepo-root
        docker:
            - image: circleci/node:13.12
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - checkout
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run: *install-yarn
            - run:
@@ -90,10 +125,13 @@ jobs:
    build-backend-api:
        <<: *defaults
        working_directory: /tmp/workspace/backend/api
        docker:
            - image: circleci/node:13.12
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - checkout
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run: *install-yarn
            - run:
@@ -126,10 +164,13 @@ jobs:
    build-admin-website-angular:
        <<: *defaults
        working_directory: /tmp/workspace/admin/website-angular
        docker:
            - image: circleci/node:13.12
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - checkout
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run: *install-yarn
            - run:
@@ -162,14 +203,18 @@ jobs:
    build-carrier-mobile-ionic:
        <<: *defaults
        working_directory: /tmp/workspace/carrier/mobile-ionic
        docker:
            - image: circleci/android:api-29-node
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - checkout
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run:
                  name: Install Yarn
                  command: sudo npm install -g yarn --force
            - run: *install-android
            - run: *install-gradle
            - run:
                  name: 'Pull Submodules'
@@ -222,14 +267,18 @@ jobs:
    build-shop-mobile-ionic:
        <<: *defaults
        working_directory: /tmp/workspace/shop/mobile-ionic
        docker:
            - image: circleci/android:api-29-node
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - checkout
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run:
                  name: Install Yarn
                  command: sudo npm install -g yarn --force
            - run: *install-android
            - run: *install-gradle
            - run:
                  name: 'Pull Submodules'
@@ -282,10 +331,13 @@ jobs:
    build-shop-website-angular:
        <<: *defaults
        working_directory: /tmp/workspace/shop/website-angular
        docker:
            - image: circleci/node:13.12
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - checkout
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run: *install-yarn
            - run:
@@ -318,14 +370,18 @@ jobs:
    build-merchant-tablet-ionic:
        <<: *defaults
        working_directory: /tmp/workspace/merchant/tablet-ionic
        docker:
            - image: circleci/android:api-29-node
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - checkout
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run:
                  name: Install Yarn
                  command: sudo npm install -g yarn --force
            - run: *install-android
            - run: *install-gradle
            - run:
                  name: 'Pull Submodules'
@@ -378,9 +434,12 @@ jobs:
    test-carrier-mobile-ionic:
        <<: *defaults
        working_directory: /tmp/workspace/carrier/mobile-ionic
        docker:
            - image: circleci/node:10.16.0-browsers
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run: *install-yarn
            - run: *install-chrome
@@ -404,9 +463,12 @@ jobs:
    test-shop-mobile-ionic:
        <<: *defaults
        working_directory: /tmp/workspace/shop/mobile-ionic
        docker:
            - image: circleci/node:10.16.0-browsers
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run: *install-yarn
            - run: *install-chrome
@@ -430,9 +492,12 @@ jobs:
    test-shop-website-angular:
        <<: *defaults
        working_directory: /tmp/workspace/shop/website-angular
        docker:
            - image: circleci/node:10.16.0-browsers
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run: *install-yarn
            - run: *install-chrome
@@ -456,9 +521,12 @@ jobs:
    test-admin-website-angular:
        <<: *defaults
        working_directory: /tmp/workspace/admin/website-angular
        docker:
            - image: circleci/node:10.16.0-browsers
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run: *install-yarn
            - run: *install-chrome
@@ -482,9 +550,12 @@ jobs:
    test-backend-api:
        <<: *defaults
        working_directory: /tmp/workspace/backend/api
        docker:
            - image: circleci/node:10.16.0-browsers
        machine:
            image: ubuntu-1604:202004-01
        steps:
            - node/install:
                  install-yarn: true
                  node-version: latest
            - run: *install-deps
            - run: *install-yarn
            - run: *install-chrome
+2 −2
Original line number Diff line number Diff line
language: node_js

sudo: false
dist: trusty
dist: xenial

git:
    depth: 3

node_js:
    - '10'
    - '14'

cache:
    directories:
+2 −1
Original line number Diff line number Diff line
@@ -71,5 +71,6 @@
		"pyro",
		"snyk",
		"typeorm"
	]
	],
	"deepscan.enable": true
}

Jenkinsfile

0 → 100644
+180 −0
Original line number Diff line number Diff line
pipeline {
    agent {
        label 'docker'
    }

    environment {
        DOCKER_BUILDKIT = 1 // Experimental faster build system
        REPO_NAME = "ever"
        IMAGE_CORE_API = "ever-core"
        IMAGE_ADMIN_WEB_ANGULAR = "ever-admin-web-angular"
        GITHUB_DOCKER_USERNAME = credentials('github-docker-username')
        GITHUB_DOCKER_PASSWORD = credentials('github-docker-password')
        GITHUB_DOCKER_REPO = "docker.pkg.github.com/ever-co/ever"
        GITHUB_DISPATCH_TOKEN = credentials('github-dispatch-token')
        GITHUB_TOKEN = credentials('github-token')
        CI_URL = "ci.ever.co"
        AWS_ACCESS_KEY_ID = credentials('aws-access-key')
        AWS_SECRET_ACCESS_KEY = credentials('aws-secret-key')
        AWS_DEFAULT_REGION = "us-east-1"
        AWS_ECR_REPO = """${sh(
            script: "aws ecr get-login --no-include-email --region ${env.AWS_DEFAULT_REGION} | grep -o 'https://.*' | sed -e 's|https://||g' | tr -d '\n'",
            returnStdout: true
        )}"""
        AWS_ECR_PASSWORD = """${sh(
            script: "aws ecr get-login-password --region ${env.AWS_DEFAULT_REGION}",
            returnStdout: true
        )}"""
        WORKFLOW_ID = """${sh(
            script: "curl --silent -X GET -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/ever-co/$REPO_NAME-pulumi/actions/workflows/pulumi.yml | tr -s ' ' | tr -d '\r' | tr -d '\n' | grep -Eo '[0-9]{5,9}' | uniq",
            returnStdout: true
        )}"""
    }

    stages {
        stage("Clone") {
            steps{
                git branch: 'develop',
                    url: 'https://github.com/ever-co/ever.git'
                
                sh """
                    curl 'https://api.github.com/repos/ever-co/${REPO_NAME}/statuses/$GIT_COMMIT' -H 'Authorization: token ${GITHUB_TOKEN}' -H 'Content-Type: application/json' -X POST -d '{"state": "pending", "context": "Jenkins", "description": "Jenkins pipeline is running", "target_url": "https://$CI_URL/job/${JOB_NAME}/$BUILD_NUMBER/console"}'
                """
            }
            post {
                success {
                    echo "Cloning successful..."
                }
                failure {
                    echo "Cloning failed! See log for details. Terminating..."
                }
            }
        }
        stage("Docker Image Build") {
            parallel {
                stage("Core API Image") {
                    steps {
                        sh "docker build -t ${env.IMAGE_CORE_API} -f .deploy/core/Dockerfile ."
                    }
                    post{
                        success {
                            echo "Image for Core API built!"
                        }
                        failure {
                            echo "Core API Image build failed..."
                        }
                    }
                }
                stage("Admin Web Angular Image") {
                    steps {
                        sh "docker build -t ${env.IMAGE_ADMIN_WEB_ANGULAR} -f .deploy/admin-web-angular/Dockerfile ."
                    }
                    post {
                        success {
                            echo "Image for Admin Web Angular built!"
                        }
                        failure {
                            echo "Admin Web Angular image build failed..."
                        }
                    }
                }
            }
        }
        stage("Login to repositories") {
            steps {
                sh "docker login docker.pkg.github.com -u ${GITHUB_DOCKER_USERNAME} -p ${GITHUB_DOCKER_PASSWORD}"
                sh "docker login ${AWS_ECR_REPO} -u AWS -p ${AWS_ECR_PASSWORD}" // Login to AWS ECR
            }
        }
        stage ("Push To AWS ECR") {
            parallel {
                stage ("Core API Image") {
                    steps {
                        // Tag and push to ECR
                        sh "docker tag ${IMAGE_CORE_API} ${AWS_ECR_REPO}/${IMAGE_CORE_API}"
                        sh "docker push ${AWS_ECR_REPO}/${IMAGE_CORE_API}"
                        sh "docker rmi ${AWS_ECR_REPO}/${IMAGE_CORE_API}" // Cleans tag
                    }
                    post {
                        success {
                            echo "Successfuly pushed to ECR on build ${env.BUILD_ID}!"
                        }
                        failure {
                            echo "Push to ECR failed! See log for details..."
                        }
                    }
                }
                stage ("Admin Web Angular Image") {
                    steps {
                        sh "docker tag ${IMAGE_ADMIN_WEB_ANGULAR} ${AWS_ECR_REPO}/${IMAGE_ADMIN_WEB_ANGULAR}"
                        sh "docker push ${AWS_ECR_REPO}/${IMAGE_ADMIN_WEB_ANGULAR}"
                        sh "docker rmi ${AWS_ECR_REPO}/${IMAGE_ADMIN_WEB_ANGULAR}" // Cleans tag
                    }
                    post {
                        success {
                            echo "Successfully pushed to ECR on build ${env.BUILD_ID}!"
                        }
                        failure {
                            echo "Push to ECR failed! See log for details..."
                        }
                    }
                }
            }
        }
        stage ("Push to GitHub") {
            parallel {
                stage ("Core API Image") {
                    steps {
                        sh "docker tag ${IMAGE_CORE_API} ${GITHUB_DOCKER_REPO}/${IMAGE_CORE_API}"
                        sh "docker push ${GITHUB_DOCKER_REPO}/${IMAGE_CORE_API}"
                        sh "docker rmi ${GITHUB_DOCKER_REPO}/${IMAGE_CORE_API}"
                    }
                    post {
                        success {
                            echo "Successfully pushed to GitHub on build ${env.BUILD_ID}!"
                        }
                        failure {
                            echo "Push to GitHub failed! See log for details..."
                        }
                    }
                }
                stage ("Admin Web Angular Image") {
                    steps {
                        sh "docker tag ${IMAGE_CORE_API} ${GITHUB_DOCKER_REPO}/${IMAGE_CORE_API}"
                        sh "docker push ${GITHUB_DOCKER_REPO}/${IMAGE_CORE_API}"
                        sh "docker rmi ${GITHUB_DOCKER_REPO}/${IMAGE_CORE_API}"
                    }
                    post {
                        success {
                            echo "Successfully pushed to GitHub on build ${env.BUILD_ID}!"
                        }
                        failure {
                            echo "Push to GitHub failed! See log for details..."
                        }
                    }
                }
            }
        }
        stage ("Pulumi Update") {
            steps {
                sh """
                    curl -sX POST 'https://api.github.com/repos/ever-co/${REPO_NAME}-pulumi/actions/workflows/2319005/dispatches' -H 'Accept: application/vnd.github.v3+json' -H 'Authorization: token ${GITHUB_DISPATCH_TOKEN}' -d '{"ref": "master"}'
                """
            }
        }
    }
    post {
        success {
            echo "Ever CI/CD pipeline executed successfully!"
            sh """
                curl 'https://api.github.com/repos/ever-co/${REPO_NAME}/statuses/$GIT_COMMIT' -H 'Authorization: token ${GITHUB_TOKEN}' -H 'Content-Type: application/json' -X POST -d '{"state": "success", "context": "Jenkins", "description": "Jenkins pipeline succeeded", "target_url": "https://$CI_URL/job/${JOB_NAME}/$BUILD_NUMBER/console"}'
            """
		}
        failure {
            echo "Ever CI/CD pipeline failed..."
			sh """
                curl 'https://api.github.com/repos/ever-co/${REPO_NAME}/statuses/$GIT_COMMIT' -H 'Authorization: token ${GITHUB_TOKEN}' -H 'Content-Type: application/json' -X POST -d '{"state": "failure", "context": "Jenkins", "description": "Jenkins pipeline failed", "target_url": "https://$CI_URL/job/${JOB_NAME}/$BUILD_NUMBER/console"}'
            """
        }
    }
}
 No newline at end of file
+9 −3
Original line number Diff line number Diff line
@@ -6,6 +6,9 @@ This software is available under an Open Source Licenses ("Community Edition").

Alternatively, commercial versions of the software must be used in accordance with the terms and conditions of separate written agreement between you and Ever Co. LTD.

In addition, Ever Co. LTD holds copyright and/or sufficient licenses to all components of the Ever Platform, and therefore can grant, at its sole discretion, the ability
for companies, individuals, or organizations to create proprietary modules which may be dynamically linked at runtime with the portions of Ever Platform which fall under our copyright/license umbrella.

**The default Ever Platform license, without a valid Ever Platform Small Business or Ever Platform Enterprise License agreement, is the Ever Platform Community Edition License.**

### _Ever Platform Community Edition_ License
@@ -40,12 +43,12 @@ Feel free to [Contact Us](https://github.com/ever-co/ever#contact-us) for an add
### _Ever Platform Small Business_ License

Ever® Platform Small Business™ License can be purchased by businesses with annual revenues do not exceed $1 million.
For more information, please contact <mailto:ever@ever.co>.
For more information, please see https://ever.co/pricing or contact us at <mailto:ever@ever.co>.

### _Ever Platform Enterprise_ License

Ever® Platform Enterprise™ License can be purchased by businesses with more than $1 million in annual revenue.
For more information, please contact <mailto:ever@ever.co>.
For more information, please see https://ever.co/pricing or contact us at <mailto:ever@ever.co>.

## Credits

@@ -56,6 +59,9 @@ Please see [CREDITS.md](CREDITS.md) files for a list of libraries and software i
**Ever**® is a registered trademark of [Ever Co. LTD](https://ever.co).  
**Ever® Platform™**, **Ever® Platform Community™**, **Ever® Platform Small Business™** and **Ever® Platform Enterprise™** are all trademarks of [Ever Co. LTD](https://ever.co).

The trademarks may only be used with the written permission of Ever Co. LTD. and may not be used to promote or otherwise market competitive products or services.
The trademarks and logos may only be used with the written permission of Ever Co. LTD. and may not be used to promote or otherwise market competitive products or services.
If you wish to use these trademarks and logos you should contact our licensing department at <mailto:legal@ever.co> to determine the necessary steps you must take.

All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.

If you have any questions regarding our licensing policy, please contact us: <mailto:legal@ever.co> (via email)
Loading