Commit 0192d7f1 Harvey

no message

0 个父辈
# OSX
#
.DS_Store
.env
package-lock.json
config_production.js
config_production.json
config.txt
*.lock
# Xcode
#
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
# Android/IntelliJ
#
.idea
.gradle
local.properties
*.iml
config_production.js
config_production.ts
*.js.map
# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# BUCK
buck-out/
\.buckd/
*.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "index",
"program": "${workspaceRoot}/src/index.ts",
"cwd": "${workspaceRoot}",
"outFiles": [
"${workspaceRoot}/build/index.js"
]
}
]
}
\ No newline at end of file
FROM node:22-alpine
# RUN apk add --no-cache tzdata && \
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && \
# apk del tzdata
ENV TZ="Asia/Shanghai"
RUN mkdir -p /app
WORKDIR /app
COPY ./ /app/tmp
RUN cp /app/tmp/package.json /app/package.json && \
npm install --production && \
cp -r /app/tmp/build /app/build && \
cp -r /app/tmp/config /app/config && \
#cp -r /app/tmp/lib/uWebSockets.js /app/node_modules && \
rm -rf /app/tmp
CMD [ "node","build/index.js"]
\ No newline at end of file
test
\ No newline at end of file
#!/bin/bash
# 使用说明
# 1. 同目录下新建 config.txt 以保存腾讯云容器镜像访问密码,本文件不要提交到 git
# 密码和腾讯云账号ID在 https://console.cloud.tencent.com/tke2/registry/user?rid=1
# 2. 修改以下三行参数
namespace='ydniu' #腾讯云镜像仓库命名空间
imageName='service-scoket' #镜像名称
dockerfilePash='./Dockerfile' #指定当前根目录下构建的Dockerfile文件 例如: ./Dockerfile
# 3. 执行构建推送镜像命令
# sh 文件名称.sh 例如: sh h5-graphiql.sh 版本号默认为 年月日时分秒
# sh 文件名称.sh 版本号 例如: sh h5-graphiql.sh v1 版本号例如: 20210902v1
# -----------------------------------------------
cloudId='line1'
passWord='line2'
version=`date '+%Y%m%d'` #镜像版本号, 默认当前年月日+ 参数
if [ ! -n "$1" ] ;then
version=`date '+%Y%m%d%H%M%S'`
else
version+=$1
fi
imageId=ccr.ccs.tencentyun.com/$namespace/$imageName:$version
echo "读取配置"
cat config.txt | while read line1 line2;
do
cloudId=$line1 #镜像仓库账号ID
passWord=$line2 #镜像仓库登陆密码
done
echo "1. 开始拉取最新代码!"
npm config set registry https://registry.npm.taobao.org
git pull
echo "2. 准备构建镜像..."
docker build -f $dockerfilePash --platform linux/amd64 -t $imageId .
echo "3. 构建成功!"
echo "4. 准备登录到云仓库..."
docker login --username=$cloudId --password=$passWord ccr.ccs.tencentyun.com
echo "5. 准备上传镜像到云仓库..."
docker push $imageId
echo "6. 上传成功!"
echo "7. 删除本地原有镜像..."
docker rmi $imageId
echo "8. 一切OK..."
exit;
\ No newline at end of file
var config;
try {
try {
config = JSON.parse(process.env.CONFIG);
}
catch (e) {
config = require('../config/config.js');
}
}
catch (e) {
console.log(e);
}
if (!config) {
console.log('配置获取失败');
process.exit();
}
console.log(config);
//# sourceMappingURL=index.js.map
\ No newline at end of file
var config = {
// 执行器AppName,在调度中心配置执行器时使用
XXL_JOB_EXECUTOR_KEY: "executor-job-ydn-zq",
// 调度中心地址
XXL_JOB_SCHEDULE_CENTER_URL: "http://xxljob.ydniu.com/xxl-job-admin",
// 调度中心设置的请求令牌,调度中心和执行器都会进行校验,双方AccessToken匹配才允许通讯
XXL_JOB_ACCESS_TOKEN: "default_token",
// 任务执行日志的存储路径
XXL_JOB_JOB_LOG_PATH: "logs/job",
// 执行器运行日志开关(非任务执行日志),默认关闭
XXL_JOB_DEBUG_LOG: true,
};
module.exports = config;
{
"name": "job-ydn-zq",
"version": "1.0.0",
"description": "",
"main": "build/index.js",
"scripts": {
"start": "node ./build/index.js ",
"watch": "tsc -w",
"compile": "tsc"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^5.1.0"
},
"devDependencies": {
"@types/node": "^10.17.60"
}
}
var config;
try {
try {
config = JSON.parse(process.env.CONFIG)
} catch (e) { config = require('../config/config.js') }
} catch (e) {
console.log(e)
}
if (!config) {
console.log('配置获取失败')
process.exit()
}
console.log(config)
\ No newline at end of file
{
"compilerOptions": {
"target": "esnext",
"module": "commonjs",
"outDir": "build/",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"sourceMap": true
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
\ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!