Open woowahan-pjs opened 4 years ago
s3 정적 웹사이트 호스팅 (현재 archive front배포방식) https://docs.aws.amazon.com/ko_kr/AmazonS3/latest/dev/EnableWebsiteHosting.html 올린모습 http://apply-web-test.s3-website.ap-northeast-2.amazonaws.com/ +클라우드프론트 https://ddqva2t3vv9sl.cloudfront.net/
AWS EC2 Ubuntu 18.04
sudo apt update
sudo apt install default-jre
sudo apt install default-jdk
sudo apt install ruby
sudo apt install awscli
cd /home/ubuntu/
sudo aws configure
AWS Access Key ID [None]:
AWS Secret Access Key [None]:
Default region name [None]: ap-northeast-2
Default output format [None]: json
wget https://aws-codedeploy-ap-northeast-2.s3.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto
Elastic Beanstalk 생성 시 오류가 발생한다.
Creating load balancer failed Reason: Default VPC not found (Service: AmazonElasticLoadBalancing; Status Code: 409; Error Code: InvalidConfigurationRequest; Request ID: 5bd22acf-114f-4a4c-ae4d-1e0e5ec2c672; Proxy: null)
Stack named 'awseb-e-pmbdem9uid-stack' aborted operation. Current state: 'CREATE_FAILED' Reason: The following resource(s) failed to create: [AWSEBLoadBalancer].
기본 VPC를 생성한다. https://docs.aws.amazon.com/ko_kr/vpc/latest/userguide/default-vpc.html#create-default-vpc
Beanstalk 환경의 EC2 인스턴스에서 /var/log/eb-activity.log
와 /var/log/eb-commandprocessor.log
가 보이지 않는다.
Elastic Beanstalk 환경에서 Amazon EC2 인스턴스의 로그 보기
buildspec.yml
version: 0.2
phases:
build:
commands:
- echo Build Starting on `date`
- chmod +x ./gradlew
- ./gradlew clean build -Pvaadin.productionMode -x test
post_build:
commands:
- echo $(basename ./build/libs/*.jar)
- pwd
artifacts:
files:
- ./build/libs/*.jar
- ./appspec.yml
- ./scripts/**
discard-paths: yes
cache:
paths:
- /root/.gradle/caches/**/*
- '**/node_modules/**/*'
appspec.yml
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/build/
permissions:
- object: /
pattern: "**"
owner: ubuntu
group: ubuntu
hooks:
AfterInstall:
- location: deploy.sh
timeout: 60
runas: ubuntu
deploy.sh
#!/bin/bash
BUILD_PATH=$(ls /home/ubuntu/build/*.jar)
JAR_NAME=$(basename $BUILD_PATH)
CURRENT_PID=$(pgrep -f $JAR_NAME)
if [ -z $CURRENT_PID ]
then
sleep 1
else
kill -15 $CURRENT_PID
sleep 5
fi
DEPLOY_PATH=/home/ubuntu/
cp $BUILD_PATH $DEPLOY_PATH
cd $DEPLOY_PATH
DEPLOY_JAR=$DEPLOY_PATH$JAR_NAME
nohup java -jar $DEPLOY_JAR > /dev/null 2> /dev/null < /dev/null &
APPLICATION_URL
는 스프링의 application.url
에 대응한다.AWS_ACCESS_KEY
는 스프링의 aws.access-key
에 대응한다.121.165.253.64/27 (사무실), 121.165.253.192/27 (VPN), 58.236.10.83 (VPN)
e.g. 121.165.253.64/27
01111001.10100101.11111101.01000000
11111111.11111111.11111111.11100000
Administrator
Frontend
https://github.com/npm/cli/issues/681