mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-14 08:51:01 +02:00
Migrated release script to use Buck exclusively.
Change-Id: I04371594b68071488788c4ecbdb896a6306a2a14
This commit is contained in:
parent
6066dff896
commit
be1a1964bb
10
BUCK
10
BUCK
@ -47,3 +47,13 @@ java_library(
|
|||||||
visibility = ['PUBLIC'],
|
visibility = ['PUBLIC'],
|
||||||
deps = INSTALL
|
deps = INSTALL
|
||||||
)
|
)
|
||||||
|
|
||||||
|
tar_file(
|
||||||
|
name = 'onos-test',
|
||||||
|
root = 'onos-test-%s' % ONOS_VERSION,
|
||||||
|
srcs = glob(['tools/test/**/*']) + [
|
||||||
|
'tools/dev/bash_profile',
|
||||||
|
'tools/dev/bin/onos-app',
|
||||||
|
'tools/build/envDefaults'
|
||||||
|
],
|
||||||
|
)
|
@ -262,3 +262,25 @@ def osgi_jar_with_tests(
|
|||||||
srcs = test_srcs,
|
srcs = test_srcs,
|
||||||
jar_target = ':' + name + '-tests',
|
jar_target = ':' + name + '-tests',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def tar_file(
|
||||||
|
name,
|
||||||
|
srcs,
|
||||||
|
root = None,
|
||||||
|
out = None,
|
||||||
|
visibility = [ 'PUBLIC' ],
|
||||||
|
):
|
||||||
|
|
||||||
|
cmd = ( 'mkdir -p $TMP/%(root_dir)s && '
|
||||||
|
'cp -r $SRCDIR/ $TMP/%(root_dir)s && '
|
||||||
|
'tar -C $TMP -zcf $OUT %(root_dir)s' ) % {
|
||||||
|
'root_dir': root if root is not None else name
|
||||||
|
}
|
||||||
|
|
||||||
|
genrule(
|
||||||
|
name = name,
|
||||||
|
srcs = srcs,
|
||||||
|
bash = cmd,
|
||||||
|
out = out if out is not None else ( root if root is not None else name ) + '.tar.gz',
|
||||||
|
visibility = visibility,
|
||||||
|
)
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
# Packages ONOS test facilities into onos-test.tar.gz
|
# Packages ONOS test facilities into onos-test.tar.gz
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
echo "Use 'onos-buck build //:onos-test' instead"
|
||||||
|
exit 1
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
|
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
|
||||||
|
@ -26,10 +26,14 @@ export ONOS_VERSION=$NEW_VERSION
|
|||||||
onos-validate-change-version
|
onos-validate-change-version
|
||||||
|
|
||||||
# Build ONOS & deploy to staging repo using the release profile.
|
# Build ONOS & deploy to staging repo using the release profile.
|
||||||
onos-build && onos-package --tar --zip && mvn -Prelease clean deploy -DskipTests
|
onos-buck build onos
|
||||||
|
time onos-buck-publish
|
||||||
|
|
||||||
# Build ONOS docs
|
# Build ONOS docs
|
||||||
onos-build-docs
|
onos-buck build //docs:internal //docs:external
|
||||||
|
|
||||||
|
# Package test tar.gz
|
||||||
|
onos-buck build //:onos-test
|
||||||
|
|
||||||
# Build ONOS archetypes & deploy to staging repo using the release profile.
|
# Build ONOS archetypes & deploy to staging repo using the release profile.
|
||||||
# Note that release of the staging repository is a separate manual step.
|
# Note that release of the staging repository is a separate manual step.
|
||||||
|
@ -9,6 +9,20 @@ set -e
|
|||||||
. $ONOS_ROOT/tools/build/envDefaults
|
. $ONOS_ROOT/tools/build/envDefaults
|
||||||
|
|
||||||
#FIXME need to export s3Creds
|
#FIXME need to export s3Creds
|
||||||
#TODO we could verify that ONOS_VERSION is set, and only upload that version
|
|
||||||
|
|
||||||
onosUploadBits.py
|
# Stage the onos tar in /tmp
|
||||||
|
rm -f $ONOS_TAR
|
||||||
|
cp $(onos-buck build onos --show-output | tail -1 | cut -d\ -f2) $ONOS_TAR
|
||||||
|
|
||||||
|
# Repackage the onos tar
|
||||||
|
pushd /tmp/
|
||||||
|
tar xf onos-$ONOS_VERSION.tar.gz
|
||||||
|
rm -f onos-$ONOS_VERSION.zip
|
||||||
|
zip -r onos-$ONOS_VERSION.zip onos-$ONOS_VERSION/
|
||||||
|
popd
|
||||||
|
|
||||||
|
# Stage the test bits tar in /tmp
|
||||||
|
rm -f $ONOS_TEST_TAR
|
||||||
|
cp $(onos-buck build //:onos-test --show-output | tail -1 | cut -d\ -f2) $ONOS_TEST_TAR
|
||||||
|
|
||||||
|
onosUploadBits.py $ONOS_VERSION
|
||||||
|
@ -14,11 +14,11 @@ from uploadToS3 import uploadFile
|
|||||||
nightlyTag = 'NIGHTLY'
|
nightlyTag = 'NIGHTLY'
|
||||||
bitsPath = '/tmp'
|
bitsPath = '/tmp'
|
||||||
|
|
||||||
prefix = 'onos-(\d+\.\d+\.\d+)'
|
prefix = 'onos-(?:test-)?(\d+\.\d+\.\d+)'
|
||||||
buildNum = '\.?([\w-]*)'
|
buildNum = '\.?([\w-]*)'
|
||||||
ext = '\.(?:tar\.gz|zip|deb|noarch\.rpm)'
|
ext = '\.(?:tar\.gz|zip|deb|noarch\.rpm)'
|
||||||
|
|
||||||
def findBits( path ):
|
def findBits( path, target_version=None ):
|
||||||
for file in listdir( path ):
|
for file in listdir( path ):
|
||||||
filePath = join( path, file )
|
filePath = join( path, file )
|
||||||
if not isfile( filePath ):
|
if not isfile( filePath ):
|
||||||
@ -28,6 +28,9 @@ def findBits( path ):
|
|||||||
match = re.match( regex, file )
|
match = re.match( regex, file )
|
||||||
if match:
|
if match:
|
||||||
version = match.group(1)
|
version = match.group(1)
|
||||||
|
if target_version is not None and version != target_version:
|
||||||
|
print 'Skipping %s...' % filePath
|
||||||
|
continue
|
||||||
build = match.group(2)
|
build = match.group(2)
|
||||||
if build:
|
if build:
|
||||||
if 'NIGHTLY' in build or 'rc' in build:
|
if 'NIGHTLY' in build or 'rc' in build:
|
||||||
@ -37,4 +40,7 @@ def findBits( path ):
|
|||||||
uploadFile(filePath, dest='release/')
|
uploadFile(filePath, dest='release/')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
findBits( '/tmp' )
|
import sys
|
||||||
|
|
||||||
|
version = sys.argv[1] if len(sys.argv) >= 2 else None
|
||||||
|
findBits( '/tmp', version )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user