This repository was archived by the owner on Jan 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 104
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d0d6b87
Fixed download URL challenge
coderReview 00255b6
Fixed download URL challenge
coderReview ad87b67
Added file topcoder_global.properties
coderReview 4665d09
fixed .gitignore
coderReview a161f15
Migrating to properties files to S3
8e297d2
Update README.md
Gunasekar-K 063e837
Update build.xml
BadalZ 396530f
updated appirio to wipro
ajefts fcffc0a
changed appirio to wipro
ajefts 45f5582
changed appirio to wipro
ajefts 4d11607
changed appirio to wipro
ajefts f1dd52d
updated svn label
ajefts 4c3b01d
hiding unused challenge types
ajefts d4531d1
Order the challenge type dropdown alphabetically
ajefts 5f9757c
trying to add prize levels to Code challenge type
ajefts 1b956a5
revert
ajefts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#!/bin/bash | ||
KEY_LOCATION="" | ||
BUILDENV_LIST="" | ||
usage() | ||
{ | ||
cat << EOF | ||
usage: $0 options | ||
This script need to be executed with below option. | ||
OPTIONS: | ||
-e environment | ||
-b Security file location GIT|AWS | ||
-k key location | ||
EOF | ||
} | ||
#log Function - Used to provide information of execution information with date and time | ||
log() | ||
{ | ||
echo "`date +'%D %T'` : $1" | ||
} | ||
track_error() | ||
{ | ||
if [ $1 != "0" ]; then | ||
log "$2 exited with error code $1" | ||
log "completed execution IN ERROR at `date`" | ||
exit $1 | ||
fi | ||
|
||
} | ||
download_buildenvfile() | ||
{ | ||
if [ -z "$BUILDENV_LIST" ]; | ||
then | ||
if [ -z "$KEY_LOCATION" ]; | ||
then | ||
track_error $? "Please provide the file list using -b or file location -k or both -b and -k " | ||
else | ||
aws s3 sync s3://tc-buildproperties-${ENV_CONFIG}/$KEY_LOCATION . | ||
track_error $? "Environment setting" | ||
fi | ||
|
||
else | ||
Buffer_seclist=$(echo $BUILDENV_LIST | sed 's/,/ /g' ) | ||
for listname in $Buffer_seclist; | ||
do | ||
if [ -z "$KEY_LOCATION" ]; | ||
then | ||
aws s3 cp s3://tc-buildproperties-${ENV_CONFIG}/$listname . | ||
track_error $? "Environment setting" | ||
else | ||
aws s3 cp s3://tc-buildproperties-${ENV_CONFIG}/$KEY_LOCATION/$listname . | ||
track_error $? "Environment setting" | ||
fi | ||
done | ||
fi | ||
|
||
} | ||
|
||
configure_aws_cli() { | ||
aws --version | ||
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID | ||
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY | ||
aws configure set default.region $AWS_REGION | ||
aws configure set default.output json | ||
log "Configured AWS CLI." | ||
} | ||
|
||
while getopts .b:e:k:. OPTION | ||
do | ||
case $OPTION in | ||
e) | ||
ENV=$OPTARG | ||
;; | ||
b) | ||
BUILDENV_LIST=$OPTARG | ||
;; | ||
k) | ||
KEY_LOCATION=$OPTARG | ||
;; | ||
?) | ||
log "additional param required" | ||
usage | ||
exit | ||
;; | ||
esac | ||
done | ||
|
||
AWS_ACCESS_KEY_ID=$(eval "echo \$${ENV}_AWS_ACCESS_KEY_ID") | ||
AWS_SECRET_ACCESS_KEY=$(eval "echo \$${ENV}_AWS_SECRET_ACCESS_KEY") | ||
AWS_REGION=$(eval "echo \$${ENV}_AWS_REGION") | ||
if [ -z $AWS_REGION ]; | ||
then | ||
AWS_REGION="us-east-1" | ||
fi | ||
if [ -z $AWS_ACCESS_KEY_ID ] || [ -z $AWS_SECRET_ACCESS_KEY ] ; | ||
then | ||
log "AWS Secret Parameters are not configured in circleci/environment" | ||
usage | ||
exit 1 | ||
else | ||
configure_aws_cli | ||
fi | ||
ENV_CONFIG=`echo "$ENV" | tr '[:upper:]' '[:lower:]'` | ||
download_buildenvfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
accessKey = @aws_s3_access_key@ | ||
secretKey = @aws_s3_secret_key@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@coderReview When this was deployed, the @studio_file_storage_location@ wasn't replaced with the actual file location. Do you know what else needs to be updated to make that happen?
fyi @cwdcwd
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.
you need the token.properties file to be updated
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.
@coderReview Sorry, coming back to this one. What needs to be set in token.properties? Do you know what value @studio_file_storage_location@ needs to be set to?