Skip to content

[DO NOT MERGE] - qa ci/cd setup #1504

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

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ install_test_dependency: &install_test_dependency
install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
git clone --branch v1.4 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
git clone --branch v1.4.15 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .
Expand Down Expand Up @@ -116,6 +116,17 @@ jobs:
APPNAME: "challenge-engine-ui"
steps: *builddeploy_steps


"build-qa":
<<: *defaults
environment:
DEPLOY_ENV: "QA"
LOGICAL_ENV: "qa"
NODE_ENV: "qa"
BABEL_ENV: "development"
APPNAME: "work-manager"
steps: *builddeploy_steps

"build-prod":
<<: *defaults
environment:
Expand Down Expand Up @@ -154,6 +165,12 @@ workflows:
branches:
only: ['develop', 'multiround']

- "build-qa":
context : org-global
filters: &filters-dev
branches:
only: ['qa']

# Production builds are exectuted only on tagged commits to the
# master branch.
- "build-prod":
Expand Down
4 changes: 2 additions & 2 deletions config/constants/development.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const DOMAIN = 'topcoder-dev.com'
const DOMAIN = 'topcoder-qa.com'
const DEV_API_HOSTNAME = `https://api.${DOMAIN}`

module.exports = {
Expand Down Expand Up @@ -47,7 +47,7 @@ module.exports = {
// duration to show the prompt saying user will be logged out, before actually logging out the user
IDLE_TIMEOUT_GRACE_MINUTES: 5,
MULTI_ROUND_CHALLENGE_TEMPLATE_ID: 'd4201ca4-8437-4d63-9957-3f7708184b07',
UNIVERSAL_NAV_URL: '//uni-nav.topcoder-dev.com/v1/tc-universal-nav.js',
UNIVERSAL_NAV_URL: '//uni-nav.topcoder-qa.com/v1/tc-universal-nav.js',
HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`,
HEADER_AUTH_URLS_LOCATION: `https://accounts-auth0.${DOMAIN}?retUrl=%S&utm_source=community-app-main`
}
4 changes: 3 additions & 1 deletion config/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module.exports = (() => {
if (env === 'production') {
return require('./production')
}

if (env === 'qa') {
return require('./qa')
}
return require('./development')
})()
53 changes: 53 additions & 0 deletions config/constants/qa.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const DOMAIN = 'topcoder-dev.com'
const DEV_API_HOSTNAME = `https://api.${DOMAIN}`

module.exports = {
ACCOUNTS_APP_CONNECTOR_URL: `https://accounts-auth0.${DOMAIN}`,
ACCOUNTS_APP_LOGIN_URL: `https://accounts-auth0.${DOMAIN}`,
COMMUNITY_APP_URL: `https://www.${DOMAIN}`,
MEMBER_API_URL: `${DEV_API_HOSTNAME}/v5/members`,
MEMBER_API_V3_URL: `${DEV_API_HOSTNAME}/v3/members`,
CHALLENGE_API_URL: `${DEV_API_HOSTNAME}/v5/challenges`,
CHALLENGE_TIMELINE_TEMPLATES_URL: `${DEV_API_HOSTNAME}/v5/timeline-templates`,
CHALLENGE_TYPES_URL: `${DEV_API_HOSTNAME}/v5/challenge-types`,
CHALLENGE_TRACKS_URL: `${DEV_API_HOSTNAME}/v5/challenge-tracks`,
CHALLENGE_PHASES_URL: `${DEV_API_HOSTNAME}/v5/challenge-phases`,
CHALLENGE_TIMELINES_URL: `${DEV_API_HOSTNAME}/v5/challenge-timelines`,
PROJECT_API_URL: `${DEV_API_HOSTNAME}/v5/projects`,
GROUPS_API_URL: `${DEV_API_HOSTNAME}/v5/groups`,
TERMS_API_URL: `${DEV_API_HOSTNAME}/v5/terms`,
RESOURCES_API_URL: `${DEV_API_HOSTNAME}/v5/resources`,
RESOURCE_ROLES_API_URL: `${DEV_API_HOSTNAME}/v5/resource-roles`,
SUBMISSIONS_API_URL: `${DEV_API_HOSTNAME}/v5/submissions`,
PLATFORMS_V4_API_URL: `${DEV_API_HOSTNAME}/v4/platforms`,
TECHNOLOGIES_V4_API_URL: `${DEV_API_HOSTNAME}/v4/technologies`,
SUBMISSION_REVIEW_APP_URL: `https://submission-review.${DOMAIN}/challenges`,
STUDIO_URL: `https://studio.${DOMAIN}`,
CONNECT_APP_URL: `https://connect.${DOMAIN}`,
DIRECT_PROJECT_URL: `https://www.${DOMAIN}/direct`,
ONLINE_REVIEW_URL: `https://software.${DOMAIN}`,
DEFAULT_TERM_UUID: '317cd8f9-d66c-4f2a-8774-63c612d99cd4', // Terms & Conditions of Use at TopCoder
DEFAULT_NDA_UUID: 'e5811a7b-43d1-407a-a064-69e5015b4900', // NDA v3.0
SUBMITTER_ROLE_UUID: '732339e7-8e30-49d7-9198-cccf9451e221',
DEV_TRACK_ID: '9b6fc876-f4d9-4ccb-9dfd-419247628825',
DES_TRACK_ID: '5fa04185-041f-49a6-bfd1-fe82533cd6c8',
DS_TRACK_ID: 'c0f5d461-8219-4c14-878a-c3a3f356466d',
QA_TRACK_ID: '36e6a8d0-7e1e-4608-a673-64279d99c115',
CP_TRACK_ID: '9d6e0de8-df14-4c76-ba0a-a9a8cb03a4ea',
CHALLENGE_TYPE_ID: '927abff4-7af9-4145-8ba1-577c16e64e2e',
MARATHON_TYPE_ID: '929bc408-9cf2-4b3e-ba71-adfbf693046c',
SEGMENT_API_KEY: 'QBtLgV8vCiuRX1lDikbMjcoe9aCHkF6n',
CREATE_FORUM_TYPE_IDS: ['927abff4-7af9-4145-8ba1-577c16e64e2e', 'dc876fa4-ef2d-4eee-b701-b555fcc6544c', 'ecd58c69-238f-43a4-a4bb-d172719b9f31'],
FILE_PICKER_API_KEY: process.env.FILE_PICKER_API_KEY,
FILE_PICKER_CONTAINER_NAME: 'tc-challenge-v5-dev',
FILE_PICKER_REGION: 'us-east-1',
FILE_PICKER_CNAME: 'fs.topcoder.com',
// if idle for this many minutes, show user a prompt saying they'll be logged out
IDLE_TIMEOUT_MINUTES: 10,
// duration to show the prompt saying user will be logged out, before actually logging out the user
IDLE_TIMEOUT_GRACE_MINUTES: 5,
MULTI_ROUND_CHALLENGE_TEMPLATE_ID: 'd4201ca4-8437-4d63-9957-3f7708184b07',
UNIVERSAL_NAV_URL: '//uni-nav.topcoder-dev.com/v1/tc-universal-nav.js',
HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`,
HEADER_AUTH_URLS_LOCATION: `https://accounts-auth0.${DOMAIN}?retUrl=%S&utm_source=community-app-main`
}
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ ENV FILE_PICKER_API_KEY=$FILE_PICKER_API_KEY
ENV FORCE_DEV=$FORCE_DEV

# Copy the current directory into the Docker image
COPY . /challenge-engine-ui
COPY . /work-manager

# Set working directory for future use
WORKDIR /challenge-engine-ui
WORKDIR /work-manager

# Install the dependencies from package.json
RUN echo "NODE ENV in Docker: $NODE_ENV"
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
challenge-engine-ui:
image: challenge-engine-ui:latest
work-manager:
image: work-manager:latest
build:
context: ../
dockerfile: docker/Dockerfile
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ app.use((req, res, next) => {
"frame-ancestors 'none';" +
"script-src 'report-sample' 'self' 'unsafe-inline' 'unsafe-eval'" +
' https://uni-nav.topcoder-dev.com' +
' https://uni-nav.topcoder-qa.com' +
' https://uni-nav.topcoder.com'
)

Expand Down
4 changes: 2 additions & 2 deletions src/actions/auth.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { configureConnector, decodeToken } from 'tc-auth-lib'
import { fetchProfile } from '../services/user'
import { fetchProfileV5 } from '../services/user'
import {
LOAD_USER_SUCCESS,
SAVE_AUTH_TOKEN
Expand All @@ -26,7 +26,7 @@ export function loadUser () {
if (!getState().auth.user) {
if (getState().auth.token) {
const { handle } = decodeToken(getState().auth.token)
fetchProfile(handle).then(user => {
fetchProfileV5(handle).then(user => {
dispatch({
type: LOAD_USER_SUCCESS,
user
Expand Down
2 changes: 1 addition & 1 deletion src/services/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function fetchProfile (handle) {
* @returns {Promise<*>}
*/
export async function fetchProfileV5 (handle) {
const response = await axiosInstance.get(`${MEMBER_API_URL}?handle=${handle}`)
const response = await axiosInstance.get(`${MEMBER_API_URL}/${handle}`)
const data = _.get(response, 'data')
return data.length ? data[0] : undefined
}
Expand Down