NS7 as new default target for nethserver-mock

I prepared a new version of nethserver-mock for our @dev_team and anyone interested on building RPMs for NethServer. It is a bundle of config files for mock and shell scripts: it can be safely installed on a clean CentOS 7.

I installed it even on my Fedora 23 too :slight_smile:

Typical invocation for ns7:

make-rpms filename.spec

This version has a new sftp-based script: upload-rpms. It submits RPMs to packages.nethserver.org. For instance

upload-rpms packages.nethserver.org:nscom/7.2.1511/testing *.rpm

Those guys at Nethesis that have a shell function with the same name must undefine it!

Please, check it out!

http://packages.nethserver.org/nethserver/7.2.1511/testing/x86_64/Packages/nethserver-mock-1.3.0-1.2.g13c338b.ns7.noarch.rpm

Of course, it is good for building ns6 packages, too! But now you must prepend two environment variables when invoking it:

dist=ns6 mockcfg=nethserver-6-x86_64 make-rpms filename.spec
4 Likes

sources are at https://github.com/NethServer/nethserver-mock

2 Likes

Right I forgot to mention the PR URL

It seems that the commit is not merged, I cannot see it in github

Yes it is still a pull request!

BTW you may be interested in

still the same issue for me. exactly the same problem ???

[build@build7 ~]$ cd ns-repo-srpm/
[build@build7 ns-repo-srpm]$ ll
total 20
-rw-rw-r--. 1 build build 11356 11 mai   21:25 nethserver-urbackup-0.0.2-1.ns6.sdl.noarch.rpm
-rw-rw-r--. 1 build build  6855 11 mai   21:25 nethserver-urbackup-0.0.2-1.ns6.sdl.src.rpm
[build@build7 ns-repo-srpm]$ ns-upload-rpms nethserver-urbackup-0.0.2-1.ns6.sdl.noarch.rpm
Couldn't read packet: Connection reset by peer
[build@build7 ns-repo-srpm]$ ns-upload-rpms *.rpm
Couldn't read packet: Connection reset by peer
[build@build7 ns-repo-srpm]$ ll ~/bin/ns-upload-rpms
-rwxrw-r--. 1 build build 1228  8 juil. 11:29 /home/build/bin/ns-upload-rpms
[build@build7 ns-repo-srpm]$ cat ~/bin/ns-upload-rpms
#!/bin/bash

#
# Copyright (C) 2016 Nethesis S.r.l.
# http://www.nethesis.it - nethserver@nethesis.it
#
# This script is part of NethServer.
#
# NethServer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or any later version.
#
# NethServer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with NethServer.  If not, see COPYING.
#

dest=$1;
shift;

if [[ -z "${dest}" ]]; then
    exec 1>&2

    echo "Usage:
    $0 <destination> file1.rpm [file2.rpm ...]
    <destination> must be a valid sftp [user@]host[:dir[/]] format
"
    exit 1
fi

( 
    spool=$(mktemp -u "${USER:-upload}.XXXXXX");
    echo "mkdir ${spool}";
    echo "cd ${spool}";
    for F in $*;
    do
        echo "put -p $F";
    done;
    echo "cd ..";
    echo "rename ${spool} commit-${spool}" 
) | sftp -q -p -b - ${dest} | grep --color=auto '^sftp> put'
1 Like

I use a el7 to build, any clues are welcome :slight_smile:

same here when I add a path

