Skip to content

Commit

Permalink
Merge pull request #1587 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
PROD - Support dashboard checkbox for code challenges
  • Loading branch information
jmgasper authored Apr 19, 2024
2 parents 25754fe + 96d2774 commit 7ca8c9a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 45 deletions.
83 changes: 41 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ parameters:
type: boolean

defaults: &defaults
docker:
- image: cimg/python:3.11.0-browsers
docker:
- image: cimg/python:3.11.7-browsers

test_defaults: &test_defaults
docker:
- image: docker:17.11.0-ce-git
docker:
- image: docker:17.11.0-ce-git

install_dependency: &install_dependency
name: Installation of build and deployment dependencies.
Expand All @@ -22,8 +22,8 @@ install_dependency: &install_dependency
sudo apt update
sudo apt install python3-pip
sudo pip3 install awscli --upgrade
sudo pip3 install docker==6.1.3
sudo pip3 install docker-compose
# sudo pip3 install docker==6.1.3
# sudo pip3 install docker-compose
install_test_dependency: &install_test_dependency
name: Installation of build and deployment dependencies.
Expand Down Expand Up @@ -51,39 +51,38 @@ save_cache_settings: &save_cache_settings
- node_modules

builddeploy_steps: &builddeploy_steps
- checkout
- setup_remote_docker
- run: *install_dependency
- run: *install_deploysuite
- run:
name: "configuring environment"
command: |
./awsconfiguration.sh $DEPLOY_ENV
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
echo awsenvconf >.dockerignore
echo buildenvvar >>.dockerignore
- run:
name: "building image"
command: |
source buildenvvar
./build.sh ${APPNAME}
- deploy:
name: Running MasterScript.
command: |
#./awsconfiguration.sh $DEPLOY_ENV
source awsenvconf
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
source buildenvvar
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
#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_basedeployment": false}}'
- checkout
- setup_remote_docker
- run: *install_dependency
- run: *install_deploysuite
- run:
name: "configuring environment"
command: |
./awsconfiguration.sh $DEPLOY_ENV
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
echo awsenvconf >.dockerignore
echo buildenvvar >>.dockerignore
- run:
name: "building image"
command: |
source buildenvvar
./build.sh ${APPNAME}
- deploy:
name: Running MasterScript.
command: |
#./awsconfiguration.sh $DEPLOY_ENV
source awsenvconf
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
source buildenvvar
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
#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_basedeployment": false}}'
# Automated Smoke Testing
smoke_testing: &smoke_testing
# Initialization.
smoke_testing: &smoke_testing # Initialization.
- checkout
- setup_remote_docker
- run: *install_test_dependency
Expand Down Expand Up @@ -150,15 +149,15 @@ workflows:
jobs:
# Development builds are executed on "develop" branch only.
- "build-dev":
context : org-global
context: org-global
filters: &filters-dev
branches:
only: ['develop', 'multiround', 'release_0.20.9', 'metadata-fix']
only: ["develop", "multiround", "release_0.20.9", "metadata-fix"]

# Production builds are exectuted only on tagged commits to the
# master branch.
- "build-prod":
context : org-global
context: org-global
filters: &filters-prod
branches:
only: master
Expand All @@ -169,13 +168,13 @@ workflows:
- Hold [Smoke-Testing]:
type: approval
- smoke-testing-dev:
context : org-global
context: org-global
requires:
- Hold [Smoke-Testing]
filters:
<<: *filters-dev
- smoke-testing-prod:
context : org-global
context: org-global
requires:
- Hold [Smoke-Testing]
filters:
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ APP_NAME=$1
UPDATE_CACHE=""
echo "NODE ENV: $NODE_ENV"
echo "BABEL ENV: $BABEL_ENV"
docker-compose -f docker/docker-compose.yml build --build-arg NODE_ENV=$NODE_ENV --build-arg BABEL_ENV=$BABEL_ENV --build-arg FILE_PICKER_API_KEY=$FILE_PICKER_API_KEY --build-arg FORCE_DEV=$FORCE_DEV $APP_NAME
docker compose -f docker/docker-compose.yml build --build-arg NODE_ENV=$NODE_ENV --build-arg BABEL_ENV=$BABEL_ENV --build-arg FILE_PICKER_API_KEY=$FILE_PICKER_API_KEY --build-arg FORCE_DEV=$FORCE_DEV $APP_NAME
docker create --name app $APP_NAME:latest

if [ -d node_modules ]
Expand Down
4 changes: 2 additions & 2 deletions src/components/ChallengeEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ class ChallengeEditor extends Component {
const isChallengeType = typeId === CHALLENGE_TYPE_ID
const isDevChallenge = trackId === DEV_TRACK_ID
const isMM = typeId === MARATHON_TYPE_ID
const showDashBoard = (isDataScience && isChallengeType) || (isDevChallenge && isMM)
const showDashBoard = (isDataScience && isChallengeType) || (isDevChallenge && isMM) || (isDevChallenge && isChallengeType)

// indicate that creating process has started
this.setState({ isSaving: true })
Expand Down Expand Up @@ -1647,7 +1647,7 @@ class ChallengeEditor extends Component {
const isChallengeType = challenge.typeId === CHALLENGE_TYPE_ID
const showRoundType = isDesignChallenge && isChallengeType
const showCheckpointPrizes = challenge.timelineTemplateId === MULTI_ROUND_CHALLENGE_TEMPLATE_ID
const showDashBoard = (challenge.trackId === DS_TRACK_ID && isChallengeType) || (isDevChallenge && isMM)
const showDashBoard = (challenge.trackId === DS_TRACK_ID && isChallengeType) || (isDevChallenge && isMM) || (isDevChallenge && isChallengeType)
const useDashboardData = _.find(challenge.metadata, { name: 'show_data_dashboard' })

const useDashboard = useDashboardData
Expand Down

0 comments on commit 7ca8c9a

Please sign in to comment.