Update user-data and rearange requirements installation
This commit is contained in:
parent
83cd5046f4
commit
bdaea8040a
@ -33,9 +33,9 @@ WORKDIR /code
|
|||||||
|
|
||||||
COPY requirements/base.txt .
|
COPY requirements/base.txt .
|
||||||
COPY requirements/production.txt .
|
COPY requirements/production.txt .
|
||||||
COPY requirements/geeksbot.txt .
|
|
||||||
|
|
||||||
RUN pip install -r production.txt
|
RUN pip install -r production.txt
|
||||||
|
|
||||||
|
COPY requirements/geeksbot.txt .
|
||||||
RUN pip install -r geeksbot.txt
|
RUN pip install -r geeksbot.txt
|
||||||
|
|
||||||
ENV REDIS_DB 0
|
ENV REDIS_DB 0
|
||||||
|
|||||||
15
user-data.sh
15
user-data.sh
@ -1,12 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
yum update -y
|
|
||||||
export AWS_DEFAULT_REGION='us-east-1'
|
export AWS_DEFAULT_REGION='us-east-1'
|
||||||
instance_id=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
|
instance_id=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-id)
|
||||||
aws ec2 associate-address --instance-id $instance_id --public-ip "34.238.62.161"
|
|
||||||
mkdir /code || exit
|
role=$(aws ec2 describe-tags --filters "Name=resource-id,Values=$instance_id" | grep -2 role | grep Value | tr -d ' ' | cut -f2 -d: | tr -d '"' | tr -d ',')
|
||||||
cd /code || exit
|
if [ "$role" = "development" ]; then
|
||||||
git clone git@github.com:dustinpianalto/geeksbot_v2.git
|
aws ec2 associate-address --instance-id "$instance_id" --public-ip "3.211.100.13"
|
||||||
cd geeksbot_v2 || exit
|
git checkout development
|
||||||
|
else
|
||||||
|
aws ec2 associate-address --instance-id "$instance_id" --public-ip "34.238.62.161"
|
||||||
|
git checkout master
|
||||||
|
fi
|
||||||
docker build . -t geeksbot || exit
|
docker build . -t geeksbot || exit
|
||||||
docker run -d -v /code/geeksbot_v2:/code -v /root/.ssh:/root/.ssh:ro --name geeksbot --restart always geeksbot:latest || exit
|
docker run -d -v /code/geeksbot_v2:/code -v /root/.ssh:/root/.ssh:ro --name geeksbot --restart always geeksbot:latest || exit
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user