.gitlab-ci.yml 1009 Bytes
Newer Older
1
2
image: centos:latest

3
4
variables:
    NPM_TOKEN: SECURE
5
6
    FIREFOX_BIN: /usr/bin/firefox
    NO_PROXY: 'localhost, 0.0.0.0/4201, 0.0.0.0/9876'
7

8
9
stages:
    - test
Sascha Herzinger's avatar
Sascha Herzinger committed
10
    - release
11
    - cleanup
12

Sascha Herzinger's avatar
Sascha Herzinger committed
13
test:all:
14
    stage: test
Sascha Herzinger's avatar
Sascha Herzinger committed
15
    script:
16
        - yum install -y epel-release
Sascha Herzinger's avatar
Sascha Herzinger committed
17
        - yum update -y
Sascha Herzinger's avatar
Sascha Herzinger committed
18
        - yum install -y git wget bzip2 firefox npm gtk3
Sascha Herzinger's avatar
Sascha Herzinger committed
19
        - wget -O firefox.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US"
Sascha Herzinger's avatar
Sascha Herzinger committed
20
21
        - tar vjxf firefox.tar.bz2
        - rm -rf /usr/bin/firefox
22
        - ln -s /firefox/firefox $FIREFOX_BIN
Sascha Herzinger's avatar
Sascha Herzinger committed
23
        - npm install
24
        - export
25
        - npm test
26
        - firefox -headless
27

Sascha Herzinger's avatar
Sascha Herzinger committed
28
29
release:npm:
    stage: release
30
    script:
Sascha Herzinger's avatar
Sascha Herzinger committed
31
32
        - yum install -y epel-release
        - yum update -y
Sascha Herzinger's avatar
Sascha Herzinger committed
33
        - yum install -y npm
34
35
36
37
38
        - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
        - npm publish
    only:
        - tags

Sascha Herzinger's avatar
Sascha Herzinger committed
39
cleanup:secrets:
40
41
42
43
    stage: cleanup
    when: always
    script:
        - rm -f ~/.npmrc