1 <?xml version='1.0' encoding='UTF-8'?>
2 <matrix-project plugin="matrix-project@1.10">
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 <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@1.25">
20 <autoRebuild>false</autoRebuild>
21 <rebuildDisabled>false</rebuildDisabled>
22 </com.sonyericsson.rebuild.RebuildSettings>
23 <jenkins.model.BuildDiscarderProperty>
24 <strategy class="hudson.tasks.LogRotator">
25 <daysToKeep>-1</daysToKeep>
26 <numToKeep>50</numToKeep>
27 <artifactDaysToKeep>-1</artifactDaysToKeep>
28 <artifactNumToKeep>-1</artifactNumToKeep>
30 </jenkins.model.BuildDiscarderProperty>
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 <hudson.model.StringParameterDefinition>
44 <name>release_id</name>
45 <description></description>
46 <defaultValue></defaultValue>
47 </hudson.model.StringParameterDefinition>
48 <hudson.model.ChoiceParameterDefinition>
49 <name>destination</name>
50 <description></description>
51 <choices class="java.util.Arrays$ArrayList">
52 <a class="string-array">
53 <string>staging</string>
54 <string>download.tizen.org</string>
57 </hudson.model.ChoiceParameterDefinition>
58 <hudson.model.ChoiceParameterDefinition>
59 <name>update_latest_release</name>
60 <description></description>
61 <choices class="java.util.Arrays$ArrayList">
62 <a class="string-array">
67 </hudson.model.ChoiceParameterDefinition>
68 </parameterDefinitions>
69 </hudson.model.ParametersDefinitionProperty>
71 <scm class="hudson.scm.NullSCM"/>
72 <canRoam>true</canRoam>
73 <disabled>false</disabled>
74 <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
75 <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
77 <concurrentBuild>false</concurrentBuild>
79 <hudson.matrix.LabelAxis>
82 <string>backend</string>
83 <string>download</string>
85 </hudson.matrix.LabelAxis>
91 RSYNC_OPT='-avz --exclude=micbootstrap --exclude=tizen-downloader --exclude=lthor-tool --exclude=*/repocache --delete-delay'
95 #echo "modify_repo: OBS_PATH=$OBS_PATH"
96 TEMPARCHIVEDIR=$(mktemp -d)
97 rsync $RSYNC_OPT $OBS_PATH/* $TEMPARCHIVEDIR/
98 # Update the repo file to public URL
99 update_repo_file $TEMPARCHIVEDIR/
100 # Extrace release notes
101 extract_release_notes $TEMPARCHIVEDIR/
106 #echo "update_repo_file: repo_path=$repo_path"
107 old_working_dir=$(pwd)
108 for dir in $(ls $repo_path)
111 # skip if no repo file found
112 [ -f *.repo ] || continue
114 # rename the repo file
115 if [ -n "$REPONAME" ]; then
116 # if there're more than one repo file, only keep the last one
117 for repofile in $(ls *.repo)
119 mv -f $repofile $REPONAME.repo
121 sed -i "s#^\[.*\]#\[$REPONAME\]#g" $REPONAME.repo
122 sed -i "s#^name=.*#name=$REPONAME#g" $REPONAME.repo
124 sed -i "/^gpg/ d" $REPONAME.repo
125 sed -i '/enable/ a gpgcheck=0' $REPONAME.repo
128 public_url=$BASEURL/$dir
129 sed -i "s#^baseurl.*#baseurl=$public_url#g" *.repo
134 extract_release_notes() {
136 #echo "extract_release_notes: repo_dir=$repo_dir"
139 rpm_list=$(find $repo_dir -name '*.rpm')
144 release_notes_file=$(rpm -qpl $rpm|grep "/RELEASE_NOTES$")
145 release_notes_name=$(echo $release_notes_file|sed 's#/usr/share/doc/packages/\([a-z0-9-]*\)/RELEASE_NOTES#RELEASE_NOTES_\U\1#'|| echo '')
146 [ -n "$release_notes_name" ] || continue
147 grep $release_notes_file $temp_list && continue
150 echo $release_notes_file >> $temp_list
155 rpm2cpio < $rpm |cpio -idmv
158 cp $tempdir/$release_notes_file $repo_dir/$release_notes_name.txt
164 ######### start of script ########
165 if [ -z "$release_id" ] ; then
166 echo "Error: release_id is mandatory."
170 if [ $project = "tools" ]; then
172 elif [ $project = "services" ]; then
175 echo "Error: Unexpected project value: $project"
181 [ $label != backend ] && exit 0
183 SRC_PATH=/srv/obs/repos/$obs_project
184 DEST_PATH="${IMG_SYNC_DEST_BASE}/${project}/.staging"
186 'download.tizen.org')
187 [ $label != download ] && exit 0
189 SRC_PATH=/srv/www/download.tizen.org/$project/.staging/archive/$release_id
190 DEST_PATH=/srv/www/download.tizen.org/$project
193 echo "Error: Wrong destination"
197 if [ ! -d $SRC_PATH ] ; then
198 echo "Error: Source directory $SRC_PATH does not exist"
202 BASEURL=${URL_PUBLIC_REPO_BASE}/$project/${staging}archive/$release_id
204 TEMPARCHIVEDIR=""
206 modify_repo $SRC_PATH
207 rsync $RSYNC_OPT $TEMPARCHIVEDIR/* $DEST_PATH/archive/$release_id
209 if [ "$update_latest_release" = "YES" ]; then
210 [ AAA${TEMPARCHIVEDIR} = "AAA" ] && modify_repo $SRC_PATH
211 rsync $RSYNC_OPT $TEMPARCHIVEDIR/* $DEST_PATH/latest-release
213 [ -d $TEMPARCHIVEDIR ] && rm -rf $TEMPARCHIVEDIR</command>
214 </hudson.tasks.Shell>
218 <executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
219 <runSequentially>false</runSequentially>