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
#!/bin/sh | |
if [ -f .git/hooks/pre-commit ]; then | |
read -p "A pre-commit hook has been set up. Do you want to overwrite it? (y/n) " yn | |
case $yn in | |
[Yy]*) rm .git/hooks/pre-commit ;; | |
[Nn]*) exit ;; | |
esac | |
fi |
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
#!/bin/sh | |
set -e | |
path="$1" | |
message=$(cat "$path") | |
echo "$message" | |
# shellcheck disable=SC2039 | |
if ! [[ $message =~ ^US([0-9]{5})(\s*)* ]]; then | |
printf '\n\e[1;31mERROR: Your commit message must contain User Story ID\e[0m\n\n' |
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
#!/bin/sh | |
set -e | |
# Check style for main and test | |
./gradlew checkstyleMain | |
./gradlew checkstyleTest | |
# Check the exit status from gradle command | |
if [ $? -eq 0 ]; then | |
echo "Your code has been validated successfully!" |
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
touch /tmp/attach-output.txt | |
/usr/bin/auto-attach-eip > /tmp/attach-output.txt |
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
instance_id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
allocated_eip=<elastic ip address> | |
aws ec2 associate-address --instance-id $instance_id --public-ip $allocated_eip |
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
#!/bin/bash | |
REVISION=$(aws ecs list-task-definitions --family-prefix $AWS_ECS_CONTAINER_NAME | jq '.taskDefinitionArns[]' | tr -d '"' | tail -1 | rev | cut -d':' -f 1 | rev) | |
if [ ! -z "$REVISION" ]; then | |
aws ecs deregister-task-definition \ | |
--region $AWS_DEFAULT_REGION \ | |
--task-definition $AWS_ECS_CONTAINER_NAME:$REVISION \ | |
>> /dev/null | |
# Prevent ecs to restart the task to update new code |
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
#!/bin/bash | |
# This is the user data to be added into launch configuration for auto scaling group | |
env="stg" #TODO: change environment | |
AWS_ECS_CLUSTER_NAME="cluster-name-$env" | |
echo ECS_CLUSTER=$AWS_ECS_CLUSTER_NAME >> /etc/ecs/ecs.config | |
echo ECS_BACKEND_HOST= >> /etc/ecs/ecs.config | |
echo "ECS_ENABLE_TASK_CPU_MEM_LIMIT=false" >> /etc/ecs/ecs.config | |
START_TASK_SCRIPT_FILE="/etc/ecs/ecs-start-task.sh" | |
cat <<- 'EOF' > ${START_TASK_SCRIPT_FILE} | |
# Set environment variables and store logs to file |
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
<style id="jsbin-css"> | |
#image { | |
display:none; | |
width: 340px; | |
height: 700px; | |
} | |
</style> | |
<img id="image" src="https://c3po-ui.us-west-2.int.expedia.com/media/EXPEDIA_BOOKING_ANDROID_APP/expedia.co.kr_ko_KR/ff1087eb-d4af-4b60-b731-e8733e3bcf78/FlightSearching_1.jpg"> | |
<canvas id="canvas" width="340" height="700"> | |
Your browser does not support the HTML5 canvas tag. |
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
<style id="jsbin-css"> | |
#image { | |
display:none; | |
width: 340px; | |
height: 700px; | |
} | |
</style> | |
<img id="image" src="https://c3po-ui.us-west-2.int.expedia.com/media/EXPEDIA_BOOKING_ANDROID_APP/expedia.co.kr_ko_KR/ff1087eb-d4af-4b60-b731-e8733e3bcf78/FlightSearching_1.jpg"> | |
<canvas id="canvas" width="340" height="700"> | |
Your browser does not support the HTML5 canvas tag. |
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
<style id="jsbin-css"> | |
#image { | |
display:none; | |
width: 340px; | |
height: 700px; | |
} | |
</style> | |
<img id="image" src="https://c3po-ui.us-west-2.int.expedia.com/media/EXPEDIA_BOOKING_ANDROID_APP/expedia.co.kr_ko_KR/ff1087eb-d4af-4b60-b731-e8733e3bcf78/FlightSearching_1.jpg"> | |
<canvas id="canvas" width="340" height="700"> | |
Your browser does not support the HTML5 canvas tag. |
NewerOlder