1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

improve gitlab-ci.yml

This commit is contained in:
Steffen Vogel 2016-10-14 01:33:07 -04:00
parent 5c02966c2a
commit d8271f82f8
3 changed files with 39 additions and 26 deletions

View file

@ -1,5 +1,3 @@
image: acs-public:5000/villas:latest
variables:
# This registry is a linked docker container running on the same host
# and configured in gitlab-ci-runner config.toml as a linked service
@ -12,17 +10,6 @@ stages:
- build
- test
- deploy
# Templates
##############################################################################
.ssh: &ssh
before_script:
- mkdir -p $HOME/.ssh
- echo -e "$SSH_SECRET_KEY" > $HOME/.ssh/id_rsa
- chmod 600 $HOME/.ssh/id_rsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > $HOME/.ssh/config
- ssh-keyscan -H $DEPLOY_HOST >> $HOME/.ssh/known_hosts
# Stage: prepare
##############################################################################
@ -47,11 +34,12 @@ docker-image:
build:
stage: build
script:
- make
- make install
artifacts:
name: "${CI_PROJECT_NAME}-${CI_BUILD_REF}"
paths:
- $PREFIX
- build/release/
image: $DOCKER_REGISTRY/$DOCKER_IMAGE
tags:
- docker
@ -60,10 +48,10 @@ docs:
artifacts:
name: "${CI_PROJECT_NAME}-doc-${CI_BUILD_REF}"
paths:
- doc/html/
- doc/latex/
- build/release/doc/
script:
- make doc
image: $DOCKER_REGISTRY/$DOCKER_IMAGE
tags:
- docker
@ -71,11 +59,28 @@ docs:
# Stage: test
##############################################################################
unit:
coverage:
stage: test
script:
- build/release/villas-node
- make coverage COVERAGE=1
artifacts:
name: "${CI_PROJECT_NAME}-coverage-${CI_BUILD_REF}"
paths:
- build/release-coverage/coverage/
- build/release-coverage/coverage.txt
- build/release-coverage/coverage.xml
image: $DOCKER_REGISTRY/$DOCKER_IMAGE
tags:
- docker
unit:
stage: test
dependencies:
- build
script:
- make tests
- build/release/testsuite
image: $DOCKER_REGISTRY/$DOCKER_IMAGE
tags:
- docker
@ -84,7 +89,8 @@ integration:
dependencies:
- build
script:
- "true"
- build/release/villas-node
image: $DOCKER_REGISTRY/$DOCKER_IMAGE
tags:
- docker
@ -94,14 +100,13 @@ integration:
deliver:
stage: deploy
<<: *ssh
script:
- '[ "$CI_BUILD_REF_NAME" == "develop" ] && scp -pr web/landing.html $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/index.html'
- scp -pr doc/html/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/doc/$CI_BUILD_REF_NAME/
- rsync web/landing.html $DEPLOY_PATH/index.html
- rsync -r build/doc/html/ $DEPLOY_PATH/doc/$CI_BUILD_REF_NAME/
only:
- develop
dependencies:
- docs
tags:
- docker
- villas-deploy

View file

@ -101,8 +101,8 @@ docker:
docker build -t villas .
docker run -it -p 80:80 -p 443:443 -p 1234:1234 --privileged --cap-add sys_nic --ulimit memlock=1073741824 --security-opt seccomp:unconfined -v $(PWD):/villas villas
doc:
( cat Doxyfile ; echo "OUTPUT_DIRECTORY=$(BUILD)/doc/" ) | doxygen -
doc: | $(BUILDDIR)/doc/
( cat Doxyfile ; echo "OUTPUT_DIRECTORY=$(BUILDDIR)/doc/" ) | doxygen -
# Create non-existent directories
%/:

View file

@ -17,32 +17,40 @@ LIB_LDLIBS = $(LDLIBS) -ldl -lrt
######## Node types ########
# Enable Socket node type when libnl3 is available
ifndef WITHOUT_SOCKET
ifeq ($(shell pkg-config libnl-route-3.0; echo $$?),0)
LIB_SRCS += $(addprefix lib/nodes/, socket.c)
LIB_SRCS += $(addprefix lib/kernel/, nl.c tc.c if.c)
LIB_SRCS += $(addprefix lib/, msg.c)
LIB_PKGS += libnl-route-3.0
endif
endif
# Enable VILLASfpga support when libxil is available
ifndef WITHOUT_FPGA
ifeq ($(shell pkg-config libxil; echo $$?),0)
LIB_SRCS += $(addprefix lib/nodes/, fpga.c)
LIB_SRCS += $(addprefix lib/kernel/, pci.c vfio.c)
LIB_SRCS += $(wildcard lib/fpga/*.c)
PKGS += libxil
endif
endif
# Enable NGSI support
ifndef WITHOUT_NGSI
ifeq ($(shell pkg-config libcurl jansson; echo $$?),0)
LIB_SRCS += lib/nodes/ngsi.c
LIB_PKGS += libcurl jansson
endif
endif
# Enable WebSocket support
ifndef WITHOUT_WEBSOCKETS
ifeq ($(shell pkg-config libwebsockets jansson; echo $$?),0)
LIB_SRCS += lib/nodes/websocket.c
LIB_PKGS += libwebsockets jansson
endif
endif
# Enable OPAL-RT Asynchronous Process support (will result in 32bit binary!!!)
ifdef WITH_OPAL