.gitlab-ci.yml 1.4 KB
Newer Older
Éloïs's avatar
Éloïs committed
1
stages:
Stéphane Veyret's avatar
Stéphane Veyret committed
2
3
4
  - github-sync
  - build
  - test
Éloïs's avatar
Éloïs committed
5

Éloïs's avatar
Éloïs committed
6
7
8
9
10
push_to_github:
    stage: github-sync
    variables:
        GIT_STRATEGY: none
    tags:
11
        - redshift
Éloïs's avatar
Éloïs committed
12
13
14
15
16
17
18
19
20
21
22
23
    script:
        - rm -rf ./*
        - rm -rf .git
        - git clone --mirror $CI_REPOSITORY_URL .
        - git remote add github $GITHUB_URL_AND_KEY
        - git config --global user.email "contact@duniter.org"
        - git config --global user.name "Duniter"
        # Job would fail if we don't remove refs about pull requests
        - bash -c "cat packed-refs | grep -v 'refs/pull' > packed-refs-new; echo 'Removed pull refs.'"
        - mv packed-refs-new packed-refs
        - bash -c "git push --force --mirror github 2>&1 | grep -v duniter-gitlab; echo $?"

Stéphane Veyret's avatar
Stéphane Veyret committed
24
25
build_linux:test:
  stage: build
Éloïs's avatar
Éloïs committed
26
  image: duniter/release-builder:v1.0.1
Stéphane Veyret's avatar
Stéphane Veyret committed
27
  tags:
Éloïs's avatar
Éloïs committed
28
    - redshift-duniter-builder
Stéphane Veyret's avatar
Stéphane Veyret committed
29
30
31
32
33
34
35
36
37
38
39
  script:
    - bash "release/arch/linux/build-lin.sh" "$(date +%Y%m%d).$(date +%H%M).$(date +%S)"
  artifacts:
    paths:
      - work/bin/
    expire_in: 8h
  except:
    - tags

build_linux:deploy:
  stage: build
Éloïs's avatar
Éloïs committed
40
  image: duniter/release-builder:v1.0.1
Stéphane Veyret's avatar
Stéphane Veyret committed
41
  tags:
Éloïs's avatar
Éloïs committed
42
    - redshift-duniter-builder
Stéphane Veyret's avatar
Stéphane Veyret committed
43
44
45
46
47
48
49
50
  script:
    - bash "release/arch/linux/build-lin.sh" "${CI_COMMIT_TAG#v}"
  artifacts:
    paths:
      - work/bin/
  only:
    - tags

51
test:
Cédric Moreau's avatar
Cédric Moreau committed
52
53
  stage: test
  tags:
Cédric Moreau's avatar
Cédric Moreau committed
54
    - redshift
Stéphane Veyret's avatar
Stéphane Veyret committed
55
56
57
  before_script:
    - export NVM_DIR="$HOME/.nvm"
    - . "$NVM_DIR/nvm.sh"
Cédric Moreau's avatar
Cédric Moreau committed
58
  script:
Cédric Moreau's avatar
Cédric Moreau committed
59
    - yarn
Cédric Moreau's avatar
Cédric Moreau committed
60
    - yarn test