127b27ec6Sopenharmony_ci#!/bin/bash 227b27ec6Sopenharmony_ci 327b27ec6Sopenharmony_ciset -ex 427b27ec6Sopenharmony_ci 527b27ec6Sopenharmony_ci# Clone the oss-fuzz repository 627b27ec6Sopenharmony_cigit clone https://github.com/google/oss-fuzz.git /tmp/ossfuzz 727b27ec6Sopenharmony_ci 827b27ec6Sopenharmony_ciif [[ ! -d /tmp/ossfuzz/projects/lz4 ]] 927b27ec6Sopenharmony_cithen 1027b27ec6Sopenharmony_ci echo "Could not find the lz4 project in ossfuzz" 1127b27ec6Sopenharmony_ci exit 1 1227b27ec6Sopenharmony_cifi 1327b27ec6Sopenharmony_ci 1427b27ec6Sopenharmony_ci# Modify the oss-fuzz Dockerfile so that we're checking out the current branch on travis. 1527b27ec6Sopenharmony_ciif [ "x${TRAVIS_PULL_REQUEST}" = "xfalse" ] 1627b27ec6Sopenharmony_cithen 1727b27ec6Sopenharmony_ci sed -i "s@https://github.com/lz4/lz4.git@-b ${TRAVIS_BRANCH} https://github.com/lz4/lz4.git@" /tmp/ossfuzz/projects/lz4/Dockerfile 1827b27ec6Sopenharmony_cielse 1927b27ec6Sopenharmony_ci sed -i "s@https://github.com/lz4/lz4.git@-b ${TRAVIS_PULL_REQUEST_BRANCH} https://github.com/${TRAVIS_PULL_REQUEST_SLUG}.git@" /tmp/ossfuzz/projects/lz4/Dockerfile 2027b27ec6Sopenharmony_cifi 2127b27ec6Sopenharmony_ci 2227b27ec6Sopenharmony_ci# Try and build the fuzzers 2327b27ec6Sopenharmony_cipushd /tmp/ossfuzz 2427b27ec6Sopenharmony_cipython infra/helper.py build_image --pull lz4 2527b27ec6Sopenharmony_cipython infra/helper.py build_fuzzers lz4 2627b27ec6Sopenharmony_cipopd 27