mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-11 12:12:55 +00:00
ci: add real CI configuration
This commit is contained in:
@@ -1,13 +1,21 @@
|
|||||||
image: registry.gitlab.com/openstapps/projectmanagement/node
|
image: registry.gitlab.com/openstapps/projectmanagement/node
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
- build
|
||||||
|
- audit
|
||||||
|
- publish
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
cache:
|
before_script:
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
- npm ci
|
||||||
paths:
|
|
||||||
- node_modules
|
npm build:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- npm run build
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- lib
|
||||||
|
|
||||||
audit:
|
audit:
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
@@ -15,14 +23,38 @@ audit:
|
|||||||
- schedules
|
- schedules
|
||||||
script:
|
script:
|
||||||
- npm audit
|
- npm audit
|
||||||
stage: test
|
stage: audit
|
||||||
|
|
||||||
scheduled-audit:
|
scheduled-audit:
|
||||||
only:
|
only:
|
||||||
- schedules
|
- schedules
|
||||||
script:
|
script:
|
||||||
- npm audit
|
- npm audit --audit-level=high
|
||||||
stage: test
|
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:
|
pages:
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|||||||
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM registry.gitlab.com/openstapps/projectmanagement/node
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
ENTRYPOINT ["node", "lib/cli.js"]
|
||||||
|
|
||||||
|
ADD . /app
|
||||||
@@ -4,7 +4,10 @@
|
|||||||
"description": "Minimal Plugin",
|
"description": "Minimal Plugin",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"author": "Wieland Schöbl",
|
"author": "Wieland Schöbl",
|
||||||
"contributors": [],
|
"contributors": [
|
||||||
|
"Jovan Krunić <jovan.krunic@gmail.com>",
|
||||||
|
"Rainer Killinger <mail-openstapps@killinger.co>"
|
||||||
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run tslint && npm run compile",
|
"build": "npm run tslint && npm run compile",
|
||||||
"compile": "rimraf lib && tsc && prepend lib/cli.js '#!/usr/bin/env node\n'",
|
"compile": "rimraf lib && tsc && prepend lib/cli.js '#!/usr/bin/env node\n'",
|
||||||
@@ -12,7 +15,7 @@
|
|||||||
"check-configuration": "openstapps-configuration",
|
"check-configuration": "openstapps-configuration",
|
||||||
"documentation": "typedoc --includeVersion --out docs src",
|
"documentation": "typedoc --includeVersion --out docs src",
|
||||||
"start": "node lib/cli.js",
|
"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",
|
"prepublishOnly": "npm ci && npm run build",
|
||||||
"postversion": "npm run changelog",
|
"postversion": "npm run changelog",
|
||||||
"preversion": "npm run prepublishOnly",
|
"preversion": "npm run prepublishOnly",
|
||||||
|
|||||||
Reference in New Issue
Block a user