Mise à jour effectuée, merci de nous signaler tout dysfonctionnement ! | Upgrade done, please let us know about any dysfunction!

.gitlab-ci.yml 2.33 KB
Newer Older
Éloïs's avatar
Éloïs committed
1
stages:
Stéphane Veyret's avatar
Stéphane Veyret committed
2
  - github-sync
releaser-duniter's avatar
releaser-duniter committed
3
4
  - build
  - test
releaser-duniter's avatar
releaser-duniter committed
5
6
  - releases
  - releases-page
Éloïs's avatar
Éloïs committed
7
8
9
10
11
push_to_github:
    stage: github-sync
    variables:
        GIT_STRATEGY: none
    tags:
12
        - redshift
Éloïs's avatar
Éloïs committed
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 $?"
releaser-duniter's avatar
releaser-duniter committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
        
build:
  stage: build
  tags:
    - redshift
  before_script:
    - export NVM_DIR="$HOME/.nvm"
    - . "$NVM_DIR/nvm.sh"
  script:
    - yarn

test:
  stage: test
  tags:
    - redshift
  before_script:
    - export NVM_DIR="$HOME/.nvm"
    - . "$NVM_DIR/nvm.sh"
  script:
    - yarn
    - yarn test
45

releaser-duniter's avatar
releaser-duniter committed
46
47
releases:test:
  stage: releases
48
  image: duniter/release-builder:v1.0.1
Stéphane Veyret's avatar
Stéphane Veyret committed
49
  tags:
Éloïs's avatar
Éloïs committed
50
    - redshift-duniter-builder
51
  variables:
releaser-duniter's avatar
releaser-duniter committed
52
53
54
    DAY: $(date +%Y%m%d)
    HOUR: $(date +%H%M)
    SEC: $(date +%S)
Stéphane Veyret's avatar
Stéphane Veyret committed
55
  script:
releaser-duniter's avatar
releaser-duniter committed
56
    - bash "release/arch/linux/build-lin.sh" "$(date +%Y%m%d).$(date +%H%M).$(date +%S)"
Stéphane Veyret's avatar
Stéphane Veyret committed
57
58
  artifacts:
    paths:
releaser-duniter's avatar
releaser-duniter committed
59
      - work/bin/
Stéphane Veyret's avatar
Stéphane Veyret committed
60
    expire_in: 8h
Éloïs's avatar
Éloïs committed
61
  when: manual
62
63
64
  except:
    - tags
  
Stéphane Veyret's avatar
Stéphane Veyret committed
65

releaser-duniter's avatar
releaser-duniter committed
66
67
releases:
  stage: releases
68
  image: duniter/release-builder:v1.0.1
Stéphane Veyret's avatar
Stéphane Veyret committed
69
  tags:
Éloïs's avatar
Éloïs committed
70
    - redshift-duniter-builder
Stéphane Veyret's avatar
Stéphane Veyret committed
71
72
73
74
  script:
    - bash "release/arch/linux/build-lin.sh" "${CI_COMMIT_TAG#v}"
  artifacts:
    paths:
releaser-duniter's avatar
releaser-duniter committed
75
76
77
      - work/bin/duniter-desktop-${CI_COMMIT_TAG}-linux-x64.deb
      - work/bin/duniter-desktop-${CI_COMMIT_TAG}-linux-x64.tar.gz
      - work/bin/duniter-server-${CI_COMMIT_TAG}-linux-x64.deb
78
    expire_in: 8h
Éloïs's avatar
Éloïs committed
79
  when: manual
Stéphane Veyret's avatar
Stéphane Veyret committed
80
  only:
Éloïs's avatar
Éloïs committed
81
  - tags
Éloïs's avatar
Éloïs committed
82
  - master
83
    
releaser-duniter's avatar
releaser-duniter committed
84
releases-message:
releaser-duniter's avatar
releaser-duniter committed
85
  stage: releases-page
Éloïs's avatar
Éloïs committed
86
  image: tensorflow/tensorflow:latest-py3
Éloïs's avatar
Éloïs committed
87
88
  tags:
    - redshift-duniter-builder
89
  variables:
releaser-duniter's avatar
releaser-duniter committed
90
    JOB_ARTIFACTS: 'releases'
91
    EXPECTED_ARTIFACTS: '["work/bin/duniter-desktop-${CI_COMMIT_TAG}-linux-x64.deb","work/bin/duniter-desktop-${CI_COMMIT_TAG}-linux-x64.tar.gz","work/bin/duniter-server-${CI_COMMIT_TAG}-linux-x64.deb"]'
Cédric Moreau's avatar
Cédric Moreau committed
92
  script:
93
    - python3 .gitlab/releaser.py
Éloïs's avatar
Éloïs committed
94
  when: manual
95
  only:
Éloïs's avatar
Éloïs committed
96
  - tags
Éloïs's avatar
Éloïs committed
97
  - master