65 lines
1.5 KiB
YAML
65 lines
1.5 KiB
YAML
|
kind: pipeline
|
||
|
type: kubernetes
|
||
|
name: modules-php-sat-client
|
||
|
|
||
|
clone:
|
||
|
depth: 1
|
||
|
|
||
|
steps:
|
||
|
- name: tests
|
||
|
image: composer:latest
|
||
|
pull: always
|
||
|
commands:
|
||
|
- composer install
|
||
|
- composer test
|
||
|
when:
|
||
|
branch:
|
||
|
- main
|
||
|
- prod
|
||
|
|
||
|
- name: building
|
||
|
image: alpine
|
||
|
commands:
|
||
|
- apk add zip
|
||
|
- zip -r package.zip src composer.json README.md
|
||
|
when:
|
||
|
branch:
|
||
|
- prod
|
||
|
|
||
|
- name: composer-deploy
|
||
|
image: alpine
|
||
|
environment:
|
||
|
REGISTRY_TOKEN:
|
||
|
from_secret: DRONE_NPM_PUBLISHER_TOKEN
|
||
|
commands:
|
||
|
- apk add curl
|
||
|
- curl --fail-with-body --user modules-communs-php:$REGISTRY_TOKEN --upload-file ./package.zip https://git.nwb.fr/api/packages/modules-communs-php/composer
|
||
|
when:
|
||
|
branch:
|
||
|
- prod
|
||
|
|
||
|
- name: slack
|
||
|
image: plugins/slack
|
||
|
settings:
|
||
|
webhook: https://hooks.slack.com/services/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
|
||
|
channel: modules-communs
|
||
|
template: >
|
||
|
{{#success build.status}}
|
||
|
:white_check_mark: Déploiement <${DRONE_BUILD_LINK}|#${DRONE_BUILD_NUMBER}>. Beau travail, ${DRONE_COMMIT_AUTHOR_NAME} !
|
||
|
{{else}}
|
||
|
:x: Déploiement <${DRONE_BUILD_LINK}|#${DRONE_BUILD_NUMBER}> c'est un échec, ${DRONE_COMMIT_AUTHOR_NAME}.
|
||
|
{{/success}}
|
||
|
|
||
|
Repository : <${DRONE_REPO_LINK}|${DRONE_REPO_NAME}> depuis branche ${DRONE_BRANCH}
|
||
|
when:
|
||
|
status:
|
||
|
- failure
|
||
|
- success
|
||
|
|
||
|
trigger:
|
||
|
branch:
|
||
|
- main
|
||
|
- prod
|
||
|
event:
|
||
|
- push
|