Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the script for ASF build #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions builddeb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ params="$@"
# Build debs
cd "$GIT_SOURCE_DIR"
if [ "$USE_WAF" == "True" ]; then
./waf deb $params
mvn build-helper:remove-project-artifact
mvn install -P deps
dpkg-buildpackage
debs="artifacts/debbuild/"
else
true
fi
cd -

# write down the path to deb files to file
echo "$GIT_SOURCE_DIR"/"$debs" > "$RESULT_DIR"
echo "$GIT_SOURCE_DIR"/"$debs" > "$RESULT_DIR"
20 changes: 3 additions & 17 deletions builddebtarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,9 @@ fi
tmpdir=`mktemp -d`
destdir=$tmpdir/$pkgname
tarname=$pkgname.tar.gz
debDir=`cat $RESULT_DIR`
debDir='source/artifacts/debbuild'
mkdir -p "$tmpdir"
rsync -a "$debDir"/oss "$destdir"/
if [ "$oss" != "True" && x"$NO_PROPIRETARY" != x"true" ]; then
rsync -a "$debDir"/premium "$destdir"/
fi
rsync -a "$DEPS_DIR" "$destdir"/
rsync -a ./*.deb "$destdir"/
cd "$destdir"
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
cd -
Expand All @@ -37,14 +33,4 @@ tar czf "$tarname" "$pkgname"
cd -
mv "$tmpdir"/"$tarname" .
rm -rf "$tmpdir"

tgtfldr="$APTREPO":"$APTREPO_RELEASE_DIR"/"$SUB_DIR"
mntpoint="/media"
mount "$tgtfldr" "$mntpoint" -o nolock
mkdir -p "$mntpoint"/"$PUSH_TO_REPO"
mv "$tarname" "$mntpoint"/"$PUSH_TO_REPO"/
echo "Tarball URL:http://aptrepo.lab.vmops.com/releases/$SUB_DIR/$PUSH_TO_REPO/$tarname"
umount "$mntpoint"



rm -rf ./*.deb
4 changes: 3 additions & 1 deletion buildrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ params="$@"
# Build rpms
pushd "$GIT_SOURCE_DIR"
if [ "$USE_WAF" == "True" ]; then
mvn build-helper:remove-project-artifact
mvn install -P deps
./waf rpm $params
rpms="artifacts/rpmbuild/RPMS"
else
Expand All @@ -16,4 +18,4 @@ fi
popd

# write down the path to rpm files to file
echo "$GIT_SOURCE_DIR"/"$rpms" > "$RESULT_DIR"
echo "$GIT_SOURCE_DIR"/"$rpms" > "$RESULT_DIR"
21 changes: 3 additions & 18 deletions buildrpmtarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ shift
s3repo="$1"

if [ x"$PACKAGE_NAME" != "x" ]; then
pkgname=$tarballname-$version-$PACKAGE_NAME-$distro
pkgname=$tarballname-$version-$PACKAGE_NAME-$distro
else
pkgname=$tarballname-$version-$distro
pkgname=$tarballname-$version-$distro
fi

tmpdir=`mktemp -d`
Expand All @@ -26,11 +26,7 @@ tarname=$pkgname.tar.gz
rpmDir=`cat $RESULT_DIR`

mkdir -p "$tmpdir"
rsync -a "$rpmDir"/oss "$destdir"/
if [ "$oss" != "True" && x"$NO_PROPIRETARY" != x"true" ]; then
rsync -a "$rpmDir"/premium "$destdir"/
fi
rsync -a "$DEPS_DIR" "$destdir"/
rsync -a "$rpmDir" "$destdir"/
createrepo -q -d "$destdir"
chmod +x install.sh
cp install.sh "$destdir"/
Expand All @@ -39,14 +35,3 @@ tar czf "$tarname" "$pkgname"
popd
mv "$tmpdir"/"$tarname" .
rm -rf "$tmpdir"

tgtfldr="$YUMREPO":"$YUMREPO_RELEASE_DIR"/"$SUB_DIR"
mntpoint="/media"
mount "$tgtfldr" "$mntpoint" -o nolock
mkdir -p "$mntpoint"/"$PUSH_TO_REPO"
if [ x"$s3repo" != x"" ]; then
s3cmd put --acl-public "$tarname" "$s3repo"
fi
mv "$tarname" "$mntpoint"/"$PUSH_TO_REPO"/
echo "Tarball URL:http://yumrepo.lab.vmops.com/releases/$SUB_DIR/$PUSH_TO_REPO/$tarname"
umount "$mntpoint"
4 changes: 2 additions & 2 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def arrageResult(ext):

if isDeb():
buildDeb()
arrageResult(".deb")
#arrageResult(".deb")
else:
buildRpm()
arrageResult(".rpm")
#arrageResult(".rpm")


def buildTarball():
Expand Down
3 changes: 2 additions & 1 deletion clone.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# Checkout $GIT_SOURCE_DIR from git

. `dirname $0`/commons.sh
Expand All @@ -19,7 +20,7 @@ if [ -d $GIT_SOURCE_DIR ] ; then
else osscommitid=`git checkout $BUILDABLE_TARGET &>commit.log;cat commit.log; rm -f commit.log` ; fi
popd
else
git clone ssh://hudson@git.cloud.com/var/lib/git/cloudstack-oss $GIT_SOURCE_DIR
git clone https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git $GIT_SOURCE_DIR
#git clone https://github.com/CloudDotCom/CloudStack.git "$$GIT_SOURCE_DIR"
fi

Expand Down
2 changes: 1 addition & 1 deletion common.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ def FormatErrMsg(e):
YUM_RPM_DIR='/var/www/html/repositories'
APT_DEB_DIR='/var/www/html/repositories'
YUM_RELEASE_DIR='/var/www/html/releases'
APT_RELEASE_DIR='/var/www/html/releases'
APT_RELEASE_DIR='/var/www/html/releases'
13 changes: 10 additions & 3 deletions hudsonbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"fedora14": {"host":"build-fc14", "isDeb":False, "subDir":"fedora/14"},
"fedora13": {"host":"build-fc13", "isDeb":False, "subDir":"fedora/13"},
"rhel6.0": {"host":"build-rhel6", "isDeb":False, "subDir":"rhel/6.0"},
"rhel6.1": {"host":"build-rhel6", "isDeb":False, "subDir":"rhel/6.1"},
"rhel6.3": {"host":"rhel63", "isDeb":False, "subDir":"rhel/6.3"},
"ubuntu10.10": {"host":"build-ubuntu1010", "isDeb":True, "subDir":"ubuntu/10.10"},
"ubuntu10.04" : {"host":"build-ubuntu1004", "isDeb":True, "subDir":"ubuntu/10.04"},
"ubuntu12.04" : {"host":"ubuntu1204", "isDeb":True, "subDir":"ubuntu/10.04"},
#"ubuntu11" : {"host":"natty", "isDeb":True,"subDir":"ubuntu/11" },
}

Expand Down Expand Up @@ -288,8 +288,15 @@ def waitForAllThreadsEnd():

waitForAllThreadsStart(processNum)
waitForAllThreadsEnd()
sendMail()
#sendMail()
grabartifacts()

def grabartifacts():
distro=os.environ['DO_DISTRO_PACKAGES']
host = buildMachines[distro]['host']
remoteHost = '%s@%s'%(REMOTE_USER, host)
bash(['scp', '%s:%s/*.tar.gz'%(remoteHost, BUILD_DIR), "$WORKSPACE/"])
bash(['ssh', remoteHost, '"rm -rf %s/*.tar.gz"'%BUILD_DIR])
if __name__ == '__main__':
try:
main()
Expand Down
19 changes: 18 additions & 1 deletion install/rpminstall_full.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
#!/bin/bash -e
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

function cleanup() {
rm -f /etc/yum.repos.d/cloud-temp.repo || true
}
Expand Down
9 changes: 0 additions & 9 deletions postdebs.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
#!/bin/bash
. `dirname $0`/commons.sh

debsDir=`cat $RESULT_DIR`
tgtfldr="$APTREPO":"$APTREPO_DEB_DIR"/"$SUB_DIR"
mntpoint="/media"
mount "$tgtfldr" "$mntpoint" -o nolock
repoDir="$mntpoint"/"$PUSH_TO_REPO"
mkdir -p "$repoDir"
cp -r "$debsDir"/oss "$repoDir"
cp -r "$debsDir"/premium "$repoDir"
umount "$mntpoint"
11 changes: 0 additions & 11 deletions postrpms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,3 @@

. `dirname $0`/commons.sh

rpmsDir=`cat $RESULT_DIR`
tgtfldr="$YUMREPO":"$YUMREPO_RPM_DIR"/"$SUB_DIR"
mntpoint="/media"
mount "$tgtfldr" "$mntpoint" -o nolock
repoDir="$mntpoint"/"$PUSH_TO_REPO"
mkdir -p "$repoDir"
cp -r "$rpmsDir"/oss "$repoDir"
createrepo -q -d --update "$repoDir"/oss
cp -r "$rpmsDir"/premium "$repoDir"
createrepo -q -d --update "$repoDir"/premium
umount "$mntpoint"