summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 697a2a3f80eac96f21db5e47270e39e2e54cd988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
stages:
  - build
  - push
  - debian
  - vendor

build_test:
  image: registry.0xacab.org/leap/bitmask-vpn:latest
  stage: build
  script:
    - make generate
    - make test
    # TODO missing xcb package in the docker image. investigate what to install to run minimal tests.
    # - make test_ui
    - make build
  tags:
    - linux
  artifacts:
    paths:
      - 'qtbuild/release/riseup-vpn'
    expire_in: 1 month

# branded_push:
#   image: registry.0xacab.org/leap/bitmask-vpn:latest
#   stage: push
#   only:
#       - master
#   script:
#     # install the command-line openssh client to manage private keys
#     - apt install -y openssh-client
#     # activate the ssh-agent
#     - eval $(ssh-agent -s)
#     # load the private key, which is accessed vi a gitlab CI secret environment variable
#     # We're using tr to fix line endings which makes ed25519 keys work
#     # without extra base64 encoding.
#     - ssh-add <(echo "$RISEUP_VPN_PACKAGE_SSH_KEY")
#     - mkdir -p ~/.ssh
#     # ensure that ssh will trust a new host, instead of asking
#     - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
#     # we also need to configure name and email for git user
#     - git config user.name "Gitlab CI"
#     - git config user.email "gitlabci@0xacab.org"
#     # Add the remote repository and push to it - sometimes it already exists, and it causes the pipeline to fail, so we only add if its not already there
#     - git remote -v |grep -q riseup-vpn || git remote add riseup-vpn git@0xacab.org:leap/riseup-vpn_package.git
#     - git push --force riseup-vpn HEAD:incoming


# trigger_deb:
#   image: registry.0xacab.org/leap/buster_amd64:latest
#   stage: trigger
#   script:
#     - echo "Triggering CI pipeline on https://0xacab.org/leap/riseup-vpn_package/pipelines"
#     - "curl -X POST -F token=$RISEUP_VPN_DEB_TRIGGER_TOKEN -F ref=master https://0xacab.org/api/v4/projects/1916/trigger/pipeline"

debian:
  # TODO use a buster builder image, but upgrade golang version for compatibility
  image: registry.0xacab.org/leap/bitmask-vpn:latest
  stage: debian
  script:
    - 'PROVIDER="riseup" make vendor && rm -rf .build && mkdir -p .build && rm -f *.deb && cp -dR * .build/. && cd .build && debuild -us -uc'
  artifacts:
    paths:
      - '*.deb'

vendorize:
  image: registry.0xacab.org/leap/bitmask-vpn:latest
  stage: vendor
  script:
    #- TODO build_all_providers script can be rescued when we achieve to bring back xbuild for win/osx.
    # For now it only makes sense to build the snap.
    #- 'PROVIDERS="riseup calyx" make build_all_providers'
    - 'PROVIDER="riseup" make vendor && make package_snap'
  artifacts:
    name: installers-$CI_COMMIT_REF_NAME
    paths:
      - 'deploy/*.snap'
#       - 'deploy/RiseupVPN-*.exe'
#       - 'deploy/RiseupVPN-*.pkg'
#       - 'deploy/riseup-vpn_*.deb'
#       - 'deploy/CalyxVPN-*.exe'
#       - 'deploy/CalyxVPN-*.pkg'
#       - 'deploy/calyx-vpn_*.deb'
    expire_in: 1 month