Skip to content

Commit 7ca8c9a

Browse files
authored
Merge pull request #1587 from topcoder-platform/develop
PROD - Support dashboard checkbox for code challenges
2 parents 25754fe + 96d2774 commit 7ca8c9a

File tree

3 files changed

+44
-45
lines changed

3 files changed

+44
-45
lines changed

.circleci/config.yml

+41-42
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ parameters:
88
type: boolean
99

1010
defaults: &defaults
11-
docker:
12-
- image: cimg/python:3.11.0-browsers
11+
docker:
12+
- image: cimg/python:3.11.7-browsers
1313

1414
test_defaults: &test_defaults
15-
docker:
16-
- image: docker:17.11.0-ce-git
15+
docker:
16+
- image: docker:17.11.0-ce-git
1717

1818
install_dependency: &install_dependency
1919
name: Installation of build and deployment dependencies.
@@ -22,8 +22,8 @@ install_dependency: &install_dependency
2222
sudo apt update
2323
sudo apt install python3-pip
2424
sudo pip3 install awscli --upgrade
25-
sudo pip3 install docker==6.1.3
26-
sudo pip3 install docker-compose
25+
# sudo pip3 install docker==6.1.3
26+
# sudo pip3 install docker-compose
2727
2828
install_test_dependency: &install_test_dependency
2929
name: Installation of build and deployment dependencies.
@@ -51,39 +51,38 @@ save_cache_settings: &save_cache_settings
5151
- node_modules
5252

5353
builddeploy_steps: &builddeploy_steps
54-
- checkout
55-
- setup_remote_docker
56-
- run: *install_dependency
57-
- run: *install_deploysuite
58-
- run:
59-
name: "configuring environment"
60-
command: |
61-
./awsconfiguration.sh $DEPLOY_ENV
62-
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
63-
echo awsenvconf >.dockerignore
64-
echo buildenvvar >>.dockerignore
65-
- run:
66-
name: "building image"
67-
command: |
68-
source buildenvvar
69-
./build.sh ${APPNAME}
70-
- deploy:
71-
name: Running MasterScript.
72-
command: |
73-
#./awsconfiguration.sh $DEPLOY_ENV
74-
source awsenvconf
75-
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
76-
source buildenvvar
77-
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
78-
#curl --request POST \
79-
#--url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \
80-
#--header "Circle-Token: ${CIRCLE_TOKEN}" \
81-
#--header 'content-type: application/json' \
82-
#--data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true, "run_basedeployment": false}}'
54+
- checkout
55+
- setup_remote_docker
56+
- run: *install_dependency
57+
- run: *install_deploysuite
58+
- run:
59+
name: "configuring environment"
60+
command: |
61+
./awsconfiguration.sh $DEPLOY_ENV
62+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-buildvar
63+
echo awsenvconf >.dockerignore
64+
echo buildenvvar >>.dockerignore
65+
- run:
66+
name: "building image"
67+
command: |
68+
source buildenvvar
69+
./build.sh ${APPNAME}
70+
- deploy:
71+
name: Running MasterScript.
72+
command: |
73+
#./awsconfiguration.sh $DEPLOY_ENV
74+
source awsenvconf
75+
./buildenv.sh -e $DEPLOY_ENV -b ${LOGICAL_ENV}-${APPNAME}-deployvar
76+
source buildenvvar
77+
./master_deploy.sh -d ECS -e $DEPLOY_ENV -t latest -s ${LOGICAL_ENV}-global-appvar,${LOGICAL_ENV}-${APPNAME}-appvar -i ${APPNAME}
78+
#curl --request POST \
79+
#--url https://circleci.com/api/v2/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pipeline \
80+
#--header "Circle-Token: ${CIRCLE_TOKEN}" \
81+
#--header 'content-type: application/json' \
82+
#--data '{"branch":"'"$CIRCLE_BRANCH"'","parameters":{"run_smoketesting":true, "run_basedeployment": false}}'
8383
8484
# Automated Smoke Testing
85-
smoke_testing: &smoke_testing
86-
# Initialization.
85+
smoke_testing: &smoke_testing # Initialization.
8786
- checkout
8887
- setup_remote_docker
8988
- run: *install_test_dependency
@@ -150,15 +149,15 @@ workflows:
150149
jobs:
151150
# Development builds are executed on "develop" branch only.
152151
- "build-dev":
153-
context : org-global
152+
context: org-global
154153
filters: &filters-dev
155154
branches:
156-
only: ['develop', 'multiround', 'release_0.20.9', 'metadata-fix']
155+
only: ["develop", "multiround", "release_0.20.9", "metadata-fix"]
157156

158157
# Production builds are exectuted only on tagged commits to the
159158
# master branch.
160159
- "build-prod":
161-
context : org-global
160+
context: org-global
162161
filters: &filters-prod
163162
branches:
164163
only: master
@@ -169,13 +168,13 @@ workflows:
169168
- Hold [Smoke-Testing]:
170169
type: approval
171170
- smoke-testing-dev:
172-
context : org-global
171+
context: org-global
173172
requires:
174173
- Hold [Smoke-Testing]
175174
filters:
176175
<<: *filters-dev
177176
- smoke-testing-prod:
178-
context : org-global
177+
context: org-global
179178
requires:
180179
- Hold [Smoke-Testing]
181180
filters:

build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ APP_NAME=$1
44
UPDATE_CACHE=""
55
echo "NODE ENV: $NODE_ENV"
66
echo "BABEL ENV: $BABEL_ENV"
7-
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
7+
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
88
docker create --name app $APP_NAME:latest
99

1010
if [ -d node_modules ]

src/components/ChallengeEditor/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ class ChallengeEditor extends Component {
10051005
const isChallengeType = typeId === CHALLENGE_TYPE_ID
10061006
const isDevChallenge = trackId === DEV_TRACK_ID
10071007
const isMM = typeId === MARATHON_TYPE_ID
1008-
const showDashBoard = (isDataScience && isChallengeType) || (isDevChallenge && isMM)
1008+
const showDashBoard = (isDataScience && isChallengeType) || (isDevChallenge && isMM) || (isDevChallenge && isChallengeType)
10091009

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

16531653
const useDashboard = useDashboardData

0 commit comments

Comments
 (0)