Skip to content

Commit

Permalink
refactor: migrate to react
Browse files Browse the repository at this point in the history
  • Loading branch information
VaalaCat committed Jan 18, 2024
1 parent 2334d1e commit efdeaad
Show file tree
Hide file tree
Showing 82 changed files with 6,367 additions and 8,051 deletions.
67 changes: 29 additions & 38 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,33 @@ type: docker
name: default

steps:
- name: npm install and build
image: node:17
commands:
- |
npm install --registry https://registry.npm.taobao.org && npm run build
- name: go get and build
image: golang:1.18.1
commands:
- |
mkdir -p artifacts
CGO_ENABLED=0 GOPROXY=https://mirrors.aliyun.com/goproxy,direct go build -o artifacts ./...
- name: transfer file to server
image: appleboy/drone-scp
settings:
host:
from_secret: SSH_TARGET
username:
from_secret: SSH_USERNAME
port: 22
key:
from_secret: SSH_PRIVATE_KEY
target:
from_secret: DEPLOY_PATH
source: dist/*
rm: true

- name: deploy
image: appleboy/drone-ssh
environment:
DEPLOY_PATH:
from_secret: DEPLOY_PATH
settings:
host:
from_secret: SSH_TARGET
username:
from_secret: SSH_USERNAME
port: 22
key:
from_secret: SSH_PRIVATE_KEY
envs: [DEPLOY_PATH]
script:
- mv $${DEPLOY_PATH}/dist/* $${DEPLOY_PATH}/ && rm -rf $${DEPLOY_PATH}/dist
- cd $${DEPLOY_PATH}/../ && docker-compose restart

- name: deploy
image: python:3.6
environment:
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
SSH_TARGET:
from_secret: SSH_TARGET
SSH_USERNAME:
from_secret: SSH_USERNAME
DEPLOY_PATH:
from_secret: DEPLOY_PATH
commands:
- |
which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
mkdir -p ~/.ssh
chmod 700 ~/.ssh
ssh-keyscan $SSH_TARGET >> ~/.ssh/known_hosts
ssh $SSH_USERNAME@$SSH_TARGET "cd $DEPLOY_PATH/../ && docker-compose down"
ssh $SSH_USERNAME@$SSH_TARGET "rm -rf $DEPLOY_PATH/movie-sync-server"
scp artifacts/movie-sync-server $SSH_USERNAME@$SSH_TARGET:$DEPLOY_PATH/
ssh $SSH_USERNAME@$SSH_TARGET "cd $DEPLOY_PATH/ && chmod +x movie-sync-server && cd .. && docker-compose up -d"
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
50 changes: 32 additions & 18 deletions .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
.DS_Store
node_modules
/dist
dist*
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# local env files
.env.local
.env.*.local
# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# Log files
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

*__debug*
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}",
}
]
}
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM alpine

COPY movie-sync-server-linux-amd64 /app/bin/movie-sync-server-linux-amd64

COPY dist /app/asset

WORKDIR /app/bin

CMD [ "/app/bin/movie-sync-server-linux-amd64" ]
Loading

0 comments on commit efdeaad

Please sign in to comment.