forked from kubernetes/release
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9689a59
commit 2000fca
Showing
3 changed files
with
82 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import logging | ||
import subprocess | ||
|
||
# to build multiarch you might need to add the architectures | ||
# $ sudo dpkg --add-architecture armhf | ||
# $ sudo dpkg --add-architecture arm64 | ||
|
||
FORMAT = '+ %(asctime)-15s %(message)s' | ||
logging.basicConfig(format=FORMAT) | ||
LOG = logging.getLogger() | ||
LOG.setLevel(0) | ||
|
||
class Build(): | ||
|
||
def __init__(self, pkg, arch, distro, version, revision): | ||
self.arch = arch | ||
self.distro = distro | ||
self.pkg = pkg | ||
self.version = version | ||
self.revision = revision | ||
|
||
def run(self): | ||
cmd = ( | ||
'go', | ||
'run', | ||
'build.go', | ||
'-arch', self.arch, | ||
'-distro_name', self.distro, | ||
'-package', self.pkg, | ||
'-version', self.version, | ||
'-revision', self.revision | ||
) | ||
LOG.debug("running cmd: %s", cmd) | ||
return subprocess.call(cmd) | ||
|
||
def __str__(self): | ||
return "%s(arch=%s,distro=%s,version=%s,revision=%s)" % ( | ||
self.pkg, self.arch, self.distro, self.version, self.revision) | ||
|
||
def main(): | ||
architectures=('amd64', 'arm', 'arm64') | ||
distros=('xenial',) | ||
|
||
packages = { | ||
'kubectl': ( | ||
('1.3.6', '02'), | ||
('1.4.0-beta.3', '02'), | ||
), | ||
'kubelet': ( | ||
('1.3.6', '02'), | ||
('1.4.0-beta.3', '02'), | ||
), | ||
'kubernetes-cni': ( | ||
('0.3.0.1-07a8a2', '00'), | ||
), | ||
} | ||
|
||
builds = [] | ||
|
||
for pkg, versions in packages.items(): | ||
for version, revision in versions: | ||
for arch in architectures: | ||
for distro in distros: | ||
builds.append(Build(pkg, arch, distro, version, revision)) | ||
|
||
for build in builds: | ||
LOG.debug("planning to build: %s" % build) | ||
|
||
for build in builds: | ||
LOG.info("building: %s", build) | ||
rc = build.run() | ||
if rc: | ||
LOG.error("error building: %s" % build) | ||
sys.exit(rc) | ||
LOG.debug("successfuly built: %s" % build) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file was deleted.
Oops, something went wrong.