I use for configuration bamboo 5.7.1 and all configuration will be done from script - I not use plugins
First I prepare build project consists from 2 stages
- one for prepare package - for example zip file
- two for update package to repository - NEXUS
When I have zip file to upload to NEXUS I use NEXUS api to upload file
#use timestamp to versioning
VERSION=`echo "${bamboo.buildTimeStamp}" | sed 's/:/-/g' | cut -f 1 -d "."`
#uploadcurl -v \
-F "r=releases" \
-F "g=pl.company.sql" \
-F "hasPom=false" \
-F "a=db" \
-F "c=${bamboo.buildResultKey}" \
-F "p=zip" \ -F "v=$VERSION" \
-F "file=@./$f" \
-u deployment:${bamboo.nexuspassword}\
http://service/nexus/service/local/artifact/maven/content
important is use classifier
or You can use MAVEN
Second - download script for deployment project
#Fix mapping between buildResultKey
CLASS=`echo ${bamboo.buildResultKey} | sed 's/-/-RDP-/2'`
-For more information see post below and continue
#find package by classifier
VERSION=`curl -u deployment:${bamboo.nexuspassword} "http://service/nexus/service/local/lucene/search?g=$GROUP&a=$ARTIFACT&c=$CLASS&r=$REPO" | sed -n 's|<version>\(.*\)</version>|\1|p' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'`
#Download by wget
wget -O db-sprint.zip --user deployment --password=${bamboo.nexuspassword} "http://service/nexus/service/local/artifact/maven/content?r=$REPO&g=$GROUP&a=$ARTIFACT&v=$VERSION&p=zip&c=$CLASS"
No comments:
Post a Comment