v4l2rtspserver/.circleci/config.yml

236 lines
8.2 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
2020-10-25 14:36:02 +00:00
build_rpi_armv6:
2019-01-25 20:28:46 +00:00
<<: *defaults
2020-10-25 14:36:02 +00:00
environment:
TAR_OPTIONS: --no-same-owner
CROSSCOMPILER: https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2010.1.0/Raspberry%20Pi%201%2C%20Zero/cross-gcc-10.1.0-pi_0-1.tar.gz
steps:
- checkout
- run: apt-get update; apt-get install -y --no-install-recommends cmake autoconf automake libtool git make pkg-config
- run:
2020-10-25 14:46:23 +00:00
command: wget -qO- ${CROSSCOMPILER} | tar xz -C /opt
no_output_timeout: 30m
2020-10-25 14:36:02 +00:00
- run: echo "export PATH=$(ls -d /opt/cross-pi-gcc-*/bin):\$PATH" >> $BASH_ENV
2020-10-25 15:51:24 +00:00
- run: cmake -DCMAKE_SYSTEM_PROCESSOR=armv6l -DCMAKE_TOOLCHAIN_FILE=${CIRCLE_WORKING_DIRECTORY}/raspberry.toolchain . && make
2020-10-25 14:36:02 +00:00
- run: cpack .
- run: mkdir -p /distrib && cp *.deb /distrib
- persist_to_workspace:
root: /
paths:
- distrib
build_rpi_armv7:
<<: *defaults
environment:
TAR_OPTIONS: --no-same-owner
CROSSCOMPILER: https://sourceforge.net/projects/raspberry-pi-cross-compilers/files/Raspberry%20Pi%20GCC%20Cross-Compiler%20Toolchains/Buster/GCC%2010.1.0/Raspberry%20Pi%202%2C%203/cross-gcc-10.1.0-pi_2-3.tar.gz
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
2020-10-25 14:36:02 +00:00
- run:
2020-10-25 14:46:23 +00:00
command: wget -qO- ${CROSSCOMPILER} | tar xz -C /opt
no_output_timeout: 30m
2020-10-25 14:36:02 +00:00
- run: echo "export PATH=$(ls -d /opt/cross-pi-gcc-*/bin):\$PATH" >> $BASH_ENV
2020-10-25 16:16:36 +00:00
- run: cmake -DCMAKE_SYSTEM_PROCESSOR=armv7 -DCMAKE_TOOLCHAIN_FILE=${CIRCLE_WORKING_DIRECTORY}/raspberry.toolchain . && make
2018-02-04 20:23:34 +00:00
- 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: /
2020-10-25 21:19:19 +00:00
- run: apt-get update; apt-get install -y --no-install-recommends golang
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: false
2019-01-25 20:28:46 +00:00
steps:
- checkout
- run: git submodule update --init
- run:
command: |
2019-04-01 22:17:31 +00:00
export TAG=${CIRCLE_TAG:-latest}
2019-01-26 15:20:50 +00:00
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: false
2019-01-25 20:28:46 +00:00
steps:
- checkout
- run: git submodule update --init
- run:
command: |
2019-04-01 22:17:31 +00:00
export TAG=${CIRCLE_TAG:-latest}
2019-01-26 15:20:50 +00:00
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-03-31 14:34:58 +00:00
# -------------------------------------
# publish docker arm
# -------------------------------------
publish_docker_linuxarm32v6:
machine:
docker_layer_caching: false
2019-03-31 14:34:58 +00:00
steps:
- checkout
- run: git submodule update --init
- run:
command: |
export TAG=${CIRCLE_TAG:-latest}
docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
docker build --build-arg ARCH=armv6l --pull -t $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v6 -f Dockerfile.rpi .
docker push $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v6
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-04-01 22:17:31 +00:00
export TAG=${CIRCLE_TAG:-latest}
2019-03-31 20:54:31 +00:00
echo "create manifest"
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 $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v6
2019-01-26 15:20:50 +00:00
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
2020-03-21 22:13:01 +00:00
docker manifest annotate $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG} $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}-arm32v6 --os linux --arch arm --variant v6l
2019-04-01 22:29:10 +00:00
docker manifest inspect $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME:${TAG}
2019-03-31 20:54:31 +00:00
echo "push manifest"
2019-01-26 15:20:50 +00:00
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: /.*/
2020-10-25 14:38:24 +00:00
- build_rpi_armv6:
2018-03-03 10:48:31 +00:00
filters:
tags:
2020-10-25 14:38:24 +00:00
only: /.*/
- build_rpi_armv7:
2020-10-25 14:40:12 +00:00
filters:
tags:
only: /.*/
2018-03-03 10:48:31 +00:00
- build_mips:
filters:
tags:
only: /.*/
- store_artifact:
requires:
- build_x86_64
2020-10-25 14:36:02 +00:00
- build_rpi_armv6
- build_rpi_armv7
2018-03-03 10:48:31 +00:00
- build_mips
filters:
tags:
only: /.*/
- github_release:
requires:
- build_x86_64
2020-10-25 14:36:02 +00:00
- build_rpi_armv6
- build_rpi_armv7
- 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: /.*/
2019-03-31 14:34:58 +00:00
- publish_docker_linuxarm32v6:
filters:
tags:
only: /.*/
2019-01-25 20:28:46 +00:00
- publish_docker_multiarch:
requires:
- publish_docker_linuxamd64
- publish_docker_linuxarm32v7
2019-03-31 14:34:58 +00:00
- publish_docker_linuxarm32v6
2019-01-25 20:28:46 +00:00
filters:
tags:
only: /.*/