Commit caaa81b0 authored by nanahira's avatar nanahira

rework

parent 8b6e20ac
Pipeline #4917 failed with stages
in 19 seconds
......@@ -111,3 +111,5 @@ dist
Dockerfile
.gitlab-ci.yml
/config.yaml
/config-*.yaml
.idea
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
......@@ -104,5 +104,8 @@ dist
.tern-port
/build
/dist
/output
/config.yaml
/config-*.yaml
.idea
stages:
- build
- combine
- deploy
variables:
GIT_DEPTH: "1"
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_TEST_ARM_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-arm
CONTAINER_TEST_X86_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-x86
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build:
build-x86:
stage: build
tags:
- docker
variables:
TARGET_IMAGE: $CONTAINER_TEST_X86_IMAGE
script:
- docker build --pull -t $TARGET_IMAGE .
- docker push $TARGET_IMAGE
build-arm:
stage: build
tags:
- docker-arm
variables:
TARGET_IMAGE: $CONTAINER_TEST_ARM_IMAGE
script:
- docker build --pull -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
- docker build --pull -t $TARGET_IMAGE .
- docker push $TARGET_IMAGE
combine:
stage: combine
tags:
- docker
variables:
SOURCE_IMAGE_1: $CONTAINER_TEST_X86_IMAGE
SOURCE_IMAGE_2: $CONTAINER_TEST_ARM_IMAGE
TARGET_IMAGE: $CONTAINER_TEST_IMAGE
script:
- docker pull $SOURCE_IMAGE_1
- docker pull $SOURCE_IMAGE_2
- docker manifest create $TARGET_IMAGE --amend $SOURCE_IMAGE_1 --amend $SOURCE_IMAGE_2
- docker manifest push $TARGET_IMAGE
deploy_latest:
stage: deploy
tags:
- docker
variables:
SOURCE_IMAGE: $CONTAINER_TEST_IMAGE
TARGET_IMAGE: $CONTAINER_RELEASE_IMAGE
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
- docker push $CONTAINER_RELEASE_IMAGE
- docker pull $SOURCE_IMAGE
- docker tag $SOURCE_IMAGE $TARGET_IMAGE
- docker push $TARGET_IMAGE
only:
- master
......@@ -34,10 +66,11 @@ deploy_tag:
tags:
- docker
variables:
CONTAINER_TAG_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
SOURCE_IMAGE: $CONTAINER_TEST_IMAGE
TARGET_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker tag $CONTAINER_TEST_IMAGE $CONTAINER_TAG_IMAGE
- docker push $CONTAINER_TAG_IMAGE
- docker pull $SOURCE_IMAGE
- docker tag $SOURCE_IMAGE $TARGET_IMAGE
- docker push $TARGET_IMAGE
only:
- tags
/install-npm.sh
.git*
/output
/dest
/config.yaml
/config-*.yaml
.idea
.dockerignore
Dockerfile
/src
.eslintrc.js
.prettierrc
webpack.config.js
tsconfig.json
{
"singleQuote": true,
"trailingComma": "all"
}
\ No newline at end of file
FROM node:buster-slim
FROM node:bullseye-slim
LABEL Author="Nanahira <nanahira@momobako.com>"
RUN apt update && apt -y install python3 build-essential && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /usr/src/app
COPY ./package*.json ./
......
This diff is collapsed.
#!/bin/bash
npm install --save \
lodash
npm install --save-dev \
@types/node \
@types/lodash \
typescript \
'@typescript-eslint/eslint-plugin@^4.28.2' \
'@typescript-eslint/parser@^4.28.2 '\
'eslint@^7.30.0' \
'eslint-config-prettier@^8.3.0' \
'eslint-plugin-prettier@^3.4.0' \
prettier
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,8 +4,8 @@
"description": "Check CDN nodes and update AliDNS records.",
"main": "build/run.js",
"scripts": {
"build": "./node_modules/.bin/tsc",
"start": "node build/run.js"
"build": "tsc",
"start": "node dist/run.js"
},
"repository": {
"type": "git",
......@@ -16,15 +16,24 @@
"dependencies": {
"@alicloud/pop-core": "^1.7.9",
"@types/cron": "^1.7.2",
"@types/node": "^14.0.14",
"@types/q": "^1.5.4",
"@types/underscore": "^1.10.3",
"@types/yaml": "^1.9.7",
"axios": "^0.19.2",
"delay": "^5.0.0",
"icmp": "^1.4.0",
"lodash": "^4.17.21",
"q": "^1.5.1",
"typescript": "^3.9.6",
"underscore": "^1.10.2",
"yaml": "^1.10.0"
},
"devDependencies": {
"@types/lodash": "^4.14.172",
"@types/node": "^16.7.1",
"@typescript-eslint/eslint-plugin": "^4.29.2",
"@typescript-eslint/parser": "^4.29.2",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1",
"prettier": "^2.3.2",
"typescript": "^4.3.5"
}
}
This diff is collapsed.
{
"compilerOptions": {
"outDir": "build",
"outDir": "dist",
"module": "commonjs",
"target": "esnext",
"esModuleInterop": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"sourceMap": true
},
"compileOnSave": true,
"allowJs": true,
"include": [
"*.ts"
"*.ts",
"src/**/*.ts",
"test/**/*.ts"
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment