You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Stephen Connolly <st...@gmail.com> on 2009/12/22 15:56:01 UTC

BASH port of mercury?

Hi there,

we have some Java-phobes...

We want to use the Maven Repository to share binary artifacts across
teams...

Has anyone got any BASH scripts which replicate Maven / ANT Tasks / Mercury?

At the moment the best I have is:

repo_dir=$(echo "${groupId}" | sed -n -e
"s:\.:/:gp")/${artifactId}/${version/-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9]*/-SNAPSHOT}/
repo_path=$repo_dir/${artifactId}-${version}${classifier:+-}${classifier}.${packaging}
local_path=~/.m2/repository/${repo_path}
remote_path=http://repo.mycompany.org/content/repositories/$(if [[
"$version" =~ ".*-SNAPSHOT|.*-[0-9]{8}\.[0-9]{6}-[0-9][0-9]*" ]] ; then echo
"snapshot"; else echo "release"; fi)/${repo_path}

1. Deploy:

curl -s -T ${file} ${remote_path}

2. Install

cp -f ${file} ${local_path}

3. Get

if [ -f $local_path ] ; then
        if [[ "$version" =~ ".*-SNAPSHOT|.*-[0-9]{8}\.[0-9]{6}-[0-9][09-]*"
]] ; then
                remote_status=$(curl --silent --remote-time --head -w
"%{http_code}" $remote_path -o /dev/null)
                if [ 200 -eq $remote_status ] ; then
                        curl --silent --remote-time -z $local_path
$remote_path;
                else
                        exit 1;
                fi
        fi
        echo $local_path
        exit 0
else
        mkdir -p $repo_dir
        remote_status=$(curl --silent --remote-time --head -w "%{http_code}"
$remote_path -o /dev/null)
        echo $remote_status
        if [ 200 -eq $remote_status ] ; then
                curl --silent --remote-time -o $local_path $remote_path;
        else
                exit 1;
        fi
        echo $local_path
        exit 0;
fi

But I'm wondering has any bash wizard got the metadata parsing working (so
that I can do proper time-stampped snapshots)

Re: BASH port of mercury?

Posted by Stephen Connolly <st...@gmail.com>.
What we are doing is using the maven repository as a binary artifact
repository... SVN for source code...

They needed somewhere to keep their binary artifacts.... we have RPMs of our
Java modules that get installed into the stuff they build... and we already
have a geo-redundant maven repository... so the path of least resistance and
they accepted storing artifacts in our maven repository... but install
Java... no way man!

-Stephen

2009/12/22 Stephen Connolly <st...@gmail.com>

> They do not want to install java on their machine!
>
> I did warn that they are java-phobes...
>
> -Stephen
>
> (I have toyed with using GCJ to compile a cli tool for them and package
> that up as an RPM for them to install... but I'm convinced that some BASH
> scripting should be able to do it all)
>
> 2009/12/22 Jesse Farinacci <ji...@gmail.com>
>
> Why not the maven-cli-plugin[1]? This seems fairly close. Or are the
>> shell-bigots too bigoted to drop into a subshell? :-)
>>
>> [1] http://wiki.github.com/mrdon/maven-cli-plugin
>>
>> -Jesse
>>
>> On Tue, Dec 22, 2009 at 9:56 AM, Stephen Connolly
>> <st...@gmail.com> wrote:
>> > Hi there,
>> >
>> > we have some Java-phobes...
>> >
>> > We want to use the Maven Repository to share binary artifacts across
>> > teams...
>> >
>> > Has anyone got any BASH scripts which replicate Maven / ANT Tasks /
>> Mercury?
>> >
>>
>>
>>
>> --
>> There are 10 types of people in this world, those
>> that can read binary and those that can not.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>

Re: BASH port of mercury?

Posted by Stephen Connolly <st...@gmail.com>.
They do not want to install java on their machine!

I did warn that they are java-phobes...

-Stephen

(I have toyed with using GCJ to compile a cli tool for them and package that
up as an RPM for them to install... but I'm convinced that some BASH
scripting should be able to do it all)

2009/12/22 Jesse Farinacci <ji...@gmail.com>

> Why not the maven-cli-plugin[1]? This seems fairly close. Or are the
> shell-bigots too bigoted to drop into a subshell? :-)
>
> [1] http://wiki.github.com/mrdon/maven-cli-plugin
>
> -Jesse
>
> On Tue, Dec 22, 2009 at 9:56 AM, Stephen Connolly
> <st...@gmail.com> wrote:
> > Hi there,
> >
> > we have some Java-phobes...
> >
> > We want to use the Maven Repository to share binary artifacts across
> > teams...
> >
> > Has anyone got any BASH scripts which replicate Maven / ANT Tasks /
> Mercury?
> >
>
>
>
> --
> There are 10 types of people in this world, those
> that can read binary and those that can not.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: BASH port of mercury?

Posted by Jesse Farinacci <ji...@gmail.com>.
Why not the maven-cli-plugin[1]? This seems fairly close. Or are the
shell-bigots too bigoted to drop into a subshell? :-)

[1] http://wiki.github.com/mrdon/maven-cli-plugin

-Jesse

On Tue, Dec 22, 2009 at 9:56 AM, Stephen Connolly
<st...@gmail.com> wrote:
> Hi there,
>
> we have some Java-phobes...
>
> We want to use the Maven Repository to share binary artifacts across
> teams...
>
> Has anyone got any BASH scripts which replicate Maven / ANT Tasks / Mercury?
>



-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org