gridtracker/.gitlab-ci.yml

92 wiersze
2.3 KiB
YAML
Czysty Zwykły widok Historia

# This file is a template, and might need editing before it works on your project.
# see https://docs.gitlab.com/ee/ci/yaml/README.html for all available options
variables:
DEFAULT_IMAGE: debian:stable
2020-11-10 22:54:15 +00:00
EXTRA_DESCRIPTION: ''
# only run for merge requests and tags
include:
- template: "Workflows/MergeRequest-Pipelines.gitlab-ci.yml"
default:
image: ${DEFAULT_IMAGE}
interruptible: true
2020-11-10 23:43:17 +00:00
cache: &global_cache
2020-11-10 22:54:15 +00:00
paths:
- .cache/
2020-11-10 23:43:17 +00:00
- node_modules/
2020-11-10 22:54:15 +00:00
key:
files:
- package.json
- package.nw/package.json
2020-11-10 23:43:17 +00:00
build_job:
stage: build
2020-11-10 22:54:15 +00:00
rules:
2020-11-10 23:43:17 +00:00
- if: $CI_COMMIT_TAG =~ /^(v|test_).*/
artifacts:
paths:
- build/*
script:
2020-11-10 23:43:17 +00:00
- export APT_CACHE_DIR=`pwd`/.cache/apt && mkdir -p $APT_CACHE_DIR
- export NPM_CONFIG_CACHE=`pwd`/.cache/npm && mkdir -p $NPM_CONFIG_CACHE
- echo $APT_CACHE_DIR $NPM_CONFIG_CACHE
- dpkg --add-architecture i386
- apt-get update
- apt-get -y install npm wine wine32
- npm install --prefer-offline
- npm run dist
2020-11-10 23:43:17 +00:00
- mkdir build
2020-11-07 23:56:00 +00:00
- (cd package.nw/dist ; mv *.zip *.exe *.7z *.json ../../build)
2020-11-10 23:43:17 +00:00
- apt-get -y install build-essential devscripts
- apt-get -y build-dep .
- dpkg-buildpackage -uc -us
- mkdir -p build/debian
- mv ../*.{deb,dsc,buildinfo,tar.xz,changes} build/debian/
- ls -R `pwd`/.cache
2020-11-04 20:29:13 +00:00
2020-11-10 22:54:15 +00:00
test_job:
stage: test
2020-11-10 23:43:17 +00:00
cache:
<<: *global_cache
policy: pull
2020-11-10 22:54:15 +00:00
script:
2020-11-10 23:46:03 +00:00
- export APT_CACHE_DIR=`pwd`/.cache/apt && mkdir -p $APT_CACHE_DIR
2020-11-10 23:43:17 +00:00
- export NPM_CONFIG_CACHE=`pwd`/.cache/npm && mkdir -p $NPM_CONFIG_CACHE
2020-11-10 23:46:03 +00:00
- apt-get update
- apt-get -y install npm
2020-11-10 23:43:17 +00:00
- rm -rf package.nw/dist
- npm install --prefer-offline
2020-11-10 22:54:15 +00:00
- npm test
release_job:
stage: deploy
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
2020-11-10 23:43:17 +00:00
- if: $CI_COMMIT_TAG =~ /^(v|test_).*/ && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
needs:
- job: build_job
2020-11-10 22:54:15 +00:00
script:
- echo 'Release for $CI_COMMIT_TAG'
release:
name: 'Release $CI_COMMIT_TAG'
description: debian/changelog
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_SHA'
2020-11-08 00:33:36 +00:00
2020-11-04 20:29:13 +00:00
# test2:
# stage: test
# script:
# - echo "Do another parallel test here"
# - echo "For example run a lint test"
#
# deploy1:
# stage: deploy
# only:
# - tags
# script:
# - echo "Do your deploy here"