From 5b28e80924ff169ef0b1d2047d107345aa7ef85a Mon Sep 17 00:00:00 2001 From: Adhityaa Date: Thu, 7 Jun 2018 14:46:51 +0530 Subject: [PATCH] gitlab-ci.yml: add build and test --- .gitlab-ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..24b27fd --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,39 @@ +stages: + - build-src + - build-docker + - go-test + +build-src: + stage: build-src + image: debian:buster + script: + - apt update + - apt install -y curl gnupg git make golang + - curl -sL https://deb.nodesource.com/setup_10.x | bash - + - apt update + - apt install -y nodejs + - npm install -g html-minifier uglify-js sass + - cd api && go get -v . && cd .. + - make devel + - make prod + +build-docker: + stage: build-docker + image: docker:stable + script: + - docker build -t commento-ce . + +go-test: + stage: go-test + image: golang:1.10.2 + services: + - postgres:latest + variables: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: commento_test + COMMENTO_POSTGRES: postgres://postgres:postgres@postgres/commento_test?sslmode=disable + script: + - cd api + - (go get -v . || true) # TODO: remove this ugly hack + - go test -v .