mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-09-06 21:51:41 +00:00
Add clearlinux/clr-installer-ci Docker Image
This pull request introduces an image to be used for running the Clear Linux OS Installer continuous integration on Travis. Previously, a very large part of the test time in Travis was spent building adding the required bundle to the standard Clear Linux Docker image to properly setup the test environment. Please ensure that auto-trigger is enabled so that this image is automatically rebuilt with each new base clearlinux docker image. Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
FROM clearlinux:latest
|
||||
MAINTAINER mark.d.horn@intel.com
|
||||
|
||||
# Configure Go
|
||||
ENV GOPATH="/go" PATH="/go/bin:${PATH}"
|
||||
|
||||
# Configure trust
|
||||
RUN clrtrust generate && \
|
||||
# Update and add bundles
|
||||
swupd update && \
|
||||
swupd bundle-add sysadmin-basic storage-utils network-basic go-basic-dev git telemetrics && \
|
||||
# Install the Go Linters
|
||||
go get -u gopkg.in/alecthomas/gometalinter.v2 && \
|
||||
gometalinter.v2 --install
|
||||
@@ -0,0 +1,72 @@
|
||||
# Clear Linux* OS Installer CI Container
|
||||
[](https://microbadger.com/images/clearlinux/clr-installer-ci "Get your own image badge on microbadger.com")
|
||||
[](https://microbadger.com/images/clearlinux/clr-installer-ci "Get your own version badge on microbadger.com")
|
||||
|
||||
This repo provides a Clear Linux* container for running the Clear Linux
|
||||
OS Installer CI on Travis. This container has all of the packages and
|
||||
tools installed to build Clear Linux OS Installer from source and run
|
||||
its test suite.
|
||||
|
||||
# Build
|
||||
## Building Locally
|
||||
```
|
||||
docker build -t clearlinux/clr-installer-ci .
|
||||
```
|
||||
> #### Note:
|
||||
> If you are behind a firewall, you may need to pass proxy settings to the
|
||||
> build environment:
|
||||
>
|
||||
> `--build-arg https_proxy="$https_proxy"`
|
||||
>
|
||||
> `--build-arg http_proxy="$http_proxy"`
|
||||
>
|
||||
> `--build-arg no_proxy="$no_proxy"`
|
||||
>
|
||||
> flags to docker build; note these only impact the Build Environment and
|
||||
> will not become part of the image being built.
|
||||
|
||||
## Pulling from Docker Hub
|
||||
```
|
||||
docker pull clearlinux/clr-installer-ci
|
||||
```
|
||||
|
||||
## Running the clr-installer-ci Container
|
||||
```
|
||||
docker run --network=host --name clear-test -v $(pwd):/travis -v /dev:/dev -v /var/tmp/test:/tmp -v /sys/fs/cgroup:/sys/fs/cgroup:ro -e container=docker --privileged --tmpfs /run --tmpfs /run/lock -dit --rm clearlinux/clr-installer-ci:latest /sbin/init
|
||||
```
|
||||
|
||||
## Configure Travis to build and run the Dockerfile
|
||||
In your Travis config (`.travis.yml`), build and run your above `Dockerfile`. An
|
||||
example `.travis.yml` file is as follows:
|
||||
```
|
||||
sudo: required
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
# This is just here for Travis CI to report correctly
|
||||
language: go
|
||||
go:
|
||||
- "1.10" # quote this or 1.10 is treated as 1.1 (floating point number)
|
||||
|
||||
before_install:
|
||||
- docker pull clearlinux/clr-installer-ci
|
||||
- docker run --network=host --name clear-test -v $(pwd):/travis -v /dev:/dev -v /var/tmp/test:/tmp -v /sys/fs/cgroup:/sys/fs/cgroup:ro -e container=docker --privileged --tmpfs /run --tmpfs /run/lock -dit --rm clearlinux/clr-installer-ci:latest /sbin/init
|
||||
- docker ps
|
||||
|
||||
# Do NOT use -l (login) for the bash shell or the default profile
|
||||
# (/usr/share/defaults/etc/profile) will reset PATH removing the
|
||||
# GOPATH/bin added to the clr-installer-ci Docker image.
|
||||
|
||||
before_script:
|
||||
- docker exec -it clear-test bash -c "swupd info"
|
||||
|
||||
script:
|
||||
- docker exec -it clear-test bash -c "cd /travis ; make dist-clean"
|
||||
- docker exec -it clear-test bash -c "cd /travis ; make"
|
||||
- docker exec -it clear-test bash -c "cd /travis ; make lint"
|
||||
- travis_retry docker exec -it clear-test bash -c "cd /travis ; make check"
|
||||
|
||||
after_script:
|
||||
- docker container stop clear-test
|
||||
```
|
||||
Reference in New Issue
Block a user