From: Alfredo Deza Date: Thu, 1 Dec 2016 14:51:06 +0000 (-0500) Subject: ceph-dev-new-setup: normalize on '-new' names X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=54d5aef92dbc0bcde645ce6583f72e7ed8b830f9;p=ceph-build.git ceph-dev-new-setup: normalize on '-new' names Signed-off-by: Alfredo Deza --- diff --git a/ceph-dev-new-setup/build/build b/ceph-dev-new-setup/build/build new file mode 100644 index 00000000..1c7ea9a6 --- /dev/null +++ b/ceph-dev-new-setup/build/build @@ -0,0 +1,204 @@ +#!/bin/bash -ex + +BRANCH=`branch_slash_filter $BRANCH` +SHA1=${GIT_COMMIT} + +# split on '/' to get just 'wip-mybranch' when input is like: origin/wip-mybranch + +HOST=$(hostname --short) +echo "Building on ${HOST}" +echo " DIST=${DIST}" +echo " BPTAG=${BPTAG}" +echo " WS=$WORKSPACE" +echo " PWD=$(pwd)" +echo " BRANCH=$BRANCH" +echo " SHA1=$GIT_COMMIT" + +if [ -x "$BRANCH" ] ; then + echo "No git branch was supplied" + exit 1 +fi + +echo "Building version $(git describe) Branch $BRANCH" + +rm -rf dist +rm -rf release + +# fix version/release. Hack needed only for the spec +# file for rc candidates. +#export force=force +#sed -i 's/^Version:.*/Version: 0.80/' ceph.spec.in +#sed -i 's/^Release:.*/Release: rc1%{?dist}/' ceph.spec.in +#sed -i 's/^Source0:.*/Source0: http:\/\/ceph.com\/download\/%{name}-%{version}-rc1.tar.bz2/' ceph.spec.in +#sed -i 's/^%setup.*/%setup -q -n %{name}-%{version}-rc1/' ceph.spec.in + +# because autogen+configure will check for dependencies, we are forced to install them +# and ensure they are present in the current host +if [ -x install-deps.sh ]; then + echo "Ensuring dependencies are installed" + ./install-deps.sh +fi + +# run submodule updates regardless +echo "Running submodule update ..." +git submodule update --init + +# Flavor Builds support + +#cryptopp is not default for CMake +AUTOCONF_FLAVOR_FLAGS="--without-cryptopp" + +if [ "${FLAVOR}" == "notcmalloc" ] +then + echo "Detected notcmalloc flavor: will use flag: --without-tcmalloc or -DALLOCATOR=libc" + AUTOCONF_FLAVOR_FLAGS="$AUTOCONF_FLAVOR_FLAGS --without-tcmalloc" + export CEPH_EXTRA_CMAKE_ARGS="$CEPH_EXTRA_CMAKE_ARGS -DALLOCATOR=libc" +else + AUTOCONF_FLAVOR_FLAGS="$AUTOCONF_FLAVOR_FLAGS --with-tcmalloc" + export CEPH_EXTRA_CMAKE_ARGS="$CEPH_EXTRA_CMAKE_ARGS -DALLOCATOR=tcmalloc" +fi + + +# make-dist does not exist for autotools builds +if [ ! -x make-dist ]; then + echo "Using autotools build system" + echo "Running autogen.sh ..." + ./autogen.sh + echo "Running configure ..." + ./configure \ + --disable-option-checking \ + '--prefix=/usr' \ + '--sbindir=/sbin' \ + '--localstatedir=/var' \ + '--sysconfdir=/etc' \ + '--with-debug' \ + '--with-nss' \ + '--with-radosgw' \ + '--disable-static' \ + '--without-lttng' \ + $AUTOCONF_FLAVOR_FLAGS \ + 'CFLAGS= -Wno-unused-parameter' \ + 'CXXFLAGS= -Wno-unused-parameter' \ + --cache-file=/dev/null \ + --srcdir=. +fi + +mkdir -p release + +# Contents below used to come from /srv/release_tarball.sh and +# was called like:: +# +# $bindir/release_tarball.sh release release/version + +releasedir='release' +versionfile='release/version' + +if git diff --quiet ; then + echo repository is clean +else + echo + echo "**** REPOSITORY IS DIRTY ****" + echo + git diff + if [ "$force" != "force" ]; then + echo "add 'force' argument if you really want to continue." + exit 1 + fi + echo "forcing." +fi + +cephver=`git describe --match "v*" | sed s/^v//` +echo current version $cephver + +srcdir=`pwd` + +if [ -d "$releasedir/$cephver" ]; then + echo "$releasedir/$cephver already exists; reuse that release tarball" +else + dch -v $cephver-1 'autobuilder' + + echo building tarball + rm ceph-*.tar.gz || true + rm ceph-*.tar.bz2 || true + + if [ -x make-dist ] + then + ./make-dist $cephver + vers=`ls ceph-*.tar.bz2 | cut -c 6- | sed 's/.tar.bz2//'` + extension="tar.bz2" + extract_flags="jxf" + compress_flags="jcf" + else + make dist + make dist-bzip2 + vers=`ls ceph-*.tar.gz | cut -c 6- | sed 's/.tar.gz//'` + extension="tar.gz" + extract_flags="zxf" + compress_flags="zcf" + fi + + echo tarball vers $vers + + echo extracting + mkdir -p $releasedir/$cephver/rpm + cp rpm/*.patch $releasedir/$cephver/rpm || true + cd $releasedir/$cephver + + tar $extract_flags $srcdir/ceph-$vers.$extension + + [ "$vers" != "$cephver" ] && mv ceph-$vers ceph-$cephver + + tar zcf ceph_$cephver.orig.tar.gz ceph-$cephver + cp -a ceph_$cephver.orig.tar.gz ceph-$cephver.tar.gz + + tar jcf ceph-$cephver.tar.bz2 ceph-$cephver + + # copy debian dir, too. Prevent errors with `true` when using cmake + cp -a $srcdir/debian debian || true + cd $srcdir + + # copy in spec file, too. If using cmake, the spec file + # will already exist. + cp ceph.spec $releasedir/$cephver || true +fi + + +if [ -n "$versionfile" ]; then + echo $cephver > $versionfile + echo "wrote $cephver to $versionfile" +fi + +vers=`cat release/version` + + +( + cd release/$vers + mkdir -p ceph-$vers/debian + cp -r debian/* ceph-$vers/debian/ + dpkg-source -b ceph-$vers +) + +mkdir -p dist +# Debian Source Files +mv release/$vers/*.dsc dist/. +mv release/$vers/*.diff.gz dist/. || true +mv release/$vers/*.orig.tar.gz dist/. +# RPM Source Files +mkdir -p dist/rpm/ +mv release/$vers/rpm/*.patch dist/rpm/ || true +mv release/$vers/ceph.spec dist/. +mv release/$vers/*.tar.* dist/. +# Parameters +mv release/version dist/. + +cat > dist/sha1 << EOF +SHA1=${GIT_COMMIT} +EOF + +cat > dist/branch << EOF +BRANCH=${BRANCH} +EOF + +cat > dist/other_envvars << EOF +CEPH_EXTRA_CMAKE_ARGS=${CEPH_EXTRA_CMAKE_ARGS} +EOF diff --git a/ceph-dev-new-setup/build/failure b/ceph-dev-new-setup/build/failure new file mode 100644 index 00000000..573ff655 --- /dev/null +++ b/ceph-dev-new-setup/build/failure @@ -0,0 +1,9 @@ +#!/bin/bash -ex + +# update shaman with the failed build status. At this point there aren't any +# architectures or distro information, so we just report this with the current +# (ceph-dev-setup) build information that includes log and build urls +BRANCH=`branch_slash_filter $BRANCH` +SHA1=${GIT_COMMIT} + +failed_build_status "ceph" diff --git a/ceph-dev-new-setup/config/definitions/ceph-dev-setup-new.yml b/ceph-dev-new-setup/config/definitions/ceph-dev-setup-new.yml new file mode 100644 index 00000000..99929af0 --- /dev/null +++ b/ceph-dev-new-setup/config/definitions/ceph-dev-setup-new.yml @@ -0,0 +1,59 @@ +- job: + name: ceph-dev-new-setup + description: "This job step checks out the branch and builds the tarballs, diffs, and dsc that are passed to the ceph-dev-build step.\r\n\r\nNotes:\r\nJob needs to run on a releatively recent debian system. The Restrict where run feature is used to specifiy an appropriate label.\r\nThe clear workspace before checkout box for the git plugin is used." + # we do not need to pin this to trusty anymore for the new jenkins instance + # FIXME: unpin when this gets ported over + node: huge && trusty && x86_64 + display-name: 'ceph-dev-new-setup' + logrotate: + daysToKeep: -1 + numToKeep: 25 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + block-downstream: false + block-upstream: false + concurrent: true + properties: + - github: + url: https://github.com/ceph/ceph-ci + + parameters: + - string: + name: BRANCH + description: "The git branch (or tag) to build" + + scm: + - git: + url: git@github.com:ceph/ceph-ci.git + # Use the SSH key attached to the ceph-jenkins GitHub account. + credentials-id: '39fa150b-b2a1-416e-b334-29a9a2c0b32d' + branches: + - $BRANCH + skip-tag: true + wipe-workspace: true + + builders: + - shell: + !include-raw: + - ../../../scripts/build_utils.sh + - ../../build/build + + publishers: + - archive: + artifacts: 'dist/**' + allow-empty: false + latest-only: false + + - postbuildscript: + script-only-if-failed: True + script-only-if-succeeded: False + builders: + - shell: + !include-raw: + - ../../../scripts/build_utils.sh + - ../../build/failure + + wrappers: + - inject-passwords: + global: true + mask-password-params: true diff --git a/ceph-dev-setup-new/build/build b/ceph-dev-setup-new/build/build deleted file mode 100644 index 1c7ea9a6..00000000 --- a/ceph-dev-setup-new/build/build +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/bash -ex - -BRANCH=`branch_slash_filter $BRANCH` -SHA1=${GIT_COMMIT} - -# split on '/' to get just 'wip-mybranch' when input is like: origin/wip-mybranch - -HOST=$(hostname --short) -echo "Building on ${HOST}" -echo " DIST=${DIST}" -echo " BPTAG=${BPTAG}" -echo " WS=$WORKSPACE" -echo " PWD=$(pwd)" -echo " BRANCH=$BRANCH" -echo " SHA1=$GIT_COMMIT" - -if [ -x "$BRANCH" ] ; then - echo "No git branch was supplied" - exit 1 -fi - -echo "Building version $(git describe) Branch $BRANCH" - -rm -rf dist -rm -rf release - -# fix version/release. Hack needed only for the spec -# file for rc candidates. -#export force=force -#sed -i 's/^Version:.*/Version: 0.80/' ceph.spec.in -#sed -i 's/^Release:.*/Release: rc1%{?dist}/' ceph.spec.in -#sed -i 's/^Source0:.*/Source0: http:\/\/ceph.com\/download\/%{name}-%{version}-rc1.tar.bz2/' ceph.spec.in -#sed -i 's/^%setup.*/%setup -q -n %{name}-%{version}-rc1/' ceph.spec.in - -# because autogen+configure will check for dependencies, we are forced to install them -# and ensure they are present in the current host -if [ -x install-deps.sh ]; then - echo "Ensuring dependencies are installed" - ./install-deps.sh -fi - -# run submodule updates regardless -echo "Running submodule update ..." -git submodule update --init - -# Flavor Builds support - -#cryptopp is not default for CMake -AUTOCONF_FLAVOR_FLAGS="--without-cryptopp" - -if [ "${FLAVOR}" == "notcmalloc" ] -then - echo "Detected notcmalloc flavor: will use flag: --without-tcmalloc or -DALLOCATOR=libc" - AUTOCONF_FLAVOR_FLAGS="$AUTOCONF_FLAVOR_FLAGS --without-tcmalloc" - export CEPH_EXTRA_CMAKE_ARGS="$CEPH_EXTRA_CMAKE_ARGS -DALLOCATOR=libc" -else - AUTOCONF_FLAVOR_FLAGS="$AUTOCONF_FLAVOR_FLAGS --with-tcmalloc" - export CEPH_EXTRA_CMAKE_ARGS="$CEPH_EXTRA_CMAKE_ARGS -DALLOCATOR=tcmalloc" -fi - - -# make-dist does not exist for autotools builds -if [ ! -x make-dist ]; then - echo "Using autotools build system" - echo "Running autogen.sh ..." - ./autogen.sh - echo "Running configure ..." - ./configure \ - --disable-option-checking \ - '--prefix=/usr' \ - '--sbindir=/sbin' \ - '--localstatedir=/var' \ - '--sysconfdir=/etc' \ - '--with-debug' \ - '--with-nss' \ - '--with-radosgw' \ - '--disable-static' \ - '--without-lttng' \ - $AUTOCONF_FLAVOR_FLAGS \ - 'CFLAGS= -Wno-unused-parameter' \ - 'CXXFLAGS= -Wno-unused-parameter' \ - --cache-file=/dev/null \ - --srcdir=. -fi - -mkdir -p release - -# Contents below used to come from /srv/release_tarball.sh and -# was called like:: -# -# $bindir/release_tarball.sh release release/version - -releasedir='release' -versionfile='release/version' - -if git diff --quiet ; then - echo repository is clean -else - echo - echo "**** REPOSITORY IS DIRTY ****" - echo - git diff - if [ "$force" != "force" ]; then - echo "add 'force' argument if you really want to continue." - exit 1 - fi - echo "forcing." -fi - -cephver=`git describe --match "v*" | sed s/^v//` -echo current version $cephver - -srcdir=`pwd` - -if [ -d "$releasedir/$cephver" ]; then - echo "$releasedir/$cephver already exists; reuse that release tarball" -else - dch -v $cephver-1 'autobuilder' - - echo building tarball - rm ceph-*.tar.gz || true - rm ceph-*.tar.bz2 || true - - if [ -x make-dist ] - then - ./make-dist $cephver - vers=`ls ceph-*.tar.bz2 | cut -c 6- | sed 's/.tar.bz2//'` - extension="tar.bz2" - extract_flags="jxf" - compress_flags="jcf" - else - make dist - make dist-bzip2 - vers=`ls ceph-*.tar.gz | cut -c 6- | sed 's/.tar.gz//'` - extension="tar.gz" - extract_flags="zxf" - compress_flags="zcf" - fi - - echo tarball vers $vers - - echo extracting - mkdir -p $releasedir/$cephver/rpm - cp rpm/*.patch $releasedir/$cephver/rpm || true - cd $releasedir/$cephver - - tar $extract_flags $srcdir/ceph-$vers.$extension - - [ "$vers" != "$cephver" ] && mv ceph-$vers ceph-$cephver - - tar zcf ceph_$cephver.orig.tar.gz ceph-$cephver - cp -a ceph_$cephver.orig.tar.gz ceph-$cephver.tar.gz - - tar jcf ceph-$cephver.tar.bz2 ceph-$cephver - - # copy debian dir, too. Prevent errors with `true` when using cmake - cp -a $srcdir/debian debian || true - cd $srcdir - - # copy in spec file, too. If using cmake, the spec file - # will already exist. - cp ceph.spec $releasedir/$cephver || true -fi - - -if [ -n "$versionfile" ]; then - echo $cephver > $versionfile - echo "wrote $cephver to $versionfile" -fi - -vers=`cat release/version` - - -( - cd release/$vers - mkdir -p ceph-$vers/debian - cp -r debian/* ceph-$vers/debian/ - dpkg-source -b ceph-$vers -) - -mkdir -p dist -# Debian Source Files -mv release/$vers/*.dsc dist/. -mv release/$vers/*.diff.gz dist/. || true -mv release/$vers/*.orig.tar.gz dist/. -# RPM Source Files -mkdir -p dist/rpm/ -mv release/$vers/rpm/*.patch dist/rpm/ || true -mv release/$vers/ceph.spec dist/. -mv release/$vers/*.tar.* dist/. -# Parameters -mv release/version dist/. - -cat > dist/sha1 << EOF -SHA1=${GIT_COMMIT} -EOF - -cat > dist/branch << EOF -BRANCH=${BRANCH} -EOF - -cat > dist/other_envvars << EOF -CEPH_EXTRA_CMAKE_ARGS=${CEPH_EXTRA_CMAKE_ARGS} -EOF diff --git a/ceph-dev-setup-new/build/failure b/ceph-dev-setup-new/build/failure deleted file mode 100644 index 573ff655..00000000 --- a/ceph-dev-setup-new/build/failure +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -ex - -# update shaman with the failed build status. At this point there aren't any -# architectures or distro information, so we just report this with the current -# (ceph-dev-setup) build information that includes log and build urls -BRANCH=`branch_slash_filter $BRANCH` -SHA1=${GIT_COMMIT} - -failed_build_status "ceph" diff --git a/ceph-dev-setup-new/config/definitions/ceph-dev-setup-new.yml b/ceph-dev-setup-new/config/definitions/ceph-dev-setup-new.yml deleted file mode 100644 index c1699d63..00000000 --- a/ceph-dev-setup-new/config/definitions/ceph-dev-setup-new.yml +++ /dev/null @@ -1,59 +0,0 @@ -- job: - name: ceph-dev-setup-new - description: "This job step checks out the branch and builds the tarballs, diffs, and dsc that are passed to the ceph-dev-build step.\r\n\r\nNotes:\r\nJob needs to run on a releatively recent debian system. The Restrict where run feature is used to specifiy an appropriate label.\r\nThe clear workspace before checkout box for the git plugin is used." - # we do not need to pin this to trusty anymore for the new jenkins instance - # FIXME: unpin when this gets ported over - node: huge && trusty && x86_64 - display-name: 'ceph-dev-setup-new' - logrotate: - daysToKeep: -1 - numToKeep: 25 - artifactDaysToKeep: -1 - artifactNumToKeep: -1 - block-downstream: false - block-upstream: false - concurrent: true - properties: - - github: - url: https://github.com/ceph/ceph-ci - - parameters: - - string: - name: BRANCH - description: "The git branch (or tag) to build" - - scm: - - git: - url: git@github.com:ceph/ceph-ci.git - # Use the SSH key attached to the ceph-jenkins GitHub account. - credentials-id: '39fa150b-b2a1-416e-b334-29a9a2c0b32d' - branches: - - $BRANCH - skip-tag: true - wipe-workspace: true - - builders: - - shell: - !include-raw: - - ../../../scripts/build_utils.sh - - ../../build/build - - publishers: - - archive: - artifacts: 'dist/**' - allow-empty: false - latest-only: false - - - postbuildscript: - script-only-if-failed: True - script-only-if-succeeded: False - builders: - - shell: - !include-raw: - - ../../../scripts/build_utils.sh - - ../../build/failure - - wrappers: - - inject-passwords: - global: true - mask-password-params: true