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

Added CI file for Gitlab

This commit is contained in:
Steffen Vogel 2016-09-07 06:23:47 +02:00
parent 767a59c091
commit 1ccc0a1eb2
4 changed files with 95 additions and 34 deletions

86
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,86 @@
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
DOCKER_REGISTRY: acs-public:5000
DOCKER_IMAGE: villas:latest
stages:
- prepare
- dependencies
- build
- deploy
# Build docker image which is used to build & test VILLASnode
docker-image:
stage: prepare
image: stackbrew/docker:1.8.2
before_script:
- docker info
script:
- docker build -t $DOCKER_REGISTRY/$DOCKER_IMAGE .
- docker push $DOCKER_REGISTRY/$DOCKER_IMAGE
libwebsockets:
stage: dependencies
script:
- make -C thirdparty libwebsockets-2.0.2
artifacts:
paths:
- thirdparty/libwebsockets-2.0.2/
libxil:
stage: dependencies
script:
- make -C thirdparty/xilinx
artifacts:
paths:
- thirdparty/xilinx/libxil.so
build:
stage: build
variables:
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig/
before_script:
- make -C thirdparty/libwebsockets-2.0.2/build install
- make -C thirdparty/xilinx install
script:
- make
artifacts:
name: "${CI_PROJECT_NAME}-${CI_BUILD_REF}"
paths:
- libvillas.so
- fpga
- node
- pipe
- signal
- test
docs:
stage: build
artifacts:
name: "${CI_PROJECT_NAME}-doc-${CI_BUILD_REF}"
paths:
- doc/html/
script:
- make doc
.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_DOC_HOST >> $HOME/.ssh/known_hosts
deploy-docs:
stage: deploy
<<: *ssh
script:
- scp -vpr doc/html/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/doc/$CI_BUILD_REF_NAME/
only:
- develop
dependencies:
- docs

View file

@ -1,29 +0,0 @@
language: c
compiler: gcc
addons:
apt:
packages:
- zlib1g-dev
- libbind4-dev
- dia
- graphviz
- texlive-font-utils
cache:
apt: true
directories:
- thirdparty
install:
- if ! [ -d thirdparty/usr/ ]; then
make dependencies;
fi
script:
- make build
after_success:
- echo -e "Host ${DEPLOY_HOST}\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- make doc
- make deploy

View file

@ -5,7 +5,7 @@
#
# @copyright 2014-2015, Institute for Automation of Complex Power Systems, EONERC
# This file is part of VILLASnode. All Rights Reserved. Proprietary and confidential.
# Unauthorized copying of this file, via any medium is strictly prohibited.
# Unauthorized copying of this file, via any medium is strictly prohibited.
###################################################################################
FROM stv0g/dotfiles
@ -71,4 +71,4 @@ WORKDIR /villas
# Compile
#RUN make -C /villas
ENTRYPOINT /bin/bash
ENTRYPOINT /bin/bash

View file

@ -22,8 +22,6 @@ PREFIX ?= /usr/local
# Default debug level
V ?= 2
GIT_REV = $(shell git rev-parse --short HEAD)
# Compiler and linker flags
LDLIBS = -pthread -lm -lvillas
@ -35,9 +33,15 @@ LIB_LDLIBS = -ldl -lrt
CFLAGS += -std=c11 -Iinclude -Iinclude/villas -I. -MMD -mcx16
CFLAGS += -Wall -fdiagnostics-color=auto
CFLAGS += -D_GIT_REV='"$(GIT_REV)"' -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1 -DV=$(V)
CFLAGS += -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1 -DV=$(V)
LDFLAGS += -pthread -L. -Wl,-rpath,'$$ORIGIN'
ifdef CI
CFLAGS += -D_GIT_REV='"${CI_BUILD_REF:0:7}~ci"'
else ifdef GIT
CFLAGS += -D_GIT_REV='"$(shell git rev-parse --short HEAD)"'
endif
# pkg-config dependencies
PKGS = libconfig