bragi/.drone.yml
Azlux cea04d03de Fix drone taf
docs : Note that you cannot use branch conditions with tag events. A tag is not associated with the source branch from which it was created.
2020-07-08 00:23:59 +02:00

89 lines
2.2 KiB
YAML

kind: pipeline
type: docker
name: default
steps:
- name: build
image: node
commands:
- cd web
- npm install
- npm run build
- cd ..
- name: deploy-testing
image: debian
commands:
- apt-get -qq update && apt-get -qq install git > /dev/null
- sed -i 's/target_version = git/target_version = testing/' configuration.default.ini
- version=$(git rev-parse HEAD)
- echo "current git commit is $version"
- echo $version > /tmp/botamusique/testing-version
- sed -i "s/version = 'git'/version = '$version'/" mumbleBot.py
- rm -rf .git*
- rm -rf web
- tar -czf /tmp/botamusique/sources-testing.tar.gz .
volumes:
- name: repo
path: /tmp/botamusique/
when:
branch:
- master
event:
- push
- name: docker-testing
image: plugins/docker
settings:
repo: azlux/botamusique
username:
from_secret: docker_username
password:
from_secret: docker_password
tags: testing
when:
branch:
- master
event:
- push
- name: deploy-stable
image: debian
commands:
- apt-get -qq update && apt-get -qq install jq curl git > /dev/null
- sed -i 's/target_version = git/target_version = stable/' configuration.default.ini
- git fetch --tags
- version=$(git describe --abbrev=0 --tags)
- echo "version is $version"
- echo $version > /tmp/botamusique/version
- sed -i "s/version = 'git'/version = '$version'/" mumbleBot.py
- curl --silent "https://api.github.com/repos/azlux/botamusique/releases/latest" | jq -r '.body' > /tmp/botamusique/changelog
- rm -rf .git*
- rm -rf web
- tar -czf /tmp/botamusique/sources-stable.tar.gz .
volumes:
- name: repo
path: /tmp/botamusique/
when:
event:
- tag
- name: docker-stable
image: plugins/docker
settings:
repo: azlux/botamusique
username:
from_secret: docker_username
password:
from_secret: docker_password
tags: latest
when:
event:
- tag
volumes:
- name: repo
host:
path: /media/raid5/data/packages/repos/apt/botamusique/