mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
测试自动构建
This commit is contained in:
1 parent
06f1b5bc62
commit
9cb68397b9
9 files changed
+124
-10
No files matched your search
@@ -0,0 +1,53 @@
|
|||||||
|
name: DockerBuild
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node_version: '13.x'
|
||||||
|
- run: |
|
||||||
|
yarn
|
||||||
|
yarn add webpack webpack-cli -D
|
||||||
|
yarn build
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: hydro
|
||||||
|
path: dist
|
||||||
|
- run: |
|
||||||
|
cd ui
|
||||||
|
yarn
|
||||||
|
yarn add webpack webpack-cli -D
|
||||||
|
yarn build
|
||||||
|
cd ..
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: .uibuild
|
||||||
|
path: .uibuild
|
||||||
|
- run: |
|
||||||
|
yarn add pkg -D
|
||||||
|
yarn run pack
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: Hydro_linux_amd64
|
||||||
|
path: hydro-linux
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: Hydro_macos_amd64
|
||||||
|
path: hydro-macos
|
||||||
|
- uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: Hydro_win_amd64.exe
|
||||||
|
path: hydro-win.exe
|
||||||
|
- uses: elgohr/Publish-Docker-Github-Action@master
|
||||||
|
with:
|
||||||
|
name: hydrooj/hydro:alpine
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
dockerfile: Dockerfile
|
||||||
@@ -6,3 +6,4 @@ ui/misc/.iconfont
|
|||||||
ui/static/locale
|
ui/static/locale
|
||||||
.webpackStats.json
|
.webpackStats.json
|
||||||
.cache
|
.cache
|
||||||
|
dist/
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
FROM mhart/alpine-node:slim-10
|
||||||
|
WORKDIR /app
|
||||||
|
ADD .uibuild dist locales templates /app/
|
||||||
|
RUN mkdir /config
|
||||||
|
VOLUME [ "/config" ]
|
||||||
|
EXPOSE 8888
|
||||||
|
CMD ["node", "dist/development.js"]
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
hydro:
|
||||||
|
image: hydrooj/hydro:latest
|
||||||
|
restart: always
|
||||||
|
links:
|
||||||
|
- mongo
|
||||||
|
volumes:
|
||||||
|
- ./config.yaml:/config/config.yaml
|
||||||
|
ports:
|
||||||
|
- 8888:8888
|
||||||
|
mongo:
|
||||||
|
image: mongo:latest
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./db:/data/db
|
||||||
+1
-1
@@ -5,7 +5,7 @@ const
|
|||||||
builtin = require('./model/builtin'),
|
builtin = require('./model/builtin'),
|
||||||
pwhash = require('./lib/pwhash'),
|
pwhash = require('./lib/pwhash'),
|
||||||
options = require('./options'),
|
options = require('./options'),
|
||||||
{ udoc } = require('../interfaces');
|
{ udoc } = require('./interface');
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
let mongourl = 'mongodb://';
|
let mongourl = 'mongodb://';
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
const { ObjectID } = require('bson');
|
|
||||||
exports.udoc = {
|
exports.udoc = {
|
||||||
_id: 0,
|
_id: 0,
|
||||||
mail: '',
|
mail: '',
|
||||||
|
|||||||
+8
-4
@@ -1,8 +1,9 @@
|
|||||||
const
|
const
|
||||||
yaml = require('js-yaml'),
|
|
||||||
{ defaultsDeep } = require('lodash'),
|
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
path = require('path');
|
os = require('os'),
|
||||||
|
path = require('path'),
|
||||||
|
yaml = require('js-yaml'),
|
||||||
|
{ defaultsDeep } = require('lodash');
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
db: {
|
db: {
|
||||||
@@ -46,7 +47,10 @@ let options = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let t = yaml.safeLoad(fs.readFileSync(path.resolve(process.cwd(), 'config.yaml')));
|
let f = path.resolve(process.cwd(), 'config.yaml');
|
||||||
|
if (!fs.existsSync(f)) f = path.resolve(os.homedir(), '.config', 'hydro', 'config.yaml');
|
||||||
|
if (!fs.existsSync(f)) f = path.resolve('/config/config.yaml');
|
||||||
|
let t = yaml.safeLoad(fs.readFileSync(f));
|
||||||
options = defaultsDeep(t, options);
|
options = defaultsDeep(t, options);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Cannot load config');
|
console.error('Cannot load config');
|
||||||
|
|||||||
+22
-4
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrofrontend",
|
"name": "hydro",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"main": "vj5/development.js",
|
"main": "hydro/development.js",
|
||||||
"repository": "https://github.com/masnn/vj5.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
"author": "masnn",
|
"author": "masnn",
|
||||||
"license": "MIT",
|
"license": "GPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.19.0",
|
"axios": "^0.19.0",
|
||||||
"bson": "^4.0.2",
|
"bson": "^4.0.2",
|
||||||
@@ -25,5 +25,23 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^6.6.0"
|
"eslint": "^6.6.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "webpack --config webpack.config.js",
|
||||||
|
"pack": "pkg .",
|
||||||
|
"lint": "eslint judger --fix"
|
||||||
|
},
|
||||||
|
"pkg": {
|
||||||
|
"scripts": [
|
||||||
|
"hydro/**.js"
|
||||||
|
],
|
||||||
|
"assets": [
|
||||||
|
".uibuild/*",
|
||||||
|
"locales/*",
|
||||||
|
"templates/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"judger": "hydro/development.js"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
const config = {
|
||||||
|
mode: 'production',
|
||||||
|
entry: {
|
||||||
|
development: './hydro/development.js',
|
||||||
|
install: './hydro/install.js',
|
||||||
|
uninstall: './hydro/uninstall.js'
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
filename: '[name].js',
|
||||||
|
path: __dirname + '/dist'
|
||||||
|
},
|
||||||
|
target: 'node',
|
||||||
|
module: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = config;
|
||||||
Reference in new issue
Block a user