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-07-16 18:42:57 +03:00
def n = 5
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
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-07-16 18:42:57 +03:00
env MAKE_JOBS=${n} SKIP_INSTALLDEPS=1 ./ci/build.sh
2020-03-02 22:22:14 +03:00
""")
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-07-31 13:57:58 +03:00
coreos-assembler buildextend-metal
coreos-assembler buildextend-metal4k
2020-08-01 21:14:30 +03:00
coreos-assembler buildextend-live --fast
2020-05-27 15:52:07 +03:00
# Install the tests
2020-05-31 20:57:22 +03:00
# Build and install the tests
make -C tests/kolainst
2020-05-27 15:52:07 +03:00
make -C tests/kolainst install
2020-03-02 22:22:14 +03:00
""")
2020-02-03 23:45:07 +03:00
}
2020-07-31 13:57:58 +03:00
stage("Test") {
parallel metal: {
try {
2020-08-11 08:02:12 +03:00
shwrap("kola testiso -S --scenarios pxe-install,iso-offline-install,pxe-offline-install --output-dir tmp/kola-testiso-metal")
2020-07-31 13:57:58 +03:00
} finally {
2020-08-01 21:14:30 +03:00
shwrap("tar -cf - tmp/kola-testiso-metal/ | xz -c9 > ${env.WORKSPACE}/kola-testiso-metal.tar.xz")
2020-07-31 13:57:58 +03:00
archiveArtifacts allowEmptyArchive: true, artifacts: 'kola-testiso*.tar.xz'
}
}, kola: {
fcosKola(cosaDir: "${env.WORKSPACE}")
}
}
2020-02-03 23:45:07 +03:00
}
},
buildopts: {
2020-07-16 18:42:57 +03:00
def n = 5
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
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
2020-07-16 18:42:57 +03:00
env MAKE_JOBS=${n} CONFIGOPTS="--enable-rust" SKIP_INSTALLDEPS=1 ./ci/build.sh
2020-02-03 23:45:07 +03:00
make check TESTS=tests/test-rollsum
cd .. && rm -rf build-rust
git worktree add build-libsoup && cd build-libsoup
2020-07-16 18:42:57 +03:00
env MAKE_JOBS=${n} CONFIGOPTS="--without-curl --without-openssl --with-soup" SKIP_INSTALLDEPS=1 ./ci/build.sh
2020-02-03 23:45:07 +03:00
make check
cd .. && rm -rf build-libsoup
2020-03-02 22:22:14 +03:00
""")
2020-02-03 23:45:07 +03:00
}
}
}