mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
206 lines
5.5 KiB
YAML
206 lines
5.5 KiB
YAML
#################################################
|
|
# Base configuration
|
|
#################################################
|
|
stages:
|
|
- package
|
|
- test
|
|
- deploy
|
|
|
|
.rpm:
|
|
tags: ["docker"]
|
|
|
|
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/
|
|
|
|
centos7-rpm:
|
|
extends: .rpm
|
|
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos7-php
|
|
|
|
rocky8-rpm:
|
|
extends: .rpm
|
|
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-rocky8-php:2022_10_18_fix_centos_eol_repository
|
|
|
|
centos7-rpm-test:
|
|
tags: ["docker"]
|
|
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-centos7-php
|
|
needs:
|
|
- centos7-rpm
|
|
|
|
stage: test
|
|
script:
|
|
- yum -y localinstall rpmbuild/x86_64/*.rpm
|
|
- cd /opt/belledonne-communications/share/flexisip-account-manager/flexiapi
|
|
- scl enable rh-php73 "vendor/bin/phpcs"
|
|
- scl enable rh-php73 "vendor/bin/phpmd . ansi phpmd.xml"
|
|
- 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
|
|
|
|
rocky8-rpm-test:
|
|
tags: ["docker"]
|
|
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-rocky8-php:2022_10_18_fix_centos_eol_repository
|
|
needs:
|
|
- rocky8-rpm
|
|
|
|
stage: test
|
|
script:
|
|
- yum -y localinstall rpmbuild/x86_64/*.rpm
|
|
- cd /opt/belledonne-communications/share/flexisip-account-manager/flexiapi
|
|
- vendor/bin/phpcs
|
|
- vendor/bin/phpmd . ansi phpmd.xml
|
|
- php artisan key:generate
|
|
- 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
|
|
|
|
debian11-deb-test:
|
|
tags: ["docker"]
|
|
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian11-php:20221029_belledone_apt_repository
|
|
needs:
|
|
- debian11-deb
|
|
|
|
stage: test
|
|
script:
|
|
- sudo -s apt update
|
|
- sudo -s apt -y install bc-flexisip-account-manager
|
|
- cd /opt/belledonne-communications/share/flexisip-account-manager/flexiapi
|
|
- vendor/bin/phpcs
|
|
- vendor/bin/phpmd . ansi phpmd.xml
|
|
- php artisan key:generate
|
|
- 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
|
|
|
|
.package-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
|
|
|
|
.rpm-deploy:
|
|
script:
|
|
- cd rpmbuild/x86_64
|
|
- rsync -e "ssh -o StrictHostKeyChecking=no" -pr . $DEPLOY_SERVER:$DEPLOY_DIRECTORY_STATE;
|
|
ssh $DEPLOY_SERVER "chmod a+r $DEPLOY_DIRECTORY_STATE/*.rpm && createrepo_c --update $DEPLOY_DIRECTORY_STATE/.";
|
|
only:
|
|
refs:
|
|
- master
|
|
changes:
|
|
- flexisip-account-manager.spec
|
|
|
|
extends:
|
|
- .package-deploy
|
|
|
|
.centos7-rpm-deploy:
|
|
extends: .rpm-deploy
|
|
tags: ["docker-centos7"]
|
|
|
|
needs:
|
|
- centos7-rpm
|
|
|
|
centos7-rpm-deploy-stable:
|
|
extends: .centos7-rpm-deploy
|
|
variables:
|
|
DEPLOY_DIRECTORY_STATE: $CENTOS7_DEPLOY_DIRECTORY_STABLE
|
|
|
|
centos7-rpm-deploy-alpha:
|
|
extends: .centos7-rpm-deploy
|
|
variables:
|
|
DEPLOY_DIRECTORY_STATE: $CENTOS7_DEPLOY_DIRECTORY_ALPHA
|
|
|
|
.rocky8-rpm-deploy:
|
|
extends: .rpm-deploy
|
|
tags: ["docker"]
|
|
needs:
|
|
- rocky8-rpm
|
|
|
|
# rocky8-rpm-deploy-stable:
|
|
# extends: .rocky8-rpm-deploy
|
|
# variables:
|
|
# DEPLOY_DIRECTORY_STATE: $CENTOS8_DEPLOY_DIRECTORY_STABLE
|
|
|
|
rocky8-rpm-deploy-alpha:
|
|
extends: .rocky8-rpm-deploy
|
|
variables:
|
|
DEPLOY_DIRECTORY_STATE: $CENTOS8_DEPLOY_DIRECTORY_ALPHA
|
|
|
|
debian11-deb:
|
|
tags: ["docker"]
|
|
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian11-php:20220413_flexiapi_packaging
|
|
|
|
stage: package
|
|
script:
|
|
- make deb-dev
|
|
artifacts:
|
|
paths:
|
|
- ./*.deb
|
|
when: always
|
|
expire_in: 1 year
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- flexiapi/vendor/
|
|
|
|
.debian11-deploy:
|
|
extends: .package-deploy
|
|
tags: ["docker"]
|
|
image: gitlab.linphone.org:4567/bc/public/linphone-sdk/bc-dev-debian11-php:20220413_flexiapi_packaging
|
|
needs:
|
|
- debian11-deb
|
|
variables:
|
|
RELEASE: bullseye
|
|
FREIGHT_PATH: $DEBIAN_FREIGHT_CONF_PATH
|
|
only:
|
|
refs:
|
|
- master
|
|
changes:
|
|
- flexisip-account-manager.spec
|
|
|
|
before_script:
|
|
- eval $(ssh-agent -s)
|
|
- echo "$DEPLOY_USER_KEY" | tr -d '\r' | ssh-add - > /dev/null
|
|
- mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
|
- echo "$DEPLOY_SERVER_HOST_KEY" >> ~/.ssh/known_hosts
|
|
script:
|
|
- id=$(cat /dev/urandom | tr -dc '[:alnum:]' | fold -w 10 | head -n 1) || true
|
|
- tmpdir="$MAKE_REPO_TMP/tmp-$id" || true
|
|
- rsync_dest="$DEPLOY_SERVER:$tmpdir/"
|
|
- echo ">>> Pushing packages into '$rsync_dest'"
|
|
- rsync -rv *.deb $rsync_dest
|
|
- ssh $DEPLOY_SERVER "echo \">>>> Making repository with Freight\"; (freight add --conf=$FREIGHT_PATH $tmpdir/*.deb apt/$RELEASE/$BRANCH && freight cache --conf=$FREIGHT_PATH apt/$RELEASE) || exit 1; echo \">>>> Removing '$tmpdir'\"; rm -r $tmpdir"
|
|
|
|
after_script:
|
|
- rm -rf ~/.ssh || true
|
|
|
|
debian11-stable-deploy:
|
|
extends: .debian11-deploy
|
|
variables:
|
|
BRANCH: stable
|
|
|
|
debian11-alpha-deploy:
|
|
extends: .debian11-deploy
|
|
variables:
|
|
BRANCH: alpha
|