Use master branches for platform on CI
[leap_cli.git] / .gitlab-ci.yml
1 ---
2 image: 0xacab.org:4567/leap/docker/ruby:latest
3
4 stages:
5   - build
6   - test
7   - trigger
8
9 build:
10   stage: build
11   script:
12     - "rake build"
13     - "gem install --user-install pkg/leap_cli-*.gem"
14     - export PATH="$PATH:$(ruby -e 'puts Gem.user_dir')/bin"
15     - leap
16   artifacts:
17     paths:
18       - pkg/leap_cli-*.gem
19     name: "leap_cli_${CI_BUILD_REF_NAME}_${CI_BUILD_REF}"
20     expire_in: 3 month
21
22 test:
23   stage: test
24   script:
25     # - apt-get install --yes pkg-config
26     # - bundle config build.nokogiri --use-system-libraries
27     - apt-get install rake
28     - bundle install --path vendor/bundle --with test
29     - git clone https://leap.se/git/leap_platform.git
30     - chmod -R a+rwX test/provider
31     - useradd -ms /bin/bash testuser
32     - su -c "PLATFORM_DIR=$(readlink -e leap_platform) bundle exec rake test" testuser
33
34 # trigger leap_platform pipeline
35 trigger:
36   stage: trigger
37   type: deploy
38   script:
39     - "curl -s -X POST -F token=${PLATFORM_TRIGGER_TOKEN} https://0xacab.org/api/v3/projects/129/trigger/builds"