Compare commits
11 Commits
1.0.0-prod
...
main
Author | SHA1 | Date |
---|---|---|
|
16e2c8fc09 | |
|
65b3dd7cae | |
|
8f5fff0b91 | |
|
e9152f11f4 | |
|
b37dff48e3 | |
|
9628070fcd | |
|
51130437d7 | |
|
4c6c52d59b | |
|
c77059971c | |
|
45178d1312 | |
|
13758c5730 |
34
.drone.yml
34
.drone.yml
|
@ -20,6 +20,40 @@ steps:
|
|||
build_args:
|
||||
- env_target=env.production-online
|
||||
- release_version=${DRONE_TAG}
|
||||
- name: kustomize-production
|
||||
image: registry.k8s.io/kustomize/kustomize:v5.0.0
|
||||
environment:
|
||||
DEVOPS_SSH_PRIVATE:
|
||||
from_secret: DEVOPS_SSH_PRIVATE
|
||||
DEVOPS_SSH_PUBLIC:
|
||||
from_secret: DEVOPS_SSH_PUBLIC
|
||||
commands:
|
||||
- mkdir -p ~/.ssh &&
|
||||
- echo $DEVOPS_SSH_PRIVATE | base64 -d > ~/.ssh/id_rsa &&
|
||||
- echo $DEVOPS_SSH_PUBLIC | base64 -d > ~/.ssh/id_rsa.pub &&
|
||||
- ssh-keyscan -H -p 2222 git.eigen.co.id >> ~/.ssh/known_hosts &&
|
||||
- chmod 700 ~/.ssh/ &&
|
||||
- chmod 600 ~/.ssh/id_rsa &&
|
||||
- git clone ssh://git@git.eigen.co.id:2222/eigen/k8s-kustomize-external.git &&
|
||||
- cd k8s-kustomize-external/weplay-pos-production
|
||||
- kustomize edit set image registry.eigen.co.id/eigen/$DRONE_REPO_NAME-production-online=registry.eigen.co.id/eigen/$DRONE_REPO_NAME-production-online:$DRONE_TAG &&
|
||||
- kustomize edit set image registry.eigen.co.id/eigen/$DRONE_REPO_NAME-production-offline=registry.eigen.co.id/eigen/$DRONE_REPO_NAME-production-offline:$DRONE_TAG &&
|
||||
- git add . &&
|
||||
- |-
|
||||
git commit -m "feat: update $DRONE_REPO_NAME production to $DRONE_TAG" &&
|
||||
- git push origin master
|
||||
- name: send-message
|
||||
image: plugins/webhook
|
||||
settings:
|
||||
urls: https://mattermost.eigen.co.id/api/v4/posts
|
||||
content_type: application/json
|
||||
headers:
|
||||
- Authorization=Bearer 5zubexudb38uuradfa36qy98ca
|
||||
template: |
|
||||
{
|
||||
"channel_id": "s1ekqde1c3du5p35g6budnuotc",
|
||||
"message": "Build {{repo.name}} sudah selesai"
|
||||
}
|
||||
trigger:
|
||||
ref:
|
||||
- refs/tags/*-production.*
|
17
Dockerfile
17
Dockerfile
|
@ -1,4 +1,4 @@
|
|||
FROM node:20-alpine as build
|
||||
FROM node:18-alpine as build
|
||||
|
||||
ARG env_target
|
||||
ARG release_version
|
||||
|
@ -12,14 +12,9 @@ COPY env/$env_target /app/.env
|
|||
RUN echo -e "\n" >> /app/.env
|
||||
RUN echo -e "APP_VERSION=${release_version}" >> /app/.env
|
||||
|
||||
RUN yarn install
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
RUN yarn build
|
||||
|
||||
FROM nginx:1.16.0-alpine
|
||||
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
FROM caddy:2.6.1-alpine
|
||||
COPY caddy/Caddyfile /etc/caddy/Caddyfile
|
||||
COPY --from=build /app/dist /srv
|
|
@ -0,0 +1,5 @@
|
|||
:80 {
|
||||
root * /srv
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
VITE_APP_MODE=production
|
||||
VITE_BASE_API_URL=http://103.187.147.241:30050/api
|
||||
VITE_BASE_API_REPORT_URL=http://103.187.147.241:30050/api
|
|
@ -1,17 +0,0 @@
|
|||
server {
|
||||
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
}
|
|
@ -8,6 +8,9 @@
|
|||
"name": "pos-realtime-report",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"ag-grid-community": "^31.3.2",
|
||||
"ag-grid-enterprise": "^31.3.2",
|
||||
"ag-grid-react": "^31.3.2",
|
||||
"antd": "^5.21.2",
|
||||
"axios": "^1.7.7",
|
||||
"crypto-js": "^4.2.0",
|
||||
|
@ -1823,6 +1826,38 @@
|
|||
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ag-charts-community": {
|
||||
"version": "9.3.2",
|
||||
"resolved": "https://registry.npmjs.org/ag-charts-community/-/ag-charts-community-9.3.2.tgz",
|
||||
"integrity": "sha512-jw2llxTYzGAZ24m7eQsKS24BnJBhspZKsL03DbqH0wxLepbEcC3eeWICe+02TBQCbFVsWmSsYukjzQg3FkVWRw=="
|
||||
},
|
||||
"node_modules/ag-grid-community": {
|
||||
"version": "31.3.4",
|
||||
"resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-31.3.4.tgz",
|
||||
"integrity": "sha512-jOxQO86C6eLnk1GdP24HB6aqaouFzMWizgfUwNY5MnetiWzz9ZaAmOGSnW/XBvdjXvC5Fpk3gSbvVKKQ7h9kBw=="
|
||||
},
|
||||
"node_modules/ag-grid-enterprise": {
|
||||
"version": "31.3.4",
|
||||
"resolved": "https://registry.npmjs.org/ag-grid-enterprise/-/ag-grid-enterprise-31.3.4.tgz",
|
||||
"integrity": "sha512-kreGRsFjz41APXXchLcQFtginnrmIGQYH48p7ydz33x8v+aja06HS5yEM6NP8j+VVHX43LeXnsl5Y4TLRgSoeg==",
|
||||
"dependencies": {
|
||||
"ag-charts-community": "9.3.2",
|
||||
"ag-grid-community": "31.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/ag-grid-react": {
|
||||
"version": "31.3.4",
|
||||
"resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-31.3.4.tgz",
|
||||
"integrity": "sha512-WmPASHRFGSTxCMRStWG5bRtln0Ugsdqbb3+Y8sEyGHeLw4hXqfpqie3lT9kqCOl7wPWUjCpwmFdXzRnWPmyyeg==",
|
||||
"dependencies": {
|
||||
"ag-grid-community": "31.3.4",
|
||||
"prop-types": "^15.8.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.3.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.3.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
|
@ -3521,7 +3556,6 @@
|
|||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
|
@ -3877,6 +3911,16 @@
|
|||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prop-types": {
|
||||
"version": "15.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
|
||||
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
|
||||
"dependencies": {
|
||||
"loose-envify": "^1.4.0",
|
||||
"object-assign": "^4.1.1",
|
||||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"antd": "^5.21.2",
|
||||
"ag-grid-community": "^31.3.2",
|
||||
"ag-grid-enterprise": "^31.3.2",
|
||||
"ag-grid-react": "^31.3.2",
|
||||
"axios": "^1.7.7",
|
||||
"crypto-js": "^4.2.0",
|
||||
"dayjs": "^1.11.13",
|
||||
|
|
|
@ -2,9 +2,9 @@ import axios from 'axios';
|
|||
import AdminLayout from './layout';
|
||||
import { API_URL, currencyFormatter } from '@pos/base';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Card, Col, DatePicker, notification, Row, Table, Typography } from 'antd';
|
||||
import { Card, Col, DatePicker, notification, Row, Table } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import lodash, { filter } from 'lodash';
|
||||
import lodash from 'lodash';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
export default function Admin() {
|
||||
|
|
|
@ -13,9 +13,9 @@ interface AdminLayoutProps {
|
|||
|
||||
export default function AdminLayout(props: AdminLayoutProps) {
|
||||
const { children } = props;
|
||||
const [loadingLogout, setLoadingLogout] = useState(false);
|
||||
const [_loadingLogout, setLoadingLogout] = useState(false);
|
||||
const user = useRecoilValue(UserDataState);
|
||||
const initialName = getInitialName(user.name);
|
||||
const initialName = getInitialName(user?.name ?? '');
|
||||
|
||||
async function handleClickLogout() {
|
||||
setLoadingLogout(true);
|
||||
|
|
Loading…
Reference in New Issue