From 7e23941d0b1ca4023f8ac5259b123d2fe39b20e7 Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Mon, 23 Nov 2020 18:45:04 +0100 Subject: [PATCH 1/3] refactor: adhere to configuartion suggestions --- package.json | 8 +++++--- src/cli.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ed5c301b..b8f8d3d9 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,17 @@ "description": "Minimal Plugin", "license": "GPL-3.0-only", "author": "Wieland Schöbl", - "contributors": [], + "contributors": [ + "Jovan Krunić " + ], "scripts": { - "build": "npm run tslint && npm run compile && npm run documentation", + "build": "npm run tslint && npm run compile", "compile": "rimraf lib && tsc && prepend lib/cli.js '#!/usr/bin/env node\n'", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md && git commit -m 'docs: update changelog'", "check-configuration": "openstapps-configuration", "documentation": "typedoc --includeDeclarations --excludeExternals --mode modules --out docs src", "start": "node lib/cli.js", - "tslint": "tslint 'src/**/*.ts'", + "tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'", "prepublishOnly": "npm ci && npm run build", "postversion": "npm run changelog", "preversion": "npm run prepublishOnly", diff --git a/src/cli.ts b/src/cli.ts index 19871a28..37a2e839 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 StApps + * Copyright (C) 2019-2020 StApps * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation, version 3. From c3269294158f3c8fd5c929498b96f5303fceb36f Mon Sep 17 00:00:00 2001 From: Rainer Killinger Date: Mon, 23 Nov 2020 18:54:59 +0100 Subject: [PATCH 2/3] cI: update and extend gitlab-ci.yml --- .gitlab-ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++------- Dockerfile | 6 ++++++ 2 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 85411f2c..f48492f9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,22 @@ image: registry.gitlab.com/openstapps/projectmanagement/node stages: + - build - test + - audit + - publish - deploy -cache: - key: ${CI_COMMIT_REF_SLUG} - paths: - - node_modules +before_script: + - npm ci + +npm build: + stage: build + script: + - npm run build + artifacts: + paths: + - lib audit: allow_failure: true @@ -15,14 +24,38 @@ audit: - schedules script: - npm audit - stage: test + stage: audit scheduled-audit: only: - schedules script: - - npm audit - stage: test + - npm audit --audit-level=high + stage: audit + +docker image: + image: registry.gitlab.com/openstapps/projectmanagement/builder:latest + dependencies: + - npm build + stage: publish + variables: + DOCKER_DRIVER: overlay2 + services: + - docker:dind + script: + - export CORE_VERSION=$(openstapps-projectmanagement get-used-version @openstapps/core) + - export VERSION=$(echo -n "$CI_BUILD_REF_NAME" | cut -c 2-) + - export IMAGETAG_BASE=$CI_REGISTRY_IMAGE + - export IMAGETAG_CORE_VERSION=$IMAGETAG_BASE:core-$CORE_VERSION + - export IMAGETAG_VERSION=$IMAGETAG_BASE:$VERSION + - export IMAGETAG_LATEST=$IMAGETAG_BASE:latest + - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY + - docker build -t $IMAGETAG_LATEST -t $IMAGETAG_VERSION -t $IMAGETAG_CORE_VERSION . + - docker push $IMAGETAG_BASE + only: + - /^v[0-9]+\.[0-9]+\.[0-9]+$/ + except: + - branches pages: artifacts: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..576b6a64 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM registry.gitlab.com/openstapps/projectmanagement/node + +WORKDIR /app +ENTRYPOINT ["node", "lib/cli.js"] + +ADD . /app From 0bc95ca4eddcc23d963ee1876ddecc5d0732278b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Kruni=C4=87?= Date: Mon, 12 Apr 2021 11:13:31 +0200 Subject: [PATCH 3/3] build: update node types (10 -> 14) --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0d67f66..258b0172 100644 --- a/package-lock.json +++ b/package-lock.json @@ -552,9 +552,9 @@ "integrity": "sha512-AVBOcLJenbpCIJcHUvGWj+YMlaiwcFlGK1YEH2mePXkB5B/vQLrFkHG9IpBH71mXnkbibc4V8Nnn1wJSxcgCEA==" }, "@types/node": { - "version": "10.17.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.46.tgz", - "integrity": "sha512-Tice8a+sJtlP9C1EUo0DYyjq52T37b3LexVu3p871+kfIBIN+OQ7PKPei1oF3MgF39olEpUfxaLtD+QFc1k69Q==", + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", "dev": true }, "@types/nodemailer": { diff --git a/package.json b/package.json index b8f8d3d9..5a043849 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@openstapps/configuration": "0.25.0", - "@types/node": "10.17.46", + "@types/node": "14.14.37", "@types/express": "4.17.8", "conventional-changelog-cli": "2.1.1", "prepend-file-cli": "1.0.6",