Skip to content
Snippets Groups Projects
Commit bb2cd389 authored by ko_oler's avatar ko_oler
Browse files

fix .gitlab-ci.yml

parent fc3c0d85
No related branches found
No related tags found
1 merge request!1Добавлена генерация файлов для frontend в Makefile и публикацию npm-пакета
Pipeline #19073 failed with stage
in 23 seconds
......@@ -9,8 +9,6 @@ publish_npm:
- apk add --update make
- apk add --update yarn
- apk add --update jq
- apk add --update rsync
- apk add --update protobuf-dev
- apk add --update protobuf-dev
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
......@@ -19,21 +17,10 @@ publish_npm:
script:
- npm install -g typescript@4.7.4
- npm install -g ts-proto@1.115.5
- pwd
- cd ./config
- mkdir clients
- make proto
- ls
- cd ./config
- rsync -a --prune-empty-dirs ../clients ./
- |
if [[ ! -f .npmrc ]]; then
echo 'No .npmrc found! Creating one now. Please review the following link for more information: https://docs.gitlab.com/ee/user/packages/npm_registry/index.html#project-level-npm-endpoint-1'
{
echo "@perxis-js:registry=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/"
echo "${CI_API_V4_URL#http*:}/packages/npm/:_authToken=\${CI_JOB_TOKEN}"
echo "${CI_API_V4_URL#http*:}/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=\${CI_JOB_TOKEN}"
} >> .npmrc
fi
- make proto
- NPM_PACKAGE_VERSION=$(node -p "require('./package.json').version")
- yarn pub
- echo "Successfully published version ${NPM_PACKAGE_VERSION} to GitLab's NPM registry"
......
......@@ -2,7 +2,7 @@
SHELL = /bin/bash -o pipefail
PROTODIR=perxis-proto/proto
DSTDIR=clients
DSTDIR=config/clients
ALLPROTO?=$(shell find $(PROTODIR) -name '*.proto' )
PROTOFILES= $(filter-out proto/status/status.proto, $(ALLPROTO))
......
......@@ -54,30 +54,29 @@ generate_index() {
}
echo "---deleting existing *.d.ts, *.d.ts.map, *.js, *.js.map files"
find ./clients/*/**/ -path '*.d.ts' -delete
find ./clients/*/**/ -path '*.d.ts.map' -delete
find ./clients/*/**/ -path '*.js' -delete
find ./clients/*/**/ -path '*.js.map' -delete
find ./clients/*/**/ -path '*.ts.bak' -delete
find ./clients -path '*.d.ts' -delete
find ./clients -path '*.d.ts.map' -delete
find ./clients -path '*.js' -delete
find ./clients -path '*.js.map' -delete
find ./clients -path '*.ts.bak' -delete
find ./config/clients/*/**/ -path '*.d.ts' -delete
find ./config/clients/*/**/ -path '*.d.ts.map' -delete
find ./config/clients/*/**/ -path '*.js' -delete
find ./config/clients/*/**/ -path '*.js.map' -delete
find ./config/clients/*/**/ -path '*.ts.bak' -delete
find ./config/clients -path '*.d.ts' -delete
find ./config/clients -path '*.d.ts.map' -delete
find ./config/clients -path '*.js' -delete
find ./config/clients -path '*.js.map' -delete
find ./config/clients -path '*.ts.bak' -delete
echo "---generating index.ts files"
ts_files=$(find ./clients/**/ -name '*.ts')
ts_files=$(find ./config/clients/**/ -name '*.ts')
ts_files_array=($ts_files)
generate_index "${ts_files_array[@]}"
echo "---generating *.d.ts, *.d.ts.map, *.js, *.js.map files"
npm i protobufjs@6.11.3
tsc --project ./config --declaration --declarationMap --sourceMap --rootDir ./clients
tsc --project ./config --declaration --declarationMap --sourceMap --rootDir ./config/clients
echo "---deleting created tmp files"
npm uninstall protobufjs@6.11.3
find ./clients -name 'index.ts' -delete
find ./clients/*/** -name 'index.ts' -delete
find ./ -maxdepth 1 -name '*.json' -delete
find ./config/clients -name 'index.ts' -delete
find ./config/clients/*/** -name 'index.ts' -delete
echo "---process finished"
\ No newline at end of file
......@@ -98,6 +98,6 @@
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["../../clients/**/*"],
"exclude": ["../../config/**/*"]
"include": ["./clients/**/*"],
"exclude": ["../"]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment