David Caro has uploaded a new change for review. Change subject: Added unboundid-ldapsdk jobs ......................................................................
Added unboundid-ldapsdk jobs That include releng based scripts and templates Change-Id: Id236668a2312a8205b8b7bbaafa775f316cc30df Signed-off-by: David Caro <[email protected]> --- A jobs/confs/shell-scripts/build_local_srcrpm.sh A jobs/confs/shell-scripts/build_local_srcrpm_releng.sh C jobs/confs/shell-scripts/build_mock_srcrpm_releng.sh R jobs/confs/shell-scripts/mock_build_onlyrpm.sh M jobs/confs/yaml/builders/mock_install.yaml M jobs/confs/yaml/builders/rpm_mock.yaml A jobs/confs/yaml/jobs/unboundid-ldapsdk/unboundid-ldapsdk_create-rpms.yaml A jobs/confs/yaml/scms/releng-tools.yaml M jobs/confs/yaml/templates/create-rpms_mock.yaml 9 files changed, 200 insertions(+), 79 deletions(-) git pull ssh://gerrit.ovirt.org:29418/jenkins refs/changes/96/29296/1 diff --git a/jobs/confs/shell-scripts/build_local_srcrpm.sh b/jobs/confs/shell-scripts/build_local_srcrpm.sh new file mode 100644 index 0000000..5f3ce73 --- /dev/null +++ b/jobs/confs/shell-scripts/build_local_srcrpm.sh @@ -0,0 +1,55 @@ +#!/bin/bash -xe +# shell-scripts/build_local_srcrpm.sh +# PARAMETERS +# +# project +# Name of the project it runs on, specifically the dir where the code +# has been cloned +# +# extra-configure-options +# extra options to pass to configure +# +# extra-autogen-options +# extra options to pass to autogen +# +# extra-rpmbuild-options +# extra options to pass to rpmbuild as defines, as a spaceseparated list +# of key=value pairs +# +# env +# extra env variables to set when building + +project="{project}" +extra_configure_options=({extra-configure-options}) +extra_autogen_options=({extra-autogen-options}) +extra_rpmbuild_options=({extra-rpmbuild-options}) +extra_env="{env}" +WORKSPACE=$PWD + + +# Build the src_rpms +# Get the release suffix +pushd "$WORKSPACE/$project" +suffix=".$(date -u +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD)" + +# make sure it's properly clean +git clean -dxf +# build tarballs +./autogen.sh --system "${{extra_autogen_options[@]}}" +./configure "${{extra_configure_options[@]}}" +make dist +mv *.tar.gz "$WORKSPACE"/exported-artifacts/ +popd + +## build src.rpm +rpmbuild_options=("-D" "release_suffix ${{suffix}}") +for option in $extra_rpmbuild_options; do + rpmbuild_options+=("-D" "${{option//=/ }}") +done +rpmbuild \ + -D "_topdir $WORKSPACE/rpmbuild" \ + -D "_srcrpmdir $WORKSPACE/exported-artifacts" \ + "${{rpmbuild_options[@]}}" \ + -ts exported-artifacts/*.gz +## we don't need the rpmbuild dir no more +rm -Rf "$WORKSPACE"/rpmbuild diff --git a/jobs/confs/shell-scripts/build_local_srcrpm_releng.sh b/jobs/confs/shell-scripts/build_local_srcrpm_releng.sh new file mode 100644 index 0000000..d40bc48 --- /dev/null +++ b/jobs/confs/shell-scripts/build_local_srcrpm_releng.sh @@ -0,0 +1,27 @@ +#!/bin/bash -xe +# shell-scripts/build_local_srcrpm_releng.sh +# PARAMETERS +# +# subproject +# Name of the subproject it runs on, specifically the dir where the code +# has been cloned +# +# extra-build-options +# extra options to pass to the build.sh script +# +# env +# extra env variables to set when building + +subproject="{subproject}" +extra_build_options=({extra-build-options}) +extra_env="{env}" +WORKSPACE=$PWD + +# Build the src_rpms +# Get the release suffix +pushd "$WORKSPACE/releng-tools/specs/$subproject" +# make sure it's properly clean +git clean -dxf +# build srcrpm +./build.sh "${{extra_build_options[@]}}" +mv *src.rpm exported-artifacts/ diff --git a/jobs/confs/shell-scripts/mock_build_onlyrpm.sh.inc b/jobs/confs/shell-scripts/build_mock_srcrpm_releng.sh similarity index 67% copy from jobs/confs/shell-scripts/mock_build_onlyrpm.sh.inc copy to jobs/confs/shell-scripts/build_mock_srcrpm_releng.sh index 48472a5..7954ffd 100644 --- a/jobs/confs/shell-scripts/mock_build_onlyrpm.sh.inc +++ b/jobs/confs/shell-scripts/build_mock_srcrpm_releng.sh @@ -1,6 +1,9 @@ #!/bin/bash -xe -# Do some black magic +# shell-scripts/build_mock_srcrpm_releng.sh # PARAMETERS +# +# subproject +# Internal subproject in releng repo to build # # project # Name of the project it runs on, specifically the dir where the code @@ -13,15 +16,9 @@ # arch # Architecture to build the packages for # -# extra-packages +# extra-build-packages # space separated list of extra packages to install, as you would pass to # yum -# -# extra-configure-options -# extra options to pass to configure -# -# extra-autogen-options -# extra options to pass to autogen # # extra-rpmbuild-options # extra options to pass to rpmbuild as defines, as a spaceseparated list @@ -37,46 +34,21 @@ distro="{distro}" arch="{arch}" project="{project}" -extra_packages=({extra-packages}) -extra_configure_options=({extra-configure-options}) -extra_autogen_options=({extra-autogen-options}) +subproject="{subproject}" +extra_packages=({extra-build-packages}) extra_rpmbuild_options=({extra-rpmbuild-options}) extra_repos=({extra-repos}) extra_env="{env}" - WORKSPACE=$PWD -# Build the src_rpms -# Get the release suffix -pushd "$WORKSPACE/$project" -suffix=".$(date -u +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD)" - -# make sure it's properly clean -git clean -dxf -# build tarballs -./autogen.sh --system "${{extra_autogen_options[@]}}" -./configure "${{extra_configure_options[@]}}" -make dist -mv *.tar.gz "$WORKSPACE"/exported-artifacts/ -popd - -## build src.rpm +### Generate the mock configuration rpmbuild_options=("-D" "release_suffix ${{suffix}}") mock_build_options=("--define" "release_suffix ${{suffix}}") for option in $extra_rpmbuild_options; do rpmbuild_options+=("-D" "${{option//=/ }}") mock_build_options+=("--define" "${{option//=/ }}") done -rpmbuild \ - -D "_topdir $WORKSPACE/rpmbuild" \ - -D "_srcrpmdir $WORKSPACE/exported-artifacts" \ - "${{rpmbuild_options[@]}}" \ - -ts exported-artifacts/*.gz -## we don't need the rpmbuild dir no more -rm -Rf "$WORKSPACE"/rpmbuild - -### Generate the mock configuration pushd "$WORKSPACE"/jenkins/mock_configs arch="{arch}" case $distro in @@ -84,7 +56,7 @@ el*) distribution="epel-${{distro#el}}";; *) echo "Unknown distro $distro"; exit 1;; esac -mock_conf="${{distribution}}-$arch-ovirt-snapshot" +mock_conf="${{distribution}}-$arch-custom" mock_repos='' for mock_repo in "${{extra_repos[@]}}"; do mock_repos+=" --repo=$mock_repo" @@ -127,11 +99,25 @@ EOF fi -### Build the rpms -echo "##### Building the rpms" +### Build the srpms +echo "##### Copying repo into chroot" $my_mock \ - "${{mock_build_options[@]}}" \ - --rebuild \ --no-clean \ - --resultdir=$WORKSPACE/exported-artifacts \ - "$WORKSPACE"/exported-artifacts/*.src.rpm + --copyin "$WORKSPACE"/$project/specs/$subproject /tmp/$subproject + +echo "##### Building the srpms" +$my_mock \ + --no-clean \ + --shell <<EOF +cd /tmp/$subproject +./build.sh "${{extra_build_options[@]}}" +mkdir /tmp/SRCRPMS +mv *src.rpm /tmp/SRCRPMS/ +EOF + +echo "#### Archiving the results" +$my_mock \ + --no-clean \ + --copyout /tmp/SRCRPMS ./SRCRPMS +mv ./SRCRPMS/* "$WORKSPACE"/exported-artifacts/ +rm -Rf ./SRCRPMS diff --git a/jobs/confs/shell-scripts/mock_build_onlyrpm.sh.inc b/jobs/confs/shell-scripts/mock_build_onlyrpm.sh similarity index 75% rename from jobs/confs/shell-scripts/mock_build_onlyrpm.sh.inc rename to jobs/confs/shell-scripts/mock_build_onlyrpm.sh index 48472a5..2bbfd3c 100644 --- a/jobs/confs/shell-scripts/mock_build_onlyrpm.sh.inc +++ b/jobs/confs/shell-scripts/mock_build_onlyrpm.sh @@ -1,5 +1,5 @@ #!/bin/bash -xe -# Do some black magic +# shell-scripts/mock_build_onlyrpm.sh # PARAMETERS # # project @@ -17,12 +17,6 @@ # space separated list of extra packages to install, as you would pass to # yum # -# extra-configure-options -# extra options to pass to configure -# -# extra-autogen-options -# extra options to pass to autogen -# # extra-rpmbuild-options # extra options to pass to rpmbuild as defines, as a spaceseparated list # of key=value pairs @@ -38,45 +32,19 @@ arch="{arch}" project="{project}" extra_packages=({extra-packages}) -extra_configure_options=({extra-configure-options}) -extra_autogen_options=({extra-autogen-options}) extra_rpmbuild_options=({extra-rpmbuild-options}) extra_repos=({extra-repos}) extra_env="{env}" - WORKSPACE=$PWD -# Build the src_rpms -# Get the release suffix -pushd "$WORKSPACE/$project" -suffix=".$(date -u +%Y%m%d%H%M%S).git$(git rev-parse --short HEAD)" - -# make sure it's properly clean -git clean -dxf -# build tarballs -./autogen.sh --system "${{extra_autogen_options[@]}}" -./configure "${{extra_configure_options[@]}}" -make dist -mv *.tar.gz "$WORKSPACE"/exported-artifacts/ -popd - -## build src.rpm +### Generate the mock configuration rpmbuild_options=("-D" "release_suffix ${{suffix}}") mock_build_options=("--define" "release_suffix ${{suffix}}") for option in $extra_rpmbuild_options; do rpmbuild_options+=("-D" "${{option//=/ }}") mock_build_options+=("--define" "${{option//=/ }}") done -rpmbuild \ - -D "_topdir $WORKSPACE/rpmbuild" \ - -D "_srcrpmdir $WORKSPACE/exported-artifacts" \ - "${{rpmbuild_options[@]}}" \ - -ts exported-artifacts/*.gz -## we don't need the rpmbuild dir no more -rm -Rf "$WORKSPACE"/rpmbuild - -### Generate the mock configuration pushd "$WORKSPACE"/jenkins/mock_configs arch="{arch}" case $distro in diff --git a/jobs/confs/yaml/builders/mock_install.yaml b/jobs/confs/yaml/builders/mock_install.yaml index f56a4aa..7c5a510 100644 --- a/jobs/confs/yaml/builders/mock_install.yaml +++ b/jobs/confs/yaml/builders/mock_install.yaml @@ -2,6 +2,7 @@ name: mock-onlyrpm-install builders: - shell: !include-raw shell-scripts/mock_setup.sh - - shell: !include-raw shell-scripts/mock_build_onlyrpm.sh.inc + - shell: !include-raw shell-scripts/build_local_srcrpm.sh + - shell: !include-raw shell-scripts/mock_build_onlyrpm.sh - shell: !include-raw shell-scripts/mock_install.sh - shell: !include-raw shell-scripts/mock_cleanup.sh diff --git a/jobs/confs/yaml/builders/rpm_mock.yaml b/jobs/confs/yaml/builders/rpm_mock.yaml index c43fa4e..94fd491 100644 --- a/jobs/confs/yaml/builders/rpm_mock.yaml +++ b/jobs/confs/yaml/builders/rpm_mock.yaml @@ -2,5 +2,22 @@ name: mock-onlyrpm builders: - shell: !include-raw shell-scripts/mock_setup.sh - - shell: !include-raw shell-scripts/mock_build_onlyrpm.sh.inc + - shell: !include-raw shell-scripts/build_local_srcrpm.sh + - shell: !include-raw shell-scripts/mock_build_onlyrpm.sh + - shell: !include-raw shell-scripts/mock_cleanup.sh + +- builder: + name: mock-onlyrpm-releng + builders: + - shell: !include-raw shell-scripts/mock_setup.sh + - shell: !include-raw shell-scripts/build_local_srcrpm_releng.sh + - shell: !include-raw shell-scripts/mock_build_onlyrpm.sh + - shell: !include-raw shell-scripts/mock_cleanup.sh + +- builder: + name: mock-all-releng + builders: + - shell: !include-raw shell-scripts/mock_setup.sh + - shell: !include-raw shell-scripts/build_mock_srcrpm_releng.sh + - shell: !include-raw shell-scripts/mock_build_onlyrpm.sh - shell: !include-raw shell-scripts/mock_cleanup.sh diff --git a/jobs/confs/yaml/jobs/unboundid-ldapsdk/unboundid-ldapsdk_create-rpms.yaml b/jobs/confs/yaml/jobs/unboundid-ldapsdk/unboundid-ldapsdk_create-rpms.yaml new file mode 100644 index 0000000..1072e45 --- /dev/null +++ b/jobs/confs/yaml/jobs/unboundid-ldapsdk/unboundid-ldapsdk_create-rpms.yaml @@ -0,0 +1,22 @@ +- project: + name: unboundid-ldapsdk_create-rpms + project: + - releng-tools + subproject: + - unboundid-ldapsdk + trigger: + - created + - merged + branch: + - master + mock-build-type: + - all + distro: + - fc19 + - fc20 + - el6 + arch: + - x86_64 + jobs: + - '{subproject}_{branch}_create-rpms-{distro}-{arch}_{trigger}': + extra-build-packages: 'svn' diff --git a/jobs/confs/yaml/scms/releng-tools.yaml b/jobs/confs/yaml/scms/releng-tools.yaml new file mode 100644 index 0000000..fcbc052 --- /dev/null +++ b/jobs/confs/yaml/scms/releng-tools.yaml @@ -0,0 +1,16 @@ +- scm: + name: releng-tools-gerrit + scm: + - git: + url: git://gerrit.ovirt.org/releng-tools.git + branches: + - $GERRIT_BRANCH + basedir: releng-tools + scm-name: releng.tools + name: '' + refspec: $GERRIT_REFSPEC + choosing-strategy: gerrit + use-author: true + skip-tag: true + prune: true + wipe-workspace: false diff --git a/jobs/confs/yaml/templates/create-rpms_mock.yaml b/jobs/confs/yaml/templates/create-rpms_mock.yaml index d556f30..f51819e 100644 --- a/jobs/confs/yaml/templates/create-rpms_mock.yaml +++ b/jobs/confs/yaml/templates/create-rpms_mock.yaml @@ -23,3 +23,32 @@ extra-repos: '{extra-repos}' publishers: - exported-artifacts + +## Template for the releng-based jobs +- job-template: + name: '{subproject}_{branch}_create-rpms-{distro}-{arch}_{trigger}' + parameters: + - gerrit-params: + branch: '{branch}' + scm: + - '{project}-gerrit' + - jenkins: + branch: master + triggers: + - on-patch-{trigger}-with-files: + project: '{project}' + branch: '{branch}' + files: 'specs/{subproject}/.*' + builders: + - mock-{mock-build-type}-releng: + project: '{project}' + subproject: '{subproject}' + distro: '{distro}' + arch: '{arch}' + extra-packages: '{extra-packages}' + extra-build-packages: '{extra-build-packages}' + extra-rpmbuild-options: '{extra-rpmbuild-options}' + extra-build-options: '{extra-build-options}' + extra-repos: '{extra-repos}' + publishers: + - exported-artifacts -- To view, visit http://gerrit.ovirt.org/29296 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id236668a2312a8205b8b7bbaafa775f316cc30df Gerrit-PatchSet: 1 Gerrit-Project: jenkins Gerrit-Branch: master Gerrit-Owner: David Caro <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
