Compare commits
9 Commits
1.0.0-prod
...
main
Author | SHA1 | Date |
---|---|---|
|
16e2c8fc09 | |
|
65b3dd7cae | |
|
8f5fff0b91 | |
|
e9152f11f4 | |
|
b37dff48e3 | |
|
9628070fcd | |
|
51130437d7 | |
|
4c6c52d59b | |
|
c77059971c |
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.*
|
13
Dockerfile
13
Dockerfile
|
@ -1,4 +1,4 @@
|
|||
FROM node:20-alpine as build
|
||||
FROM node:18-alpine as build
|
||||
|
||||
ARG env_target
|
||||
ARG release_version
|
||||
|
@ -13,13 +13,8 @@ RUN echo -e "\n" >> /app/.env
|
|||
RUN echo -e "APP_VERSION=${release_version}" >> /app/.env
|
||||
|
||||
RUN npm install
|
||||
|
||||
RUN npm run 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;
|
||||
}
|
||||
|
||||
}
|
|
@ -15,7 +15,7 @@ export default function AdminLayout(props: AdminLayoutProps) {
|
|||
const { children } = props;
|
||||
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