forked from BAWES-Universe/plugn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws-template-dev-docker.sh
More file actions
40 lines (34 loc) · 1.17 KB
/
aws-template-dev-docker.sh
File metadata and controls
40 lines (34 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Update the package repository and install required packages
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y docker.io unzip curl gh docker-compose
# Start and enable Docker
sudo systemctl start docker
sudo systemctl enable docker
# Add the 'ubuntu' user to the Docker group
sudo usermod -aG docker ubuntu
# gir repo setup 1st way
apt install -y openssh-clients
ps -auxc | grep ssh-agent
eval $(ssh-agent)
sudo mkdir -p /home/ubuntu/plugn
sudo chmod 2775 /var/www
cd /home/ubuntu/plugn
echo "github private key" > ~/.ssh/github
chmod go-rw ~/.ssh/github
echo "github public key" > ~/.ssh/github.pub
#or ssh-keygen -y -f ~/.ssh/github > ~/.ssh/github.pub
#sudo chmod a+r ~/.ssh/github
ssh-add ~/.ssh/github
ssh-keyscan github.com >> ~/.ssh/known_hosts
apt install -y git
git clone git@github.com:plugnio/plugn.git /home/ubuntu/plugn
#cd ./plugn
cd /home/ubuntu/plugn
git remote add git@github.com:plugnio/plugn.git
git checkout develop
git config --global --add safe.directory /home/ubuntu/plugn
find /var/www -type d -exec chmod 2775 {} \;
find /var/www -type f -exec chmod 0664 {} \;
docker-compose -f docker-compose-dev.yml -p plugn-dev-server up -d