Copyright The Linux Foundation and each contributor to CommunityBridge.
SPDX-License-Identifier: CC-BY-4.0
Python 3.6.5 virtualenv Serverless 1.32.0 nodejs (npm)
Create a virtual environment and install dependencies
# project root
yarn install
cd cla-backend
make setupThe local development environment makes use of three plugins for the Serverless
framework that emulate the AWS services locally. serverless-wsgi emulates AWS
λ and API Gateway, serverless-dynamodb-local emulates DynamoDb and
serverless-s3-local emulates S3. These plugins leverage Serverless in the same
way as our deployment infrastructure.
- Make sure Python3.6, python3-pip and
virtualenvare installed on build machine. It appears Hug isn't fully compatible with Python3.7. More info here - Run
export AWS_PROFILE=lf_devto set your AWS profile. - (optional) If you wish to override backend env vars, configure them in
env.jsonusing the env var names specified inserverless.yml. - Run
make setup(This only needs to be run once.) - Run
make run_dynamo - Run
make run_s3 - Run
make run_lambda - Run
make add_project_manager_permission username=<username> project_sfdc_id=<sfdc_id> bearer_token=<token> base_url=http://localhost:5000to add configure your user for the Project Management Console.
- Golang 1.11
- dep
Create a config file name env.json that contains the config entries specified
in the config struct.
Run the following commands:
cd cla-backend-go
make setup # Only needed on initial setup
make swagger
make build
./cla server --config env.json- Ionic ^3.20.0
- @ionic/app-scripts ^3.2.0
- Node ^8.11.1 at least 6.0 required.
# Top level - project root
yarn install
# Project Management Console
cd cla-frontend-project-console
make setup
# Corporate Console
cd cla-frontend-corporate-console
make setup
# Contributor Console
cd cla-frontend-contributor-console
make setup
# or simply...
for i in cla-frontend-project-console cla-frontend-corporate-console cla-frontend-contributor-console; do
pushd ${i} && yarn install-frontend; popd;
done- Next
cd cla-next yarn install yarn dev to run locally yarn build && yarn start to run in production
Due to Ionic custom webpack limitations, in order to provision config variables,
we leverage pre-build process to trigger variable provision scripts before
executing build. For each CLA console, at ./src/package.json, to find which
script is executed at pre-build process for each stage. All provision scripts
can be found under ./src/config/scripts.
There are two ways to provision config values. The first way is to use a script to
download the values from a running environment (such as DEV, STAGING, or
PROD, for example) or build the file manually. Overall, both approaches should
result in a config file named ./src/config/cla-env-config.json. This file should
NOT be version controlled.
Using the script approach, we can fetch the configuration values from the DEV
environment for the project management console by doing:
# First, make sure your have your AWS profile setup and established
# Note: AWS MFA/assumed role from the command line doesn't seem to work with the node.js lib
export AWS_PROFILE=<your_aws_profile>
cd cla-frontend-project-console/src
# The following target is defined in the `cla-frontend-project-console/package.json` file
yarn prebuild:devThis will generate the cla-frontend-project-console/src/config/cla-env-config.json
file for running in the DEV environment.
If the build is against qa/staging/prod stages (qa, staging and prod), the AWS
parameter
store
should be used to provision these values by using a script. Go to AWS parameter store and make
sure provision property values with name convention {variable name}-{stage name}. The values for each console needs are listed as following:
- CLA management console - cla-frontend-project-console
{
"auth0-clientId":"auth0_client_id",
"auth0-domain":"linuxfoundation.auth0.com",
"cla-api-url":"http://cla_api_endpoint",
"cinco-api-url":"https://cinco_api_endpoint",
"analytics-api-url":"https://analytics_api_endpoint",
"gh-app-public-link":"https://github_app_public_link"
}- CLA corporate console - cla-frontend-corporate-console
{
"auth0-clientId":"auth0_client_id",
"auth0-domain":"linuxfoundation.auth0.com",
"cla-api-url":"http://cla_api_endpoint",
"cinco-api-url":"https://cinco_api_endpoint"
}- CLA contributor console - cla-frontend-contributor-console
{
"auth0-clientId":"auth0_client_id",
"auth0-domain":"linuxfoundation.auth0.com",
"cla-api-url":"http://cla_api_endpoint",
"corp-console-link":"https://corporate_console_link"
}If the build is supposed to be a dev build hosted on a developer local machine,
directly create or edit (if it already exists) the cla-env-config.json configuration
file and adjust the config variables as needed.
To run the UI in local mode, run:
Note: typically auth0 needs to be configured to support the localhost:8100 callback - many testing environments only support this in the DEV environment.
# For dev
yarn serve:dev
# For staging
yarn serve:staging