ci: Consistently source libbuild
Since we need to set HOME and PATH, let's do that in a central place rather than scattering it around by having all of our entrypoint scripts source the `libbuild.sh` shell "library". Move the CoreOS CI entrypoint into a script like the others.
This commit is contained in:
parent
6fcfaee948
commit
7268ac9875
@ -5,22 +5,9 @@ parallel rpms: {
|
||||
def n = 5
|
||||
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
|
||||
checkout scm
|
||||
shwrap("""
|
||||
# fetch tags so `git describe` gives a nice NEVRA when building the RPM
|
||||
git fetch origin --tags
|
||||
git submodule update --init
|
||||
ci/installdeps.sh
|
||||
ci/install-extra-builddeps.sh
|
||||
# Not in the path by default
|
||||
export PATH="\$HOME/.cargo/bin:\$PATH"
|
||||
# Our primary CI build goes via RPM rather than direct to binaries
|
||||
# to better test that path, including our vendored spec file, etc.
|
||||
# The RPM build expects pre-generated bindings, so do that now.
|
||||
make -f Makefile.bindings bindings
|
||||
cd packaging
|
||||
RPM_BUILD_NCPUS=${n} make -f Makefile.dist-packaging rpm
|
||||
mv \$(find . -name '*.rpm') ..
|
||||
""")
|
||||
shwrap("""RPM_BUILD_NCPUS=${n} ./ci/coreosci-rpmbuild.sh
|
||||
mv packaging/*/*.rpm .
|
||||
""")
|
||||
// make it easy for anyone to download the RPMs
|
||||
archiveArtifacts '*.rpm'
|
||||
stash excludes: '*.src.rpm', includes: '*.rpm', name: 'rpms'
|
||||
|
@ -7,9 +7,5 @@ set -xeuo pipefail
|
||||
|
||||
dn=$(dirname $0)
|
||||
. ${dn}/libbuild.sh
|
||||
|
||||
# add cargo's directory to the PATH like we do in CoreOS CI
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
|
||||
${dn}/build.sh
|
||||
make check
|
||||
|
@ -7,7 +7,6 @@ dn=$(dirname $0)
|
||||
. ${dn}/libbuild.sh
|
||||
|
||||
${dn}/install-extra-builddeps.sh
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
${dn}/installdeps.sh
|
||||
# make it clear what rustc version we're compiling with (this is grepped in CI)
|
||||
rustc --version
|
||||
|
@ -7,10 +7,6 @@ set -xeuo pipefail
|
||||
|
||||
dn=$(dirname $0)
|
||||
. ${dn}/libbuild.sh
|
||||
|
||||
# add cargo's directory to the PATH like we do in CoreOS CI
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
|
||||
export CC=clang CXX=clang++
|
||||
${dn}/build.sh
|
||||
make check
|
||||
|
@ -2,5 +2,6 @@
|
||||
set -xeuo pipefail
|
||||
# Add cheap (non-building) checks here
|
||||
dn=$(dirname $0)
|
||||
. ${dn}/libbuild.sh
|
||||
${dn}/codestyle.sh
|
||||
${dn}/ci-commitmessage-submodules.sh
|
||||
|
17
ci/coreosci-rpmbuild.sh
Executable file
17
ci/coreosci-rpmbuild.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
dn=$(dirname $0)
|
||||
. ${dn}/libbuild.sh
|
||||
|
||||
# fetch tags so `git describe` gives a nice NEVRA when building the RPM
|
||||
git fetch origin --tags
|
||||
git submodule update --init --recursive
|
||||
ci/installdeps.sh
|
||||
ci/install-extra-builddeps.sh
|
||||
# Our primary CI build goes via RPM rather than direct to binaries
|
||||
# to better test that path, including our vendored spec file, etc.
|
||||
# The RPM build expects pre-generated bindings, so do that now.
|
||||
make -f Makefile.bindings bindings
|
||||
cd packaging
|
||||
make -f Makefile.dist-packaging rpm
|
@ -5,6 +5,8 @@
|
||||
if test -z "$HOME" || test ! -w "$HOME"; then
|
||||
export HOME=$(mktemp -d -t --suffix .prowhome)
|
||||
fi
|
||||
# In some cases we install tools via cargo, ensure that's in PATH
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
|
||||
pkg_upgrade() {
|
||||
echo "Running dnf -y distro-sync... $(date)"
|
||||
|
@ -1,7 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
dn=$(dirname $0)
|
||||
. ${dn}/libbuild.sh
|
||||
|
||||
ci/installdeps.sh
|
||||
ci/install-extra-builddeps.sh
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
ci/build.sh
|
||||
|
Loading…
Reference in New Issue
Block a user