mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 22:42:54 +00:00
feat: add backend
This commit is contained in:
155
.gitlab-ci.yml
Normal file
155
.gitlab-ci.yml
Normal file
@@ -0,0 +1,155 @@
|
||||
image: registry.gitlab.com/openstapps/projectmanagement/node
|
||||
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- publish
|
||||
|
||||
build:
|
||||
stage: build
|
||||
script:
|
||||
- npm install
|
||||
- npm run build
|
||||
artifacts:
|
||||
untracked: true
|
||||
paths:
|
||||
- node_modules/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
lint:
|
||||
stage: test
|
||||
dependencies:
|
||||
- build
|
||||
script:
|
||||
- npm run tslint
|
||||
tags:
|
||||
- docker
|
||||
|
||||
audit:
|
||||
stage: test
|
||||
dependencies:
|
||||
- build
|
||||
script:
|
||||
- npm audit
|
||||
tags:
|
||||
- docker
|
||||
|
||||
test:ci:
|
||||
stage: test
|
||||
dependencies:
|
||||
- build
|
||||
script:
|
||||
- .gitlab/ci/testCIScripts.sh
|
||||
tags:
|
||||
- docker
|
||||
|
||||
# Anchor templates for publishing the image in the docker registry
|
||||
# Automatically publishing for versions in tags (eg v1.0.0 as 1.0.0), master and develop
|
||||
# Manual publishing for all other branches
|
||||
.publish_template_auto: &publish_template_auto
|
||||
image: registry.gitlab.com/openstapps/projectmanagement/builder
|
||||
stage: publish
|
||||
dependencies:
|
||||
- build
|
||||
artifacts:
|
||||
untracked: true
|
||||
script:
|
||||
- export REGISTRY_BRANCH=$(.gitlab/ci/getRegistryBranch.sh "$CI_JOB_NAME")
|
||||
- export TAGNAME=$(.gitlab/ci/getRegistryTag.sh "$CI_BUILD_REF_NAME")
|
||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
||||
- docker build -t $CI_REGISTRY_IMAGE/$REGISTRY_BRANCH:$TAGNAME .
|
||||
- docker tag $CI_REGISTRY_IMAGE/$REGISTRY_BRANCH:$TAGNAME $CI_REGISTRY_IMAGE/$REGISTRY_BRANCH:latest
|
||||
- docker push $CI_REGISTRY_IMAGE/$REGISTRY_BRANCH:$TAGNAME
|
||||
- .gitlab/ci/pushAsLatestVersion.sh "$CI_BUILD_REF_NAME" "$CI_REGISTRY_IMAGE/$REGISTRY_BRANCH"
|
||||
only:
|
||||
- /(^v[0-9]+\.[0-9]+\.[0-9]+$|^master$|^develop$)/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
.publish_template_manual: &publish_template_manual
|
||||
image: registry.gitlab.com/openstapps/projectmanagement/builder
|
||||
stage: publish
|
||||
dependencies:
|
||||
- build
|
||||
artifacts:
|
||||
untracked: true
|
||||
script:
|
||||
- export REGISTRY_BRANCH=$(.gitlab/ci/getRegistryBranch.sh "$CI_JOB_NAME")
|
||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
|
||||
- docker build -t $CI_REGISTRY_IMAGE/$REGISTRY_BRANCH/$CI_COMMIT_REF_NAME:latest .
|
||||
- docker push $CI_REGISTRY_IMAGE/$REGISTRY_BRANCH/$CI_COMMIT_REF_NAME:latest
|
||||
except:
|
||||
- /(^v[0-9]+\.[0-9]+\.[0-9]+$|^master$|^develop$)/
|
||||
only:
|
||||
- branches
|
||||
when: manual
|
||||
tags:
|
||||
- docker
|
||||
|
||||
|
||||
# Anchor templates for custom build processes
|
||||
.build_template_b-tu: &build_template_b-tu
|
||||
# before_script:
|
||||
# - npm install "@stapps/b-tu-feedback@0.13.1"
|
||||
# - npm install "@stapps/b-tu-tickets@0.13.1"
|
||||
# - npm install "@stapps/b-tu-isbn-availability@0.13.1"
|
||||
tags:
|
||||
- docker
|
||||
|
||||
.build_template_f-u: &build_template_f-u
|
||||
# before_script:
|
||||
# - npm install "git+ssh://git@gitlab.tubit.tu-berlin.de:stapps-f-u/feedback.git#1.0.0"
|
||||
# - npm install "git+ssh://git@gitlab.tubit.tu-berlin.de:stapps-f-u/dish-feedback.git#1.0.0"
|
||||
tags:
|
||||
- docker
|
||||
|
||||
|
||||
# Jobs joining anchor templates with automatic publishing behaviour
|
||||
# ! The jobname must end with ":" followed by the name for the registry branch
|
||||
publish:default:
|
||||
<<: *publish_template_auto
|
||||
|
||||
publish:ab-fh:
|
||||
<<: *publish_template_auto
|
||||
|
||||
publish:b-tu:
|
||||
<<: *publish_template_auto
|
||||
<<: *build_template_b-tu
|
||||
|
||||
publish:f-u:
|
||||
<<: *publish_template_auto
|
||||
<<: *build_template_f-u
|
||||
|
||||
publish:gi-fh:
|
||||
<<: *publish_template_auto
|
||||
|
||||
publish:gi-u:
|
||||
<<: *publish_template_auto
|
||||
|
||||
publish:ks-ug:
|
||||
<<: *publish_template_auto
|
||||
|
||||
# Jobs joining anchor templates with manual publishing behaviour
|
||||
custom:default:
|
||||
<<: *publish_template_manual
|
||||
|
||||
custom:ab-fh:
|
||||
<<: *publish_template_manual
|
||||
|
||||
custom:b-tu:
|
||||
<<: *publish_template_manual
|
||||
<<: *build_template_b-tu
|
||||
|
||||
custom:f-u:
|
||||
<<: *publish_template_manual
|
||||
<<: *build_template_f-u
|
||||
|
||||
custom:gi-fh:
|
||||
<<: *publish_template_manual
|
||||
|
||||
custom:gi-u:
|
||||
<<: *publish_template_manual
|
||||
|
||||
custom:ks-ug:
|
||||
<<: *publish_template_manual
|
||||
Reference in New Issue
Block a user