2020-03-02 22:22:14 +03:00
// Documentation: https://github.com/coreos/coreos-ci/blob/master/README-upstream-ci.md
2020-02-03 18:42:28 +03:00
stage("Build") {
2020-02-03 23:45:07 +03:00
parallel normal: {
2020-03-02 22:22:14 +03:00
cosaPod(buildroot: true, runAsUser: 0) {
2020-02-03 18:42:28 +03:00
checkout scm
2020-02-03 23:45:07 +03:00
stage("Core build") {
2020-03-02 22:22:14 +03:00
shwrap("""
# fetch tags so `git describe` gives a nice NEVRA when building the RPM
git fetch origin --tags
git submodule update --init
2020-02-03 18:42:28 +03:00
2020-03-02 22:22:14 +03:00
env SKIP_INSTALLDEPS=1 ./ci/build.sh
""")
2020-02-03 23:45:07 +03:00
}
stage("Unit tests") {
2020-03-02 22:22:14 +03:00
try {
shwrap("""
make check
make syntax-check
""")
} finally {
archiveArtifacts allowEmptyArchive: true, artifacts: 'test-suite.log'
}
2020-02-03 23:45:07 +03:00
}
2020-03-02 22:22:14 +03:00
shwrap("""
2020-02-03 23:45:07 +03:00
make install DESTDIR=\$(pwd)/insttree/
tar -c -C insttree/ -zvf insttree.tar.gz .
2020-03-02 22:22:14 +03:00
""")
2020-02-03 23:45:07 +03:00
stash includes: 'insttree.tar.gz', name: 'build'
}
},
// A minimal build, helps test our build options
minimal: {
2020-03-02 22:22:14 +03:00
cosaPod(buildroot: true, runAsUser: 0) {
2020-02-03 23:45:07 +03:00
checkout scm
2020-03-02 22:22:14 +03:00
shwrap("""
2020-02-03 23:45:07 +03:00
git submodule update --init
2020-02-03 18:42:28 +03:00
env NOCONFIGURE=1 ./autogen.sh
2020-02-03 23:45:07 +03:00
./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 \
2020-04-16 17:15:04 +03:00
--disable-experimental-api --without-libsodium
2020-02-03 18:42:28 +03:00
make
2020-03-02 22:22:14 +03:00
""")
2020-02-03 18:42:28 +03:00
}
},
codestyle: {
2020-03-02 22:22:14 +03:00
cosaPod {
2020-02-03 18:42:28 +03:00
checkout scm
2020-03-02 22:22:14 +03:00
shwrap("""
2020-02-03 18:42:28 +03:00
# 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
2020-03-02 22:22:14 +03:00
""")
2020-02-03 18:42:28 +03:00
}
}
}
2020-02-03 23:45:07 +03:00
// Build FCOS and do a kola basic run
stage("More builds and test") {
parallel fcos: {
2020-03-28 17:04:31 +03:00
cosaPod(buildroot: true, runAsUser: 0, memory: "3072Mi", cpu: "4") {
2020-02-03 23:45:07 +03:00
stage("Build FCOS") {
checkout scm
unstash 'build'
2020-03-02 22:22:14 +03:00
shwrap("""
2020-02-03 23:45:07 +03:00
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
2020-04-21 22:25:40 +03:00
coreos-assembler fetch
2020-02-03 23:45:07 +03:00
coreos-assembler build
2020-05-27 15:52:07 +03:00
# Install the tests
make -C tests/kolainst install
2020-03-02 22:22:14 +03:00
""")
2020-02-03 23:45:07 +03:00
}
2020-04-15 19:36:52 +03:00
fcosKola(cosaDir: "${env.WORKSPACE}")
2020-02-03 23:45:07 +03:00
}
},
buildopts: {
2020-03-02 22:22:14 +03:00
cosaPod(buildroot: true, runAsUser: 0) {
2020-02-03 23:45:07 +03:00
checkout scm
2020-03-02 22:22:14 +03:00
shwrap("""
2020-02-03 23:45:07 +03:00
git submodule update --init
git worktree add build-rust && cd build-rust
env CONFIGOPTS="--enable-rust" SKIP_INSTALLDEPS=1 ./ci/build.sh
make check TESTS=tests/test-rollsum
cd .. && rm -rf build-rust
git worktree add build-libsoup && cd build-libsoup
env CONFIGOPTS="--without-curl --without-openssl --with-soup" SKIP_INSTALLDEPS=1 ./ci/build.sh
make check
cd .. && rm -rf build-libsoup
2020-03-02 22:22:14 +03:00
""")
2020-02-03 23:45:07 +03:00
}
}
}