.gitlab-ci.yml 1.25 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
Bugfix  
Nicholas J Anderson committed
12
  key: "ruby-231-1"
13
  paths:
Nicholas J Anderson's avatar
Bugfix  
Nicholas J Anderson committed
14
    - vendor/ruby
Nicholas J Anderson's avatar
Bugfix  
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
Bugfix  
Nicholas J Anderson committed
23 24 25
    - ruby -v
    - bundle install --system --gemfile=srctweb/Gemfile --jobs 4 --path vendor
    - jekyll build -s srctweb -d public
David Haynes's avatar
David Haynes committed
26
  artifacts:
Nicholas J Anderson's avatar
Bugfix  
Nicholas J Anderson committed
27
    paths:
28 29 30 31 32 33
      - public
    expire_in: 1h
  only:
    - master@srct/srct.gmu.io
  tags:
    - docker
Nicholas J Anderson's avatar
Nicholas J Anderson committed
34

35
review:
Nicholas J Anderson's avatar
Nicholas J Anderson committed
36
  stage: deploy
37 38
  before_script: []
  cache: {}
Nicholas J Anderson's avatar
Nicholas J Anderson committed
39
  script:
40 41 42 43 44 45 46
    - ls
    - pwd
    - whoami
    - ls /srv/staging
    - echo $CI_BUILD_REF_NAME
    - echo $CI_PROJECT_NAME
    - touch /tmp/gitlab-runner
Nicholas J Anderson's avatar
Bugfix  
Nicholas J Anderson committed
47 48
#  except:
#    - master
Nicholas J Anderson's avatar
Nicholas J Anderson committed
49
  only:
50 51 52 53 54 55 56 57 58
    - 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
Nicholas J Anderson's avatar
Nicholas J Anderson committed
59

Nicholas J Anderson's avatar
Bugfix  
Nicholas J Anderson committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
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