summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: e0c6897885e44ce930f07caefd718bab0d81b55d (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
---
image: 0xacab.org:4567/leap/docker/ruby:latest

stages:
  - build
  - test
  - trigger

build:
  stage: build
  script:
    - "rake build"
    - "gem install --user-install pkg/leap_cli-*.gem"
    - export PATH="$PATH:$(ruby -e 'puts Gem.user_dir')/bin"
    - leap
  artifacts:
    paths:
      - pkg/leap_cli-*.gem
    name: "leap_cli_${CI_BUILD_REF_NAME}_${CI_BUILD_REF}"
    expire_in: 3 month

test:
  stage: test
  script:
    # - apt-get install --yes pkg-config
    # - bundle config build.nokogiri --use-system-libraries
    - apt-get install rake
    - bundle install --path vendor/bundle --with test
    - git clone https://leap.se/git/leap_platform.git -b develop
    - chmod -R a+rwX test/provider
    - useradd -ms /bin/bash testuser
    - su -c "PLATFORM_DIR=$(readlink -e leap_platform) bundle exec rake test" testuser

# trigger leap_platform pipeline
trigger:
  stage: trigger
  type: deploy
  script:
    - "curl -s -X POST -F token=${PLATFORM_TRIGGER_TOKEN} -F ref=develop https://0xacab.org/api/v3/projects/129/trigger/builds"