-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.dockerfile
38 lines (30 loc) · 1.12 KB
/
release.dockerfile
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
FROM node:14.17-alpine3.12
RUN apk add git && \
npm install -g heroku && \
npm install -g npm@7
WORKDIR /usr/src/app
COPY package*.json ./
RUN CYPRESS_INSTALL_BINARY=0 npm install
COPY . .
RUN npm run build
WORKDIR /usr/src/release
CMD git config --global user.email "$GIT_USER_EMAIL" && \
git config --global user.name "$GIT_USER_NAME" && \
echo "machine api.heroku.com" >> ~/.netrc && \
echo " login $GIT_USER_EMAIL" >> ~/.netrc && \
echo " password $HEROKU_TOKEN" >> ~/.netrc && \
echo "machine git.heroku.com" >> ~/.netrc && \
echo " login $GIT_USER_EMAIL" >> ~/.netrc && \
echo " password $HEROKU_TOKEN" >> ~/.netrc && \
git clone https://git.heroku.com/$APP_NAME.git && \
cd anime-suupu && \
mkdir -p dist && \
cp /usr/src/app/dist/* ./dist && \
cp /usr/src/app/static.json . && \
git add static.json dist && \
git diff-index --quiet HEAD || git commit -m "Releasing $VERSION" && \
heroku buildpacks:clear && \
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git && \
heroku git:remote -a $APP_NAME && \
echo "Pushing $VERSION to Heroku" && \
git push heroku master