-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is infrastructure that's oriented around Vagrant, we do builds inside the target VM (actually inside a Docker container), but then directly `make install DESTDIR=/host/`. The goal here is to have a convenient workflow for: - dev -> hand testing - dev -> run destructive tests Closes: #303 Approved by: jlebon
- Loading branch information
1 parent
6b07755
commit 77eb3e2
Showing
7 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM centos/tools | ||
ADD atomic-centos-continuous.repo /etc/yum.repos.d/atomic-centos-continuous.repo | ||
RUN yum -y install yum-plugin-priorities sudo && \ | ||
yum -y install bash bzip2 coreutils cpio diffutils system-release findutils gawk gcc gcc-c++ \ | ||
grep gzip info make patch redhat-rpm-config rpm-build sed shadow-utils tar unzip util-linux \ | ||
which xz python gcc \ | ||
&& yum-builddep -y rpm-ostree | ||
RUN groupadd -g 1000 vagrant && useradd -u 1000 -g vagrant -G wheel vagrant | ||
RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | ||
ADD host-install.sh /usr/local/bin/host-install | ||
LABEL RUN "/usr/bin/docker run --privileged -ti -v /var/home:/home -v /etc:/host/etc -v /usr:/host/usr \${IMAGE}" | ||
USER vagrant | ||
WORKDIR /home/vagrant/sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
all: | ||
echo "Targets: buildimg build install" | ||
|
||
buildimg: | ||
sudo docker build -t rpm-ostree-builder -f Dockerfile.builder . | ||
|
||
runbuilder=sudo /usr/bin/docker run --privileged -ti -v /var/home:/home -v /etc:/host/etc -v /usr:/host/usr rpm-ostree-builder | ||
|
||
build: | ||
$(runbuilder) /bin/sh -c 'if ! test -f configure; then env NOCONFIGURE=1 ./autogen.sh; fi' | ||
$(runbuilder) /bin/sh -c 'if ! test -f Makefile; then ./configure --prefix=/usr --libdir=/usr/lib64; fi' | ||
$(runbuilder) /bin/sh -c make -j 4 | ||
|
||
install: build | ||
$(runbuilder) sudo /usr/local/bin/host-install | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Using vmcheck | ||
============= | ||
|
||
One time setup: | ||
|
||
``` | ||
host$ vagrant up | ||
host$ vagrant ssh | ||
vm$ sudo rpm-ostree rebase centos-atomic-continuous:centos-atomic-host/7/x86_64/devel/continuous | ||
vm$ systemctl reboot | ||
``` | ||
|
||
Edit source code on the host system; to synchronize, use: | ||
|
||
``` | ||
vagrant rsync | ||
``` | ||
|
||
To build and install into the VM: | ||
|
||
``` | ||
host$ vagrant ssh | ||
vm$ cd ~/sync/tests/vmcheck | ||
vm$ make build | ||
vm$ make install | ||
vm$ systemctl restart rpm-ostreed | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[atomic-centos-continuous] | ||
baseurl=https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/build | ||
gpgcheck=0 | ||
priority=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -xeuo pipefail | ||
eval $(findmnt /host/usr -o OPTIONS -P) | ||
(IFS=,; | ||
for x in ${OPTIONS}; do | ||
if test ${x} == "ro"; then | ||
mount -o remount,rw /host/usr | ||
break | ||
fi | ||
done) | ||
make install DESTDIR=/host/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- hosts: all | ||
become: yes | ||
tasks: | ||
- command: ostree remote add --set=gpg-verify=false centos-atomic-continuous https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/ostree/repo/ | ||
args: | ||
creates: /etc/ostree/remotes.d/centos-atomic-continuous.conf | ||
|
||
- command: docker inspect rpm-ostree-builder | ||
failed_when: False | ||
changed_when: False | ||
register: inspect | ||
|
||
- name: build buildimg | ||
command: make buildimg | ||
args: | ||
chdir: sync/tests/vmcheck | ||
when: inspect.rc != 0 |