.gitlab-ci.yml 1.27 KB
Newer Older
1 2
image: ruby:2.3

3
stages:
4
  - test
5 6
  - deploy

David Haynes's avatar
David Haynes committed
7 8
variables:
  JEKYLL_ENV: production
9 10 11
  LC_ALL: C.UTF-8

cache:
Nicholas J Anderson's avatar
Nicholas J Anderson committed
12
  key: "ruby-231-1"
13
  paths:
Nicholas J Anderson's avatar
Nicholas J Anderson committed
14
    - vendor/ruby
Nicholas J Anderson's avatar
Nicholas J Anderson committed
15
    - vendor/cache
16 17 18 19 20 21

pages:
  stage: deploy
  environment:
    name: production
    url: https://srct.gmu.edu
David Haynes's avatar
David Haynes committed
22
  script:
Nicholas J Anderson's avatar
Nicholas J Anderson committed
23
    - ruby -v
Nicholas J Anderson's avatar
Nicholas J Anderson committed
24 25 26
    - bundle install --gemfile=srctweb/Gemfile --jobs 4 --path vendor
    - ls vendor
    - ./vendor/jekyll build -s srctweb -d public
David Haynes's avatar
David Haynes committed
27
  artifacts:
Nicholas J Anderson's avatar
Nicholas J Anderson committed
28
    paths:
29 30 31 32 33 34
      - public
    expire_in: 1h
  only:
    - master@srct/srct.gmu.io
  tags:
    - docker
35

36
review:
37
  stage: deploy
38 39
  before_script: []
  cache: {}
40
  script:
41 42 43 44 45 46 47
    - ls
    - pwd
    - whoami
    - ls /srv/staging
    - echo $CI_BUILD_REF_NAME
    - echo $CI_PROJECT_NAME
    - touch /tmp/gitlab-runner
Nicholas J Anderson's avatar
Nicholas J Anderson committed
48 49
#  except:
#    - master
50
  only:
51 52 53 54 55 56 57 58 59
    - branches
  environment:
    name: review/$CI_BUILD_REF_NAME
    url: http://$CI_BUILD_REF_NAME.$APPS_DOMAIN
    on_stop: review_stop
  variables:
    GIT_STRATEGY: none
  tags:
    - banks
60

Nicholas J Anderson's avatar
Nicholas J Anderson committed
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
review_stop:
  stage: deploy
  variables:
    GIT_STRATEGY: none
  before_script: []
  artifacts: {}
  cache: {}
  dependencies: []
  script:
    - ls
    - pwd
    - whoami
    - ls /srv/staging
  when: manual
  environment:
    name: review/$CI_BUILD_REF_NAME
    action: stop
  only:
    - branches
  tags:
    - banks