1 <?xml version='1.0' encoding='UTF-8'?>
2 <matrix-project plugin="matrix-project@1.11">
4 <description>Publish Services or Tools release to archive/. Optionally update symlink. Run only manually.
5 This multi-config job runs on backend or download server, determined by args;
6 It skips running on another server.
8 <keepDependencies>false</keepDependencies>
10 <hudson.security.AuthorizationMatrixProperty>
11 <permission>hudson.model.Item.Read:anonymous</permission>
12 </hudson.security.AuthorizationMatrixProperty>
13 <hudson.plugins.buildblocker.BuildBlockerProperty plugin="build-blocker-plugin@1.7.3">
14 <useBuildBlocker>false</useBuildBlocker>
15 <blockLevel>UNDEFINED</blockLevel>
16 <scanQueueFor>DISABLED</scanQueueFor>
17 <blockingJobs></blockingJobs>
18 </hudson.plugins.buildblocker.BuildBlockerProperty>
19 <jenkins.model.BuildDiscarderProperty>
20 <strategy class="hudson.tasks.LogRotator">
21 <daysToKeep>-1</daysToKeep>
22 <numToKeep>50</numToKeep>
23 <artifactDaysToKeep>-1</artifactDaysToKeep>
24 <artifactNumToKeep>-1</artifactNumToKeep>
26 </jenkins.model.BuildDiscarderProperty>
27 <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@1.25">
28 <autoRebuild>false</autoRebuild>
29 <rebuildDisabled>false</rebuildDisabled>
30 </com.sonyericsson.rebuild.RebuildSettings>
31 <hudson.model.ParametersDefinitionProperty>
32 <parameterDefinitions>
33 <hudson.model.ChoiceParameterDefinition>
35 <description></description>
36 <choices class="java.util.Arrays$ArrayList">
37 <a class="string-array">
38 <string>tools</string>
39 <string>services</string>
42 </hudson.model.ChoiceParameterDefinition>
43 </parameterDefinitions>
44 </hudson.model.ParametersDefinitionProperty>
46 <scm class="hudson.scm.NullSCM"/>
47 <canRoam>true</canRoam>
48 <disabled>true</disabled>
49 <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
50 <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
52 <concurrentBuild>false</concurrentBuild>
54 <hudson.matrix.LabelAxis>
57 <string>backend</string>
59 </hudson.matrix.LabelAxis>
65 RSYNC_OPT='-avz --exclude=micbootstrap --exclude=tizen-downloader --exclude=lthor-tool --exclude=*/repocache --delete-delay'
69 #echo "modify_repo: OBS_PATH=$OBS_PATH"
70 TEMPARCHIVEDIR=$(mktemp -d)
71 rsync $RSYNC_OPT $OBS_PATH/* $TEMPARCHIVEDIR/
72 # Update the repo file to public URL
73 update_repo_file $TEMPARCHIVEDIR/
74 # Extrace release notes
75 extract_release_notes $TEMPARCHIVEDIR/
80 #echo "update_repo_file: repo_path=$repo_path"
81 old_working_dir=$(pwd)
82 for dir in $(ls $repo_path)
85 # skip if no repo file found
86 [ -f *.repo ] || continue
88 # rename the repo file
89 if [ -n "$REPONAME" ]; then
90 # if there're more than one repo file, only keep the last one
91 for repofile in $(ls *.repo)
93 mv -f $repofile $REPONAME.repo
95 sed -i "s#^\[.*\]#\[$REPONAME\]#g" $REPONAME.repo
96 sed -i "s#^name=.*#name=$REPONAME#g" $REPONAME.repo
98 sed -i "/^gpg/ d" $REPONAME.repo
99 sed -i '/enable/ a gpgcheck=0' $REPONAME.repo
102 public_url=$BASEURL/$dir
103 sed -i "s#^baseurl.*#baseurl=$public_url#g" *.repo
108 extract_release_notes() {
110 #echo "extract_release_notes: repo_dir=$repo_dir"
111 dist=($(ls $repo_dir))
113 rpm_list=$(find $repo_dir -name '*.rpm')
118 release_notes_file=$(rpm -qpl $rpm|grep "/RELEASE_NOTES$")
119 release_notes_name=$(echo $release_notes_file|sed 's#/usr/share/doc/packages/\([a-z0-9-]*\)/RELEASE_NOTES#RELEASE_NOTES_\U\1#'|| echo '')
120 [ -n "$release_notes_name" ] || continue
121 grep $release_notes_file $temp_list && continue
124 echo $release_notes_file >> $temp_list
129 rpm2cpio < $rpm |cpio -idmv
132 cp $tempdir/$release_notes_file $repo_dir/$release_notes_name.txt
138 ######### start of script ########
140 if [ $project = "tools" ]; then
142 elif [ $project = "services" ]; then
143 obs_project=Services:
145 echo "Error: Unexpected project value: $project"
149 SRC_PATH=/srv/obs/repos/$obs_project/Pre-release
150 DEST_PATH="${IMG_SYNC_DEST_BASE}/$project/pre-release"
152 if [ ! -d $SRC_PATH ] ; then
153 echo "Error: Source directory $SRC_PATH does not exist"
157 BASEURL=${URL_PUBLIC_REPO_BASE}/$project/pre-release
159 TEMPARCHIVEDIR=""
161 modify_repo $SRC_PATH
162 rsync $RSYNC_OPT $TEMPARCHIVEDIR/* $DEST_PATH/
164 [ -d $TEMPARCHIVEDIR ] && rm -rf $TEMPARCHIVEDIR</command>
165 </hudson.tasks.Shell>
169 <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
170 <runSequentially>false</runSequentially>