openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.98k stars 3.47k forks source link

Using our CircleCI Docker images for integration testing #7735

Open thess opened 5 years ago

thess commented 5 years ago

I have put together a couple of bash scripts to setup and use the Docker OpenWrt integration test environment along the lines of our current CircleCI 'buildpr' check.

If you don't have Docker installed, you must first do that. It should be available for your distro. (I have only tested this on Ubuntu 18.04/bionic with Docker.io)

There are 2 scripts (attached ci-testing.zip) - You can customize the shell variables defined at the top of each for your specific environment. Ex: location of build-root, package-tree, SDK location and branch selection, etc.. Normally, these scripts are located in your OpenWrt buildroot.

The first script docker-startup launches the Docker image from our public repository and maps your package source tree into the container. It then copies the 2nd script into /home/build directory and then enters the running container.

The second script build-package will download the SDK, un-pack it and setup a single package build using a nearly identical procedure as the CircleCI integration check. Upon entering the Docker container, you can:

cd /home/build
./build-package <package-name>

ci-testing.zip

thess commented 5 years ago

@neheb , @cotequeiroz - Here's something I hope you might find useful for testing your builds locally in an SDK environment similar to the packages buildbot production and CircleCI checks.

danielfdickinson commented 5 years ago

@thess Awesome! Thank you. I'm interested in this too.

danielfdickinson commented 5 years ago

Er, why unpinned? Or at least could there be pinned a way to have builds configured and commands used to be close to CircleCI (e.g. for me USERID conflicts in packages don't error out locally and prevent feeds installation, but with the config (or commands) used with CircleCI it does)).

thess commented 5 years ago

@heil - A few words of explanation would have been nice before you unilaterally unpinned my post. Was it something I said? How would you do it differently?

Andy2244 commented 5 years ago

ah nice, i use something similar to get a clean, reproduce-able package build environment and to automatically test some PR/patches against the SDK's. https://github.com/Andy2244/openwrt-package-builder