v4l2rtspserver/.circleci/config.yml

177 lines
5.8 KiB
YAML
Raw Normal View History

2019-01-25 20:28:46 +00:00
defaults: &defaults
working_directory: /v4l2rtspserver
docker:
- image: heroku/heroku:18
2018-01-28 15:34:11 +00:00
version: 2
jobs:
2018-02-04 20:23:34 +00:00
build_x86_64:
2019-01-25 20:28:46 +00:00
<<: *defaults
2018-01-28 15:34:11 +00:00
steps:
- checkout
2018-12-08 22:07:32 +00:00
- run: apt-get update; apt-get install -y --no-install-recommends cmake autoconf automake libtool git make g++ liblog4cpp5-dev libasound2-dev pkg-config
2018-02-04 17:46:17 +00:00
- run: cmake . && make
- run: cpack .
- run: mkdir -p /distrib && cp *.deb /distrib
- persist_to_workspace:
root: /
paths:
- distrib
2018-02-04 20:23:34 +00:00
build_rpi:
2019-01-25 20:28:46 +00:00
<<: *defaults
2018-02-04 20:23:34 +00:00
steps:
- checkout
2018-12-08 22:07:32 +00:00
- run: apt-get update; apt-get install -y --no-install-recommends cmake autoconf automake libtool git make pkg-config
2018-02-04 20:23:34 +00:00
- run: git clone --depth 1 https://github.com/raspberrypi/tools.git rpi_tools
- run: echo 'export PATH=${CIRCLE_WORKING_DIRECTORY}/rpi_tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:$PATH' >> $BASH_ENV
- run: cmake -DCMAKE_TOOLCHAIN_FILE=${CIRCLE_WORKING_DIRECTORY}/raspberry.toolchain . && make
- run: cpack .
- run: mkdir -p /distrib && cp *.deb /distrib
- persist_to_workspace:
root: /
paths:
- distrib
2018-02-04 20:23:34 +00:00
2018-02-04 20:52:54 +00:00
build_mips:
2019-01-25 20:28:46 +00:00
<<: *defaults
2018-02-04 20:52:54 +00:00
steps:
- checkout
2018-12-08 22:07:32 +00:00
- run: apt-get update; apt-get install -y --no-install-recommends cmake autoconf automake libtool git make g++-mips-linux-gnu pkg-config
2018-02-04 20:52:54 +00:00
- run: cmake -DCMAKE_TOOLCHAIN_FILE=${CIRCLE_WORKING_DIRECTORY}/mips.toolchain . && make
- run: cpack .
- run: mkdir -p /distrib && cp *.deb /distrib
- persist_to_workspace:
root: /
paths:
- distrib
2018-02-04 20:52:54 +00:00
2018-03-03 10:48:31 +00:00
store_artifact:
2019-01-25 20:28:46 +00:00
<<: *defaults
steps:
- attach_workspace:
at: /
- store_artifacts:
path: /distrib
2018-03-03 10:48:31 +00:00
github_release:
2019-01-25 20:28:46 +00:00
<<: *defaults
2018-03-03 10:48:31 +00:00
steps:
- attach_workspace:
at: /
2018-03-03 11:35:45 +00:00
- run: curl https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz | tar -C /usr/local -xzf -
- run: echo 'export PATH=/usr/local/go/bin:/root/go/bin:$PATH' >> $BASH_ENV
2018-03-03 10:48:31 +00:00
- run: go get github.com/tcnksm/ghr
- deploy:
name: "Deploy to Github"
2018-03-03 11:47:31 +00:00
command: ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME $CIRCLE_TAG /distrib
2018-03-03 10:48:31 +00:00
2019-01-25 20:28:46 +00:00
# -------------------------------------
# publish docker amd64
# -------------------------------------
publish_docker_linuxamd64:
machine:
docker_layer_caching: true
steps:
- checkout
- run: git submodule update --init
- run:
command: |
2019-01-26 15:20:50 +00:00
export TAG=${CIRCLE_TAG:-lastest}
docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
docker build --pull -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-amd64 -f Dockerfile .
docker push $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-amd64
2019-01-25 20:28:46 +00:00
# -------------------------------------
# publish docker arm
# -------------------------------------
publish_docker_linuxarm32v7:
machine:
docker_layer_caching: true
steps:
- checkout
- run: git submodule update --init
- run:
command: |
2019-01-26 15:20:50 +00:00
export TAG=${CIRCLE_TAG:-lastest}
docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
docker build --pull -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v7 -f Dockerfile.rpi .
docker push $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v7
2019-01-25 20:28:46 +00:00
# -------------------------------------
# publish docker manifest
# -------------------------------------
publish_docker_multiarch:
machine:
image: circleci/classic:201808-01
steps:
- run:
command: |
mkdir $HOME/.docker
sh -c 'echo "{ \"experimental\": \"enabled\" }" >> $HOME/.docker/config.json'
#
docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
2019-01-26 15:20:50 +00:00
export TAG=${CIRCLE_TAG:-lastest}
docker manifest create --amend $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG} $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-amd64 $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v7
docker manifest annotate $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG} $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-amd64 --os linux --arch amd64
docker manifest annotate $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG} $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v7 --os linux --arch arm --variant v7
docker manifest push $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG} -p
2019-01-25 20:28:46 +00:00
2018-02-04 20:23:34 +00:00
workflows:
version: 2
build:
jobs:
2018-03-03 10:48:31 +00:00
- build_x86_64:
filters:
tags:
only: /.*/
- build_rpi:
filters:
tags:
only: /.*/
- build_mips:
filters:
tags:
only: /.*/
- store_artifact:
requires:
- build_x86_64
- build_rpi
- build_mips
filters:
tags:
only: /.*/
- github_release:
requires:
- build_x86_64
- build_rpi
- build_mips
2018-03-03 10:48:31 +00:00
filters:
branches:
ignore: /.*/
tags:
only: /.*/
2019-01-25 20:28:46 +00:00
docker:
jobs:
- publish_docker_linuxamd64:
filters:
tags:
only: /.*/
- publish_docker_linuxarm32v7:
filters:
tags:
only: /.*/
- publish_docker_multiarch:
requires:
- publish_docker_linuxamd64
- publish_docker_linuxarm32v7
filters:
tags:
only: /.*/