autobuilder: Mostly functional operation on products.json

This commit is contained in:
Colin Walters 2014-01-16 06:22:52 -05:00
parent 1c4262d273
commit 94bf3c731d
5 changed files with 25 additions and 20 deletions

View File

@ -1,16 +1,16 @@
{
comment: "This file defines the set of trees that is generated by the rpm-ostree autobuilder",
"comment": "This file defines the set of trees that is generated by the rpm-ostree autobuilder",
osname: "fedostree",
"osname": "fedostree",
architectures: ["x86_64"],
"architectures": ["x86_64"],
releases: ["20", "rawhide"],
"releases": ["20", "rawhide"],
base_required_packages: ["kernel", "ostree", "fedora-release", "lvm2",
"btrfs-progs", "e2fsprogs"],
"base_required_packages": ["kernel", "ostree", "fedora-release", "lvm2",
"btrfs-progs", "e2fsprogs", "xfsprogs"],
products:
"products":
{
"base":
{

View File

@ -23,7 +23,7 @@ const GSystem = imports.gi.GSystem;
const BUILD_ENV = {
'HOME' : '/',
'HOSTNAME' : 'ostbuild',
'HOSTNAME' : 'rpm-ostree-autobuilder',
'LANG': 'C',
'PATH' : '/usr/bin:/bin:/usr/sbin:/sbin',
'SHELL' : '/bin/bash',
@ -110,13 +110,13 @@ function atomicSymlinkSwap(linkPath, newTarget, cancellable) {
}
function checkIsWorkDirectory(dir) {
let manifest = dir.get_child('manifest.json');
let manifest = dir.get_child('products.json');
if (!manifest.query_exists(null)) {
throw new Error("No manifest.json found in " + dir.get_path());
throw new Error("No products.json found in " + dir.get_path());
}
let dotGit = dir.get_child('.git');
if (dotGit.query_exists(null)) {
throw new Error(".git found in " + dir.get_path() + "; are you in a gnome-ostree checkout?");
throw new Error(".git found in " + dir.get_path() + "; are you in a rpm-ostree checkout?");
}
}

View File

@ -400,7 +400,7 @@ const TaskRunner = new Lang.Class({
this.taskCwd = this.buildPath.get_child(this.name);
GSystem.file_ensure_directory(this.taskCwd, false, cancellable);
let baseArgv = ['ostbuild', 'run-task', this.name, JSON.stringify(this.taskData.parameters)];
let baseArgv = ['rpm-ostree-autobuilder', 'run-task', this.name, JSON.stringify(this.taskData.parameters)];
let context = new GSystem.SubprocessContext({ argv: baseArgv });
context.set_cwd(this.taskCwd.get_path());
let childEnv = GLib.get_environ();

View File

@ -44,21 +44,24 @@ const TaskBuild = new Lang.Class({
DefaultParameters: {forceComponents: []},
_composeProduct: function(productName, treeName, treeData, release, architecture) {
_composeProduct: function(productName, treeName, treeData, release, architecture, cancellable) {
let repos = ['fedora-' + release,
'walters-nss-altfiles'];
if (release != 'rawhide')
repos.push('fedora-' + release + '-updates');
let ref = [this._productData['osname'], release, architecture, name].join('/');
let ref = [this._productData['osname'], release, architecture, productName].join('/');
let packages = treeData['packages'];
packages.push.apply(packages, treeData['base_required_packages']);
let argv = ['rpm-ostree',
'--repo=' + this.workdir.get_child('repo').get_path()];
argv += repos.map(function (a) { return '--enablerepo=' + a });
argv += ['--os=fedora', '--os-version=' + release,
'create', ref];
argv += packages;
argv.push.apply(argv, repos.map(function (a) { return '--enablerepo=' + a; }));
argv.push.apply(argv, ['--os=fedora', '--os-version=' + release,
'create', ref]);
argv.push.apply(argv, packages);
let productNameUnix = productName.replace(/\//g, '_');
let buildOutputPath = Gio.File.new_for_path('log-' + productNameUnix + '.txt');
ProcUtil.runSync(argv, cancellable, { logInitiation: true,
cwd: this.workdir });
},
@ -75,7 +78,9 @@ const TaskBuild = new Lang.Class({
for (let j = 0; j < architectures.length; j++) {
for (let productName in products) {
for (let treeName in products[productName]) {
this._composeProduct(productName, treeName, products[productName][treeName], releases[i], architectures[j]);
this._composeProduct(productName, treeName, products[productName][treeName],
releases[i], architectures[j],
cancellable);
}
}
}

View File

@ -67,7 +67,7 @@ const TaskResolve = new Lang.Class({
componentsToFetch.push.apply(matches);
}
let gitMirrorArgs = ['ostbuild', 'git-mirror', '--timeout-sec=' + this.parameters.timeoutSec,
let gitMirrorArgs = ['rpm-ostree-autobuilder', 'git-mirror', '--timeout-sec=' + this.parameters.timeoutSec,
'--workdir=' + this.workdir.get_path(),
'--manifest=' + manifestPath.get_path()];
if (this.parameters.fetchAll || componentsToFetch.length > 0) {