aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/ci.h
blob: 397f4a780a36753f10c2e7516968e2e24dbb2f5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright (c) 2022 Egor Tensin <egor@tensin.name>
 * This file is part of the "cimple" project.
 * For details, see https://github.com/egor-tensin/cimple.
 * Distributed under the MIT License.
 */

#ifndef __CI_H__
#define __CI_H__

#include "process.h"

int ci_run(struct proc_output *);

/*
 * This is a high-level function. It's basically equivalent to the following
 * sequence in bash:
 *
 *     dir="$( mktemp -d )"
 *     git clone --no-checkout "$url" "$dir"
 *     pushd "$dir"
 *     git checkout "$rev"
 *     ./ci
 *     popd
 *     rm -rf "$dir"
 *
 */
int ci_run_git_repo(const char *url, const char *rev, struct proc_output *);

#endif