Skip to content
Snippets Groups Projects
.gitlab-ci.yml 3.98 KiB
Newer Older
  • Learn to ignore specific revisions
  • meskio's avatar
    meskio committed
    ---
    stages:
      - build
    
    meskio's avatar
    meskio committed
    
    variables:
      GOPATH: /go
    
      APP_PATH: /go/src/0xacab.org/leap/bitmask-vpn
    
    meskio's avatar
    meskio committed
    
    build_test:
    
      image: 0xacab.org:4567/leap/docker/bitmask-systray:latest
    
    meskio's avatar
    meskio committed
      stage: build
      script:
        - mkdir -p /go/src/0xacab.org/leap/
        - ln -s "$(pwd)" ${APP_PATH}
        - cd ${APP_PATH}
    
        - make get
    
        - make test
    
        - make build_bitmaskd
    
    meskio's avatar
    meskio committed
        - make build
    
    meskio's avatar
    meskio committed
      tags:
        - linux
    
      artifacts:
    
    meskio's avatar
    meskio committed
        paths:
    
          - 'bitmask-vpn'
          - 'bitmask-helper'
          - 'bitmask-connect'
    
    meskio's avatar
    meskio committed
        expire_in: 1 month
    
    micah's avatar
    micah committed
    branded_push:
    
    Kali Kaneko's avatar
    Kali Kaneko committed
      image: 0xacab.org:4567/leap/docker/bitmask-systray:latest
    
    micah's avatar
    micah committed
      stage: build
      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
        - git remote add riseup-vpn git@0xacab.org:leap/riseup-vpn_package.git
    
        - git push --force riseup-vpn HEAD:incoming
    
    micah's avatar
    micah committed
    
    
    win_installer:
    
     image: 0xacab.org:4567/leap/docker/bitmask-systray:latest
    
     stage: build
     script:
       - mkdir -p /go/src/0xacab.org/leap/
       - ln -s "$(pwd)" ${APP_PATH}
       - cd ${APP_PATH}
    
       # we need to manually patch w32 until they merge #81
       - mkdir -p /go/src/github.com/AllenDang/
       - cd /go/src/github.com/AllenDang/
       - git clone https://github.com/AllenDang/w32
       - cd w32
       - curl https://downloads.leap.se/thirdparty/w32.patch | patch -p1 -N
    
       - cd ${APP_PATH}
    
       - git clone https://0xacab.org/leap/riseup_vpn
       - cd riseup_vpn
       - make openvpn_cross_win
       - make build_cross_win
       - mv dist/RiseupVPN-*.exe ..
     tags:
       - linux
     artifacts:
       name: installer_win_$CI_COMMIT_REF_NAME
       paths:
         - RiseupVPN-*.exe
       expire_in: 1 month
    
     image: 0xacab.org:4567/leap/docker/bitmask-systray:latest
    
    meskio's avatar
    meskio committed
     stage: build
     script:
       - mkdir -p /go/src/0xacab.org/leap/
       - ln -s "$(pwd)" ${APP_PATH}
    
    
       - git clone https://0xacab.org/leap/riseup_vpn /riseup_vpn
       - cd /riseup_vpn
    
       - sed -i 's/https:\/\/0xacab.org\/leap\/bitmask-vpn.*$/\/go\/src\/0xacab.org\/leap\/bitmask-vpn/' snap/snapcraft.yaml
    
       - sed -i 's/git clone.*$//' snap/version.sh
    
       - sed -i 's/git -C bitmask-vpn/git -C \/go\/src\/0xacab.org\/leap\/bitmask-vpn/' snap/version.sh
    
    meskio's avatar
    meskio committed
       - snapcraft snap
    
       - mv riseup-vpn*.snap ${APP_PATH}
    
    meskio's avatar
    meskio committed
     tags:
       - linux
     artifacts:
       name: snap_$CI_COMMIT_REF_NAME
       paths:
         - riseup-vpn*.snap
       expire_in: 1 month
    
    Kali Kaneko's avatar
    Kali Kaneko committed
    
    
    deb:
      image: 0xacab.org:4567/leap/docker/bitmask-systray:latest
      stage: build
      allow_failure: true
      script:
        - mkdir -p /go/src/0xacab.org/leap/
        - ln -s "$(pwd)" ${APP_PATH}
        - git clone https://0xacab.org/leap/riseup_vpn
        - cd riseup_vpn
        - make build_deb
      tags:
        - linux
      artifacts:
        name: debian_$CI_COMMIT_REF_NAME
        paths:
          - riseup_vpn/dist/*.deb
        expire_in: 1 month
    
    
    # osx_installer:
    #   stage: build
    #   allow_failure: true
    #   variables:
    #       GOPATH: /tmp/go/
    #       APP_PATH: /tmp/go/src/0xacab.org/leap/bitmask-vpn
    #   script:
    #     - git clone https://0xacab.org/leap/riseup_vpn
    #     - cd riseup_vpn
    #     - make openvpn_osx
    #     - make build_osx
    #   tags:
    #     - yosemite
    #     - osx
    #   artifacts:
    #     name: installer_osx_$CI_COMMIT_REF_NAME
    #     paths:
    #       - riseup_vpn/dist/RiseupVPN-*.pkg
    #   expire_in: 1 month
    
    
    trigger_deb:
    
      image: 0xacab.org:4567/leap/docker/buster_amd64:latest
    
      stage: trigger-deb
    
    Kali Kaneko's avatar
    Kali Kaneko committed
      script:
    
        - "curl -X POST -F token=$RISEUP_VPN_DEB_TRIGGER_TOKEN -F ref=master https://0xacab.org/api/v4/projects/1916/trigger/pipeline"