flexisip-account-manager/.gitlab-ci.yml
Timothée Jaussoin d2bfc6e9f9 Integrate FlexiAPI in the RPM package (logs, conf, env…)
Update the GitlabCI and fix integration issues
Add a /api/ping authenticated endpoint
2020-02-10 10:52:28 +01:00

70 lines
1.8 KiB
YAML

#################################################
# Base configuration
#################################################
variables:
DEPLOY_SERVER: buildbot@www.linphone.org
CENTOS7_DEPLOY_DIRECTORY: snapshots/centos7
stages:
- package
- deploy
- test
job-centos7-rpm:
tags: [ "docker-centos7" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos7-php
stage: package
script:
- make rpm-dev
artifacts:
paths:
- rpmbuild/x86_64/*.rpm
when: always
expire_in: 1 year
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- flexiapi/vendor/
job-centos7-rpm-test:
tags: [ "docker-centos7" ]
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos7-php
stage: test
script:
- yum -y localinstall rpmbuild/x86_64/*.rpm
- cd /opt/belledonne-communications/share/flexisip-account-manager/flexiapi
- scl enable rh-php73 "php artisan key:generate"
- scl enable rh-php73 "vendor/bin/phpunit --log-junit $CI_PROJECT_DIR/flexiapi_phpunit.log"
artifacts:
paths:
- $CI_PROJECT_DIR/flexiapi_phpunit.log
- flexiapi/storage/logs/
when: always
expire_in: 1 day
job-centos7-rpm-deploy:
before_script:
- if ! [ -z ${SCP_PRIVATE_KEY+x} ]; then eval $(ssh-agent -s); fi
- if ! [ -z ${SCP_PRIVATE_KEY+x} ]; then echo "$SCP_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null; fi
stage: deploy
tags: [ "docker-centos7" ]
only:
refs:
- master
changes:
- flexisip-account-manager.spec
dependencies:
- job-centos7-rpm
script:
- cd rpmbuild/x86_64 && rsync -e "ssh -o StrictHostKeyChecking=no" -pr . $DEPLOY_SERVER:$CENTOS7_DEPLOY_DIRECTORY
- ssh $DEPLOY_SERVER "chmod a+r $CENTOS7_DEPLOY_DIRECTORY/*.rpm && createrepo_c --update $CENTOS7_DEPLOY_DIRECTORY/."