Commit 4a848165 authored by Heinz N. Gies's avatar Heinz N. Gies

Update service.yml

parent 162d2340
### Generic cli file for services
stages:
- compile # compile and create a cache
- test # run tets
- package # verify package creation
################################################################################
## Compile stage
## helpers
################################################################################
# Aa first stage we compile our code, we'll run tests on it afterwards
# this gives the advantage that we do not have to re-compile c-code over and
# over again
compile-bsd:
stage: compile
script:
- '[ "${CI_PIPELINE_SOURCE}" = "pipeline" ] && ./rebar3 upgrade ${DOWNSTREAM_LIBRARY} || true'
- ./rebar3 compile
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
untracked: true
paths:
- _build/
- rebar.lock
compile-smartos:
stage: compile
script:
- '[ "${CI_PIPELINE_SOURCE}" = "pipeline" ] && ./rebar3 upgrade ${DOWNSTREAM_LIBRARY} || true'
- ./rebar3 compile
tags:
- erlang-19
- smartos
cache:
key: "$CI_COMMIT_SHA-smartos"
untracked: true
paths:
- _build/
- rebar.lock
.not_triggered: &not_triggered
except:
- pipelines
.is_triggered: &is_triggered
only:
- pipelines
################################################################################
## test stage
## package stage
################################################################################
# Tests consist of everything from linting to unit tests we can run them in
# paralell
lint:
trigger_dialyzer:
<<: *is_triggered
image: erlang:19
stage: test
script:
- ./rebar3 as lint lint
- ./rebar3 upgrade $DOWNSTREAM_LIBRARY
- ./rebar3 dialyzer
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
- gitlab-org-high-cpu
xref:
trigger_xref:
<<: *is_triggered
image: erlang:19
stage: test
script:
- ./rebar3 upgrade $DOWNSTREAM_LIBRARY
- ./rebar3 xref
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
- gitlab-org-high-cpu
dialyzer:
stage: test
################################################################################
## package stage
################################################################################
# We make sure our package builds on both FreeBSD and SmartOS
smartos:
<<: *not_triggered
stage: package
script:
- ./rebar3 dialyzer
- export SUFFIX=$(/opt/local/bin/erl -noshell -eval '{{Y, MM, D}, {H, M, S}} = calendar:universal_time(), io:format("pre~4.10.0B~2.10.0B~2.10.0B~2.10.0B~2.10.0B~2.10.0B", [Y, MM, D, H, M, S]),init:stop()');
- export DS_VER=$(echo $CI_RUNNER_TAGS | sed 's/.*base64-\([0-9.]*\).*/\1/')
- export BRANCH=$(if [ "$CI_BUILD_REF_NAME" = "master" ]; then echo rel; else echo dev; fi)
- gmake dist
- mkdir -p rel/pkg/info
- s3cmd put rel/pkg/*.tgz s3://release.project-fifo.net/pkg/$DS_VER/$BRANCH/
- pkg_info -X rel/pkg/*.tgz > rel/pkg/info/$(pkg_info -X rel/pkg/*.tgz | awk -F "=" '/FILE_NAME/ {print $2}')
- s3cmd put rel/pkg/info/* s3://release-info.project-fifo.net/pkg/$DS_VER/$BRANCH/
- 'curl --request POST --form "token=$CI_JOB_TOKEN" --form "ref=master" --form "variables[DS_VER]=$DS_VER" --form "variables[BRANCH]=$BRANCH" https://gitlab.com/api/v4/projects/$REPO_PID/trigger/pipeline'
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
- smartos
only:
refs:
- master
- dev
eunit:
smartos_test:
stage: test
script:
- ./rebar3 eunit
- ./rebar3 as lint lint
- ./rebar3 xref
- ./rebar3 dialyzer
tags:
- erlang-19
- bsd
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
- smartos
except:
- pipelines
- master
- dev
################################################################################
## package stage
## bsd stage
################################################################################
# We make sure our package builds on both FreeBSD and SmartOS
bsd:
<<: *not_triggered
stage: package
script:
- export SUFFIX=$(/opt/local/bin/erl -noshell -eval '{{Y, MM, D}, {H, M, S}} = calendar:universal_time(), io:format("pre~4.10.0B~2.10.0B~2.10.0B~2.10.0B~2.10.0B~2.10.0B", [Y, MM, D, H, M, S]),init:stop()');
- export OS_VER=$(echo $CI_RUNNER_TAGS | sed 's/.*freebsd-\([0-9.]*\).*/\1/')
- export ARCH=$(uname -m)
- export BRANCH=$(if [ "$CI_BUILD_REF_NAME" = "master" ]; then echo rel; else echo dev; fi)
- gmake dist
tags:
- bsd
- erlang-19
cache:
key: "$CI_COMMIT_SHA-bsd"
policy: pull
paths:
- _build/
- rebar.lock
smartos:
stage: package
script:
- gmake dist
- s3cmd put rel/pkgng/*.txz s3://freebsd.project-fifo.net/$BRANCH/$ARCH/$OS_VER/
- 'curl --request POST --form "token=$CI_JOB_TOKEN" --form "ref=master" --form "variables[ARCH]=$ARCH" --form "variables[OS_VER]=$OS_VER" --form "variables[BRANCH]=$BRANCH" https://gitlab.com/api/v4/projects/$PKGNG_REPO_PID/trigger/pipeline'
tags:
- erlang-19
- smartos
cache:
key: "$CI_COMMIT_SHA-smartos"
policy: pull
paths:
- _build/
- rebar.lock
\ No newline at end of file
- freebsd-11.0
- sync
only:
refs:
- master
- dev
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment