mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-21 22:04:15 +03:00
61184163ea
This was my first experiment with using Rust in this way; I gained a lot of knowledge from it. But, we don't really gain anything from the code as it is today - while it is "bit fiddling" code, the C code is well tested. We have a lot of compile-time options, and trimming them will be helpful. We've also gotten pushback on hard requiring Rust client side. Instead, what I'd like to do is hopefully soon create an `ostree-system` crate that uses the existing `ostree` library and can contain code drained from the rpm-ostree Rust and used by other projects perhaps. So the goal here is really more Rust, but we need to focus our efforts on where it's most valuable.
118 lines
3.6 KiB
Plaintext
118 lines
3.6 KiB
Plaintext
// Documentation: https://github.com/coreos/coreos-ci/blob/master/README-upstream-ci.md
|
|
|
|
stage("Build") {
|
|
parallel normal: {
|
|
def n = 5
|
|
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
|
|
checkout scm
|
|
stage("Core build") {
|
|
shwrap("""
|
|
# fetch tags so `git describe` gives a nice NEVRA when building the RPM
|
|
git fetch origin --tags
|
|
git submodule update --init
|
|
|
|
env MAKE_JOBS=${n} SKIP_INSTALLDEPS=1 ./ci/build.sh
|
|
""")
|
|
}
|
|
stage("Unit tests") {
|
|
try {
|
|
shwrap("""
|
|
make check
|
|
make syntax-check
|
|
""")
|
|
} finally {
|
|
archiveArtifacts allowEmptyArchive: true, artifacts: 'test-suite.log'
|
|
}
|
|
}
|
|
shwrap("""
|
|
make install DESTDIR=\$(pwd)/insttree/
|
|
tar -c -C insttree/ -zvf insttree.tar.gz .
|
|
""")
|
|
stash includes: 'insttree.tar.gz', name: 'build'
|
|
}
|
|
},
|
|
// A minimal build, helps test our build options
|
|
minimal: {
|
|
cosaPod(buildroot: true, runAsUser: 0) {
|
|
checkout scm
|
|
shwrap("""
|
|
git submodule update --init
|
|
|
|
env NOCONFIGURE=1 ./autogen.sh
|
|
./configure --without-curl --without-soup --disable-gtk-doc --disable-man \
|
|
--disable-rust --without-libarchive --without-selinux --without-smack \
|
|
--without-openssl --without-avahi --without-libmount --disable-rofiles-fuse \
|
|
--disable-experimental-api --without-libsodium
|
|
make
|
|
""")
|
|
}
|
|
},
|
|
codestyle: {
|
|
cosaPod {
|
|
checkout scm
|
|
shwrap("""
|
|
# Jenkins by default only fetches the branch it's testing. Explicitly fetch master
|
|
# for ci-commitmessage-submodules.sh
|
|
git fetch origin +refs/heads/master:refs/remotes/origin/master
|
|
ci/ci-commitmessage-submodules.sh
|
|
""")
|
|
}
|
|
}
|
|
}
|
|
|
|
// Build FCOS and do a kola basic run
|
|
stage("More builds and test") {
|
|
parallel fcos: {
|
|
cosaPod(buildroot: true, runAsUser: 0, memory: "3072Mi", cpu: "4") {
|
|
stage("Build FCOS") {
|
|
checkout scm
|
|
unstash 'build'
|
|
shwrap("""
|
|
mkdir insttree
|
|
tar -C insttree -xzvf insttree.tar.gz
|
|
rsync -rlv insttree/ /
|
|
coreos-assembler init --force https://github.com/coreos/fedora-coreos-config
|
|
mkdir -p overrides/rootfs
|
|
mv insttree/* overrides/rootfs/
|
|
rmdir insttree
|
|
coreos-assembler fetch
|
|
coreos-assembler build
|
|
coreos-assembler buildextend-metal
|
|
coreos-assembler buildextend-metal4k
|
|
coreos-assembler buildextend-live --fast
|
|
# Install the tests
|
|
# Build and install the tests
|
|
make -C tests/kolainst
|
|
make -C tests/kolainst install
|
|
""")
|
|
}
|
|
stage("Test") {
|
|
parallel metal: {
|
|
try {
|
|
shwrap("kola testiso -S --scenarios pxe-install,iso-offline-install,pxe-offline-install --output-dir tmp/kola-testiso-metal")
|
|
} finally {
|
|
shwrap("tar -cf - tmp/kola-testiso-metal/ | xz -c9 > ${env.WORKSPACE}/kola-testiso-metal.tar.xz")
|
|
archiveArtifacts allowEmptyArchive: true, artifacts: 'kola-testiso*.tar.xz'
|
|
}
|
|
}, kola: {
|
|
fcosKola(cosaDir: "${env.WORKSPACE}")
|
|
}
|
|
}
|
|
}
|
|
},
|
|
buildopts: {
|
|
def n = 5
|
|
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
|
|
checkout scm
|
|
shwrap("""
|
|
git submodule update --init
|
|
|
|
git worktree add build-libsoup && cd build-libsoup
|
|
env MAKE_JOBS=${n} CONFIGOPTS="--without-curl --without-openssl --with-soup" SKIP_INSTALLDEPS=1 ./ci/build.sh
|
|
make check
|
|
cd .. && rm -rf build-libsoup
|
|
""")
|
|
}
|
|
}
|
|
}
|