finalized automated build for web

This commit is contained in:
2020-08-09 14:43:33 +09:00
parent 94a9d18c02
commit 56b3448138
19 changed files with 83 additions and 35 deletions

View File

@@ -44,7 +44,15 @@
"sudo yum -y install dos2unix",
"wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash",
". ~/.nvm/nvm.sh",
"nvm install 12"
"nvm install 12",
"n=$(which node)",
"n=${n%/bin/node}",
"sudo chmod -R 755 $n/bin/*",
"sudo cp -r $n/{bin,lib,share} /usr/local",
"n=$(which npm)",
"n=${n%/bin/npm}",
"sudo chmod -R 755 $n/bin/*",
"sudo cp -r $n/{bin,lib,share} /usr/local"
]
},
{
@@ -59,6 +67,7 @@
"sudo dos2unix /tmp/platform-uploads/opt/web-init/web-init.sh",
"sudo cp -rf /tmp/platform-uploads/etc/* /etc/",
"sudo cp -rf /tmp/platform-uploads/opt/* /opt/",
"sudo chmod 755 /opt/web-init/web-init.sh",
"sudo systemctl enable web-init",
"sudo rm -rf /tmp/platform-uploads"
]

View File

@@ -4,6 +4,7 @@ Wants=network-online.target
After=network-online.target
[Service]
User=ec2-user
ExecStart=/opt/web-init/web-init.sh
Restart=always

View File

@@ -1,7 +1,9 @@
#!/bin/sh
aws s3 cp s3://catherine-fc-infra/build.tar.gz .
tar zxf build.tar.gz
rm build.tar.gz
cd build
rm -rf /tmp/build.tar.gz
rm -rf /tmp/build
aws s3 cp s3://catherine-fc-infra/build.tar.gz /tmp/build.tar.gz
tar -C /tmp -zxvf /tmp/build.tar.gz
cd /tmp/build/
npm i
node server/index.js