Compare commits

..

7 Commits

Author SHA1 Message Date
b39c901dfd pbulish test 2020-05-07 14:08:22 +07:00
f954e0387c nothing 2020-05-07 14:06:19 +07:00
f84f47b4c4 new build 2020-05-07 14:05:00 +07:00
d8cab30a5b write docker config 2020-05-07 14:04:20 +07:00
c784db1d15 16 2020-05-07 13:36:37 +07:00
d4d1e2a698 15 2020-05-07 13:27:09 +07:00
675233784f test publis 2020-05-07 13:25:35 +07:00
9 changed files with 77 additions and 14 deletions

0
176 Normal file
View File

View File

@ -1,14 +0,0 @@
FROM node:13.14.0-alpine3.10
WORKDIR /home/app/app
COPY build public
COPY ./server.js ./server.js
COPY ./server.package.json ./package.json
ENV PORT=8000
RUN npm install express
CMD npm run start
EXPOSE 8000

20
dockers/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# Use Image Node Alpine For Build
FROM node:13.14.0-alpine3.10
# Default Working Directory
WORKDIR /home/app/app
# Copy Build Directory To Public Directory in Docker
COPY build public
# Copy server.js To server , we open server from here
COPY ./dockers/server.js ./server.js
# Copy package.json for server to docker package json
COPY ./dockers/server.package.json ./package.json
# install express , for open server
RUN npm install express

54
hooks.sh Normal file
View File

@ -0,0 +1,54 @@
#!/bin/sh
echo $PWD
while read oldrev newrev ref
do
CURRENT_BRANCH=`echo $ref | cut -d/ -f3`
done
TARGET="/home/git/pub/test_react_hook"
TEMP="/home/git/tmp/test_react_hook"
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
HEROKU_APP_NAME="react-host-test"
API_KEY=d282975b-22ba-48f1-9bbe-a1a22bec5543
echo "Current Branch : $CURRENT_BRANCH"
if [ CURRENT_BRANCH != "publish" ]
then
echo "Not Publish"
exit;
fi
cd ..
REPO="$PWD/test_react_hook.git"
mkdir -p $TEMP
git --work-tree=$TEMP --git-dir=$REPO checkout -f
cd $TEMP
echo "Start Install Project Dependencies"
yarn install
echo "Start Building Project"
yarn build
echo "Push Project To Heroku"
echo "-- Start Login Heroku Containers Registry"
HEROKU_API_KEY=$API_KEY heroku container:login
echo "-- Start Push App To Heroku"
HEROKU_API_KEY=$API_KEY heroku container:push -a $HEROKU_APP_NAME web
echo "-- Start Release App on Heroku"
HEROKU_API_KEY=$API_KEY heroku container:release -a $HEROKU_APP_NAME web
echo "-- Infomation "
HEROKU_API_KEY=$API_KEY heroku apps:info -a $HEROKU_APP_NAME
rm -rf $TEMP

0
nothig Normal file
View File

View File

@ -3,6 +3,9 @@ import logo from './logo.svg';
import './App.css';
function App() {
return (
<h1>New Docker Build</h1>
)
return (
<h1>HHHHHHHHHHHHHHHHHHHHHHHThis is Docker from hook React My DOCKER Second Time From React HOOK</h1>

0
test14 Normal file
View File

0
test15 Normal file
View File