Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

CI: Fix tests #40

Merged
merged 5 commits into from
Jan 27, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rootfs-builder/centos/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
FROM centos:7

ADD https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz /tmp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, but we're hard-coding more into these Dockerfile's which is going to make them more difficult to maintain.

I'd rather we fix #31 first (maybe as one of the commits on this PR) to avoid this. These 2 chunks of code are identical too which lends weight to doing that as you could add something like:

FROM centos:@centos_version@

@centos_install_go@

And,

from euleros:@euleros_version@

# EulerOS is similar enough to CentOS to re-use this code.
@centos_install_go@

Lastly, there is the issue of the version of golang. The CI systems for the various code repos are using go 1.8.3 so we're in danger of repeating clearcontainers/packaging#257.

Could you create a top-level ./versions.txt containing a go_version= so that it's defined in a single location? It maybe be best to default to 1.8.3 for now and raise an issue to discuss go version support separately.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is a good point, let me add Dockerfile templates.

RUN tar -C /usr/ -xzf /tmp/go1.9.2.linux-amd64.tar.gz
RUN yum install -y make
ENV GOROOT=/usr/go
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
6 changes: 6 additions & 0 deletions rootfs-builder/euleros/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
FROM euleros:2.2

ADD https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz /tmp
RUN tar -C /usr/ -xzf /tmp/go1.9.2.linux-amd64.tar.gz
RUN yum install -y make
ENV GOROOT=/usr/go
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
5 changes: 3 additions & 2 deletions rootfs-builder/fedora/rootfs_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ installonly_limit=3
#Dont use the default dnf reposdir
#this will prevent to use host repositories
reposdir=/root/mash
retries=5

[kata]
name=Fedora \$releasever - \$basearch
name=Fedora ${OS_VERSION} - \$basearch
failovermethod=priority
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-\$releasever&arch=\$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-${OS_VERSION}&arch=\$basearch
enabled=1
gpgcheck=0
EOF
Expand Down
2 changes: 1 addition & 1 deletion tests/image_creation.bats
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function build_image()
distro="$1"
[ -n "$distro" ]
local rootfs="${tmp_dir}/rootfs-osbuilder"
sudo -E ${rootfs_sh} -r "${rootfs}" fedora
sudo -E ${rootfs_sh} -r "${rootfs}" "${distro}"
sudo ${image_builder_sh} -s ${image_size} -o "${tmp_dir}/image.img" "${rootfs}"
}

Expand Down