-
Notifications
You must be signed in to change notification settings - Fork 211
Master -> dev #7169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Master -> dev #7169
Changes from all commits
3cbf3a5
ffa4393
9d5d60c
263835b
7b42471
70e7a16
9671450
646d2c0
026828b
4863f39
8d0f554
d3cb720
5be128c
30d0fd2
cc6a1de
abb51ca
a39ab03
de87008
411eb50
53204f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,45 +48,44 @@ build_docker_image: &build_docker_image | |
| ./build.sh | ||
| no_output_timeout: 20m | ||
|
|
||
| build_steps: &build_steps | ||
| # Initialization. | ||
| - checkout | ||
| - setup_remote_docker | ||
| - run: *install_dependency | ||
| - run: *install_deploysuite | ||
| # Restoration of node_modules from cache. | ||
| # - restore_cache: *restore_cache_settings_for_build | ||
| # Build of Docker image. | ||
| - run: | ||
| name: "configuring environment" | ||
| command: | | ||
| ./awsconfiguration.sh ${DEPLOY_ENV} | ||
| source awsenvconf | ||
| ./psvar-processor.sh -t appenv -p /config/${APPNAME}/buildvar | ||
| source buildvar_env | ||
| # ./buildenv.sh -e ${DEPLOY_ENV} -b dev_communityapp_buildvar,dev_communityapp_deployvar -l dev_communityapp_buildvar_ps | ||
| - run: *build_docker_image | ||
| # Caching node modules. | ||
| # - save_cache: *save_cache_settings | ||
| # Deployment. | ||
| - deploy: | ||
| name: Running MasterScript | ||
| command: | | ||
| source awsenvconf | ||
| # source buildenvvar | ||
| ./psvar-processor.sh -t appenv -p /config/${APPNAME}/deployvar | ||
| source deployvar_env | ||
| ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -j /config/${APPNAME}/appvar -i ${APPNAME} -p FARGATE | ||
| # ./master_deploy.sh -d ECS -e DEV -t latest -s dev_communityapp_taskvar -i communityapp -p FARGATE | ||
| if [ "${DEPLOY_ENV}" = "PROD" ]; | ||
| then | ||
| # Executing plan | ||
| curl --request POST \ | ||
| --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \ | ||
| --header "Circle-Token: ${CIRCLE_TOKEN}" \ | ||
| --header 'content-type: application/json' \ | ||
| --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true , "run_performancetesting":false, "run_basedeployment": false}}' | ||
| fi | ||
| build_steps: &build_steps # Initialization. | ||
| - checkout | ||
| - setup_remote_docker | ||
| - run: *install_dependency | ||
| - run: *install_deploysuite | ||
| # Restoration of node_modules from cache. | ||
| # - restore_cache: *restore_cache_settings_for_build | ||
| # Build of Docker image. | ||
| - run: | ||
| name: "configuring environment" | ||
| command: | | ||
| ./awsconfiguration.sh ${DEPLOY_ENV} | ||
| source awsenvconf | ||
| ./psvar-processor.sh -t appenv -p /config/${APPNAME}/buildvar | ||
| source buildvar_env | ||
| # ./buildenv.sh -e ${DEPLOY_ENV} -b dev_communityapp_buildvar,dev_communityapp_deployvar -l dev_communityapp_buildvar_ps | ||
| - run: *build_docker_image | ||
| # Caching node modules. | ||
| # - save_cache: *save_cache_settings | ||
| # Deployment. | ||
| - deploy: | ||
| name: Running MasterScript | ||
| command: | | ||
| source awsenvconf | ||
| # source buildenvvar | ||
| ./psvar-processor.sh -t appenv -p /config/${APPNAME}/deployvar | ||
| source deployvar_env | ||
| ./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -j /config/${APPNAME}/appvar -i ${APPNAME} -p FARGATE | ||
| # ./master_deploy.sh -d ECS -e DEV -t latest -s dev_communityapp_taskvar -i communityapp -p FARGATE | ||
| if [ "${DEPLOY_ENV}" = "PROD" ]; | ||
| then | ||
| # Executing plan | ||
| curl --request POST \ | ||
| --url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \ | ||
| --header "Circle-Token: ${CIRCLE_TOKEN}" \ | ||
| --header 'content-type: application/json' \ | ||
| --data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true , "run_performancetesting":false, "run_basedeployment": false}}' | ||
| fi | ||
|
|
||
| jobs: | ||
| # Build & Deploy against development backend | ||
|
|
@@ -95,7 +94,7 @@ jobs: | |
| environment: | ||
| DEPLOY_ENV: "DEV" | ||
| LOGICAL_ENV: "dev" | ||
| APPNAME: "community-app" | ||
| APPNAME: "community-app" | ||
| steps: *build_steps | ||
|
|
||
| # Build & Deploy against production backend | ||
|
|
@@ -107,7 +106,6 @@ jobs: | |
| APPNAME: "community-app" | ||
| steps: *build_steps | ||
|
|
||
|
|
||
| # Test job for the cases when we do not need deployment. It just rapidly | ||
| # installs (updates) app dependencies, and runs tests (ESLint, Stylelint, | ||
| # Jest unit-tests). | ||
|
|
@@ -123,7 +121,7 @@ jobs: | |
| command: git config --global url."https://git@".insteadOf git:// | ||
| - run: | ||
| name: App npm install | ||
| command: npm install | ||
| command: npm ci | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| no_output_timeout: 20m | ||
| - save_cache: | ||
| key: test-node-modules-{{ checksum "package-lock.json" }} | ||
|
|
@@ -181,8 +179,6 @@ workflows: | |
| branches: | ||
| only: | ||
| - develop | ||
| - v6 | ||
| - PM-2479 | ||
|
|
||
| - "build-prod": | ||
| context: org-global | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,7 +165,7 @@ ENV TOPGEAR_ALLOWED_SUBMISSIONS_DOMAINS=$TOPGEAR_ALLOWED_SUBMISSIONS_DOMAINS | |
|
|
||
| RUN npm config set unsafe-perm true | ||
| RUN git config --global url."https://git@".insteadOf git:// | ||
| RUN npm install | ||
| RUN npm ci | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| RUN npm test | ||
| RUN npm run build | ||
|
|
||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // UTM cookie configuration constants | ||
| const TC_UTM_COOKIE_NAME = 'tc_utm'; | ||
|
|
||
| /** | ||
| * Retrieves and parses the tc_utm cookie | ||
| * @returns Parsed UTM parameters or null if cookie doesn't exist | ||
| */ | ||
| export function getUtmCookie() { | ||
| try { | ||
| const cookies = document.cookie.split(';'); | ||
| const cookieStr = cookies.find(cookie => cookie.trim().startsWith(`${TC_UTM_COOKIE_NAME}=`)); | ||
|
|
||
| if (!cookieStr) { | ||
| return null; | ||
| } | ||
|
|
||
| // handle values that might contain '=' | ||
| const cookieValue = decodeURIComponent(cookieStr.split('=').slice(1).join('=')); | ||
| return JSON.parse(cookieValue); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| } catch (error) { | ||
| return null; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Appends UTM parameters from the tc_utm cookie to a given URL | ||
| * Only appends parameters that exist in the cookie | ||
| * @param url - The base URL to append parameters to | ||
| * @returns URL with UTM parameters appended, or original URL if no cookie exists | ||
| */ | ||
| export function appendUtmParamsToUrl(url, defaultParams = {}) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| if (!url) { | ||
| return url; | ||
| } | ||
|
|
||
| const utmParams = getUtmCookie(); | ||
|
|
||
| // If there are no cookie params and no defaults, nothing to do | ||
| if ( | ||
| (!utmParams || Object.keys(utmParams).length === 0) | ||
| && (!defaultParams || Object.keys(defaultParams).length === 0) | ||
| ) { | ||
| return url; | ||
| } | ||
|
|
||
| try { | ||
| const urlObj = new URL(url, window.location.origin); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| const paramNames = ['utm_source', 'utm_medium', 'utm_campaign']; | ||
|
|
||
| paramNames.forEach((param) => { | ||
| const cookieVal = utmParams && utmParams[param]; | ||
| const defaultVal = defaultParams && defaultParams[param]; | ||
|
|
||
| // Cookie takes precedence and will overwrite existing query param | ||
| if (cookieVal) { | ||
| urlObj.searchParams.set(param, cookieVal); | ||
| } else if (defaultVal) { | ||
| // Only apply default if the URL does not already have the param | ||
| if (!urlObj.searchParams.has(param)) { | ||
| urlObj.searchParams.set(param, defaultVal); | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| return urlObj.toString(); | ||
| } catch (error) { | ||
| return url; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗
security]Ensure that the
Circle-Tokenused in thecurlcommand is securely managed and not exposed in logs or version control. Consider using environment variables or CircleCI's secure contexts to manage sensitive information.