.gitlab-ci.yml 2.82 KB
Newer Older
1
image: framasoft/framadate-ci
2
stages:
3
  - test
4
  - deploy
Thomas Citharel's avatar
Thomas Citharel committed
5
  - beta
6
  - funky
7
8
9
10
11

# Run php-cs-fixer and phpunit on all branches
test:
  stage: test
  script:
12
    - composer install -o  --no-interaction --no-progress --prefer-dist
13
14
15
    - mkdir tpl_c
    - php vendor/bin/php-cs-fixer fix --verbose --dry-run
    - vendor/bin/phpunit --bootstrap app/tests/bootstrap.php --debug app/tests
Thomas Citharel's avatar
Thomas Citharel committed
16
17
18
  cache:
    paths:
      - vendor/
19
20
21
22

# Create artifacts on master
pages:
  stage: deploy
23
24
25
  script:
  - latesttag=$(git describe --tags)
  - git checkout ${latesttag}
26
27
  - composer install -o  --no-interaction --no-progress --prefer-dist --no-dev
  - composer dump-autoload --optimize --no-dev --classmap-authoritative
28
  - mkdir tpl_c
29
  - mkdir framadate
30
  - mv `ls -A | grep -v framadate` ./framadate
31
  - zip -r latest.zip framadate
32
33
34
35
36
37
38
  - mkdir .public
  - cp latest.zip .public
  - mv .public public
  artifacts:
    paths:
    - public
  only:
39
    - master
40

Thomas Citharel's avatar
Thomas Citharel committed
41
# Deploy on develop
Thomas Citharel's avatar
typo    
Thomas Citharel committed
42
beta:
Thomas Citharel's avatar
Thomas Citharel committed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
  stage: beta
  script:
  - git checkout develop
  - composer install -o  --no-interaction --no-progress --prefer-dist --no-dev
  - composer dump-autoload --optimize --no-dev --classmap-authoritative
  - mkdir tpl_c
  - mkdir .public
  - cp -r * .public
  - mv .public public
  - mkdir "${HOME}/.ssh"
  - chmod 700 "${HOME}/.ssh"
  - if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
  - eval `ssh-agent -s`
  - if [ ! -z ${BETA_KEY+x} ]; then ssh-add <(echo "${BETA_KEY}" | base64 --decode -i); fi
  - if [ ! -z ${BETA_KEY+x} ]; then rsync -a --delete --exclude admin/.stdout.log --exclude admin/.htpasswd --exclude app/inc/config.php --exclude stats/ --exclude error/ public/ ${BETA_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
  only:
    - develop

61
# Deploy on funky
62
63
64
65
funky:
  stage: funky
  script:
  - git checkout funky
66
  - composer install
67
68
69
70
71
72
73
74
75
  - mkdir tpl_c
  - mkdir .public
  - cp -r * .public
  - mv .public public
  - mkdir "${HOME}/.ssh"
  - chmod 700 "${HOME}/.ssh"
  - if [ ! -z ${DEPLOYEMENT_KNOWN_HOSTS+x} ]; then echo -e "${DEPLOYEMENT_KNOWN_HOSTS}" > ${HOME}/.ssh/known_hosts; fi
  - eval `ssh-agent -s`
  - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then ssh-add <(echo "${DEPLOYEMENT_KEY}" | base64 --decode -i); fi
Thomas Citharel's avatar
Thomas Citharel committed
76
  - if [ ! -z ${DEPLOYEMENT_KEY+x} ]; then rsync -a --delete --exclude admin/.stdout.log --exclude admin/.htpasswd --exclude app/inc/config.php --exclude stats/ --exclude error/ public/ ${DEPLOYEMENT_USER}@${DEPLOYEMENT_HOST}:../../web/; fi
77
78
  only:
    - funky
79
80
81
82
83
84
85
86
87
88

# Push new translations strings to https://trad.framasoft.org
trads:
  stage: deploy
  image: framasoft/push-trad:latest
  script:
  - if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then mkdir -p ${HOME}/.config; echo -e "${ZANATA_CONFIG_FRAMABOT}" > ${HOME}/.config/zanata.ini; fi
  - if [ ! -z ${ZANATA_CONFIG_FRAMABOT+x} ]; then make push-locales; fi
  only:
    - develop