Skip to content

Commit 01f0371

Browse files
committedOct 14, 2021
buildmaster/tools: check for confdir, error on missing. Add tools to path
1 parent cf89615 commit 01f0371

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed
 

‎buildmaster/bin/builderctl

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright 2016-2017 Haiku, Inc. All rights reserved.
4+
# Copyright 2016-2021 Haiku, Inc. All rights reserved.
55
# Distributed under the terms of the MIT License.
66
#
77
# Authors:
@@ -159,6 +159,11 @@ parser.add_argument('-C', '--confdir', help='Builder config directory on local m
159159
parser.add_argument('action', help='[ health | provision | reboot ]')
160160
args = parser.parse_args()
161161

162+
if not os.path.isdir(args.confdir):
163+
print("Error: Builder inventory not found!")
164+
print("Please change to haikuports directory before running this tool (or pass --confdir)!")
165+
sys.exit()
166+
162167
if args.action == "health":
163168
cluster_health(args)
164169
elif args.action == "provision":

‎buildmaster/bin/builderssh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright 2016-2017 Haiku, Inc. All rights reserved.
4+
# Copyright 2016-2021 Haiku, Inc. All rights reserved.
55
# Distributed under the terms of the MIT License.
66
#
77
# Authors:
@@ -49,4 +49,10 @@ parser = argparse.ArgumentParser(description='Open SSH connection to builder')
4949
parser.add_argument('-C', '--confdir', help='Builder config directory on local machine', required=False, default=os.path.join(os.getcwd(), "buildmaster/builders"))
5050
parser.add_argument('buildername', help='Name of builder')
5151
args = parser.parse_args()
52+
53+
if not os.path.isdir(args.confdir):
54+
print("Error: Builder inventory not found!");
55+
print("Please change to haikuports directory before running this tool (or pass --confdir)!")
56+
sys.exit()
57+
5258
launch_ssh(args)

‎buildmaster/bin/createbuilder

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright 2016-2017 Haiku, Inc. All rights reserved.
4+
# Copyright 2016-2021 Haiku, Inc. All rights reserved.
55
# Distributed under the terms of the MIT License.
66
#
77
# Authors:
@@ -25,6 +25,11 @@ parser.add_argument('-f', '--force', help='Force overwrite of existing builder',
2525
parser.add_argument('-w', '--workdir', help='Haikuports path on remote builder', required=False, default="/boot/home/haikuports")
2626
args = parser.parse_args()
2727

28+
if not os.path.isdir(args.confdir):
29+
print("Error: Builder inventory not found!")
30+
print("Please change to haikuports directory before running this tool (or pass --confdir)!")
31+
sys.exit()
32+
2833
if not os.path.isdir(args.confdir):
2934
os.mkdir(args.confdir, 0755)
3035

‎buildmaster/docker/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN apt-get update \
77
&& apt-get clean
88

99
RUN mkdir /var/sources /var/buildmaster
10+
RUN echo 'export PATH=$PATH:/var/sources/haikuporter/buildmaster/bin/' >> /etc/bash.bashrc
1011

1112
VOLUME ["/var/sources", "/var/buildmaster"]
1213

‎buildmaster/docker/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
default:
2+
docker build --no-cache --tag docker.io/haikuporter/buildmaster:1.2.5 .
3+
push:
4+
docker push docker.io/haikuporter/buildmaster:1.2.5

0 commit comments

Comments
 (0)
Please sign in to comment.