Compare commits

...

11 Commits

Author SHA1 Message Date
cdeb24f3ae git Merge branch 'publish' into other 2020-05-07 14:07:03 +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
9270ce8a15 22 2020-05-07 13:49:46 +07:00
10ee14f94a 21 2020-05-07 13:49:37 +07:00
0db03e94ef tst 2020-05-07 13:48:02 +07:00
efd5dee699 18 2020-05-07 13:45:44 +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
13 changed files with 77 additions and 14 deletions

0
176 Normal file
View File

0
20 Normal file
View File

0
21 Normal file
View File

0
22 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
t18 Normal file
View File

0
test14 Normal file
View File

0
test15 Normal file
View File