View | Details | Raw Unified | Return to bug 39877
Collapse All | Expand All

(-)a/Koha/Devel/CI/IncrementalRuns.pm (-5 / +7 lines)
Lines 51-57 Koha::Devel::CI::IncrementalRuns is a module designed to manage incremental CI r Link Here
51
    my $ci = Koha::Devel::CI::IncrementalRuns->new({
51
    my $ci = Koha::Devel::CI::IncrementalRuns->new({
52
        incremental_run => 1,
52
        incremental_run => 1,
53
        git_repo_dir    => '/path/to/repo',
53
        git_repo_dir    => '/path/to/repo',
54
        repo_url        => 'gitlab.com/koha-community/koha-ci-results.git',
54
        repo_url        => 'https://gitlab.com/koha-community/koha-ci-results.git',
55
        report          => 1,
55
        report          => 1,
56
        token           => 'your_token',
56
        token           => 'your_token',
57
        test_name       => 'test_name',
57
        test_name       => 'test_name',
Lines 76-88 sub new { Link Here
76
        incremental_run => $ENV{KOHA_CI_INCREMENTAL_RUNS} // 0,
76
        incremental_run => $ENV{KOHA_CI_INCREMENTAL_RUNS} // 0,
77
        git_repo_dir    => $args->{git_repo_dir}          // q{/tmp/koha-ci-results},
77
        git_repo_dir    => $args->{git_repo_dir}          // q{/tmp/koha-ci-results},
78
        repo_url        => $args->{repo_url}              // $ENV{KOHA_CI_INCREMENTAL_RUN_REPO_URL}
78
        repo_url        => $args->{repo_url}              // $ENV{KOHA_CI_INCREMENTAL_RUN_REPO_URL}
79
            // q{gitlab.com/koha-community/koha-ci-results.git},
79
            // q{https://gitlab.com/koha-community/koha-ci-results.git},
80
        report    => $args->{report} // $ENV{KOHA_CI_INCREMENTAL_RUNS_REPORT},
80
        report    => $args->{report} // $ENV{KOHA_CI_INCREMENTAL_RUNS_REPORT},
81
        token     => $args->{token}  // $ENV{KOHA_CI_INCREMENTAL_RUNS_TOKEN},
81
        token     => $args->{token}  // $ENV{KOHA_CI_INCREMENTAL_RUNS_TOKEN},
82
        test_name => $args->{test_name},
82
        test_name => $args->{test_name},
83
        context   => $args->{context},
83
        context   => $args->{context},
84
    };
84
    };
85
    bless $self, $class;
86
85
87
    unless ( $self->{test_name} ) {
86
    unless ( $self->{test_name} ) {
88
        my @caller_info     = caller();
87
        my @caller_info     = caller();
Lines 100-105 sub new { Link Here
100
99
101
        make_path("$self->{git_repo_dir}/$self->{test_name}");
100
        make_path("$self->{git_repo_dir}/$self->{test_name}");
102
    }
101
    }
102
103
    bless $self, $class;
103
    return $self;
104
    return $self;
104
}
105
}
105
106
Lines 173-179 sub report_results { Link Here
173
174
174
    qx{git -C $self->{git_repo_dir} add $failure_file};
175
    qx{git -C $self->{git_repo_dir} add $failure_file};
175
    qx{git -C $self->{git_repo_dir} commit -m "$commit_id - $self->{test_name}"};
176
    qx{git -C $self->{git_repo_dir} commit -m "$commit_id - $self->{test_name}"};
176
    qx{git -C $self->{git_repo_dir} push https://gitlab-ci-token:$self->{token}\@$self->{repo_url} main};
177
    ( my $push_domain = $self->{repo_url} ) =~ s{^https://}{};
178
    my $push_url = "https://gitlab-ci-token:$self->{token}\@$push_domain";
179
    qx{git -C $self->{git_repo_dir} push $push_url main};
177
}
180
}
178
181
179
1;
182
1;
180
- 

Return to bug 39877