[build@build7 ns-repo-srpm]$ upload-rpms packages.nethserver.org:nscom/6.8/testing *.rpm
Couldn't read packet: Connection reset by peer
[build@build7 ns-repo-srpm]$ upload-rpms packages.nethserver.org:nscom/6.8/testing ./*.rpm
Couldn't read packet: Connection reset by peer

BTW you should test if you don’t have at least two elements
one for the path
two for rpms

1 Like

Thanks for the feedback steph! I’m looking at the server configuration…

I have this when I launch the script alone without element.

   [build@build7 ns-repo-srpm]$ upload-rpms
    usage: sftp [-1246aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher]
              [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit]
              [-o ssh_option] [-P port] [-R num_requests] [-S program]
              [-s subsystem | sftp_server] host
           sftp [user@]host[:file ...]
           sftp [user@]host[:dir[/]]
           sftp -b batchfile [user@]host

I should have

Usage:
    $0 <destination> file1.rpm [file2.rpm ...]
    <destination> must be a valid sftp [user@]host[:dir[/]] format

does it is specific to my environment ?

Ok got it…I had the last function in /etc/bashrc…but it still doesn’t work.

[build@build7 ns-repo-srpm]$ ns-upload-rpms packages.nethserver.org:nscom/6.8/testing *.rpm
Couldn't read packet: Connection reset by peer

Does the issues could come that my user is not stephdl (build here in local) , like for the remote host

1 Like

Yes you got it! I can reproduce the same error here too:

upload-rpms build@packages.nethserver.org:nscom/7.2.1511/testing nethserver-base-3.0.1*.rpm
Couldn't read packet: Connection reset by peer

Please try with

ns-upload-rpms stephdl@packages.nethserver.org:nscom/6.8/testing *.rpm

BTW, I should enable you to testing repo too… DONE :thumbsup:

[build@build7 ns-repo-srpm]$ ns-upload-rpms stephdl@packages.nethserver.org:nscom/6.8/testing *.rpm
sftp> put -p nethserver-urbackup-0.0.2-1.ns6.sdl.noarch.rpm
sftp> put -p nethserver-urbackup-0.0.2-1.ns6.sdl.src.rpm

and I got the error dependencies check email

question : do i must push the srpm also. It can be a good alternative if the developer stops to collaborate, to keep the work and fork it if needed.

The upload must bundle all dependencies. Please set nethforge-testing for urbackup!

BTW: fixed minimum arguments count here nethserver-mock/src/bin/upload-rpms at 2ca699155025825831e6e646599578425226db4a · NethServer/nethserver-mock · GitHub

[build@build7 ns-repo-srpm]$ ll
total 3984
-rw-rw-r–. 1 build build 1108728 24 mars 15:03 cryptopp-5.6.3-37.1.x86_64.rpm
-rw-rw-r–. 1 build build 11356 11 mai 21:25 nethserver-urbackup-0.0.2-1.ns6.sdl.noarch.rpm
-rw-rw-r–. 1 build build 6855 11 mai 21:25 nethserver-urbackup-0.0.2-1.ns6.sdl.src.rpm
-rw-rw-r–. 1 build build 964372 24 mars 15:58 urbackup-client-nogui-1.4.11-3.1.x86_64.rpm
-rw-rw-r–. 1 build build 1979252 24 mars 15:29 urbackup-server-1.4.14-3.1.x86_64.rpm
[build@build7 ns-repo-srpm]$ ns-upload-rpms stephdl@packages.nethserver.org:nscom/6.8/testing *.rpm
sftp> put -p cryptopp-5.6.3-37.1.x86_64.rpm
sftp> put -p nethserver-urbackup-0.0.2-1.ns6.sdl.noarch.rpm
sftp> put -p nethserver-urbackup-0.0.2-1.ns6.sdl.src.rpm
sftp> put -p urbackup-client-nogui-1.4.11-3.1.x86_64.rpm
sftp> put -p urbackup-server-1.4.14-3.1.x86_64.rpm

YUM publish success from commit-build-upload.Hio6DD to nscom/6.8/testing
nethserver-urbackup-0.0.2-1.ns6.sdl.noarch.rpm

  • the folder /var/lib/urbackup is created by the rpm

cryptopp-5.6.3-37.1.x86_64.rpm

  • Update to 5.6.3

urbackup-server-1.4.14-3.1.x86_64.rpm

  • Updated to version 1.4.14

urbackup-client-nogui-1.4.11-3.1.x86_64.rpm

  • Updated to version 1.4.11
  • Now build against cryptopp 5.6.3

nethserver-urbackup-0.0.2-1.ns6.sdl.src.rpm

  • the folder /var/lib/urbackup is created by the rpm

now who test it and what is the repository to call

1 Like

Sorry steph, in this specific case (urbackup) should upload those packages to the nethforge-testing!

upload-rpms stephdl@packages.nethserver.org:nscom/6.8/nethforge-testing *.rpm

Could you open a new development/testing thread?

Also this issue should be moved forward

Released nethserver-mock-1.3.1-1.ns7.noarch.rpm

http://packages.nethesis.it/nethserver/7.2.1511/updates/x86_64/Packages/nethserver-mock-1.3.1-1.ns7.noarch.rpm

2 posts were merged into an existing topic: NethServer YUM repositories permissions and management