This commit is contained in:
parent
6e138a4c94
commit
316b2ac288
1 changed files with 14 additions and 2 deletions
16
src/main.rs
16
src/main.rs
|
@ -96,11 +96,23 @@ pub fn build(image: &str, ci: bool) {
|
|||
"set -e".to_string(),
|
||||
"pacman -Syu --noconfirm".to_string(),
|
||||
"pacman -S --noconfirm rsync base-devel".to_string(),
|
||||
"rsync -a /workdir/ /build/".to_string(),
|
||||
];
|
||||
|
||||
if ci {
|
||||
let symlink_cmd = format!(
|
||||
"ln -s {} /build",
|
||||
std::env::current_dir().unwrap().display()
|
||||
);
|
||||
docker_script.extend([symlink_cmd]);
|
||||
} else {
|
||||
docker_script.extend(["rsync -a /workdir/ /build/".to_string()]);
|
||||
};
|
||||
|
||||
docker_script.extend([
|
||||
"useradd -m build".to_string(),
|
||||
"echo 'ALL ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers".to_string(),
|
||||
"chown -R build /build".to_string(),
|
||||
];
|
||||
]);
|
||||
|
||||
if ci {
|
||||
if std::fs::exists("./pacman.conf").unwrap() {
|
||||
|
|
Loading…
Add table
Reference in a new issue