summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCody Wyatt Neiman2022-07-30 14:50:05 -0400
committerCody Wyatt Neiman2022-07-30 14:50:05 -0400
commitff8e9d1098ae7c227d03d8a094186cbcd797453b (patch)
tree665bce1295bb6e75945d196aa60a422fbb352ad7
parentf37331ba0339062ad39417ba0c060c7308984d63 (diff)
downloadaur-ff8e9d1098ae7c227d03d8a094186cbcd797453b.tar.gz
fix(cicd): run deploy as builduser
-rw-r--r--.gitlab-ci.yml15
1 files changed, 10 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 955c2c35531f..b88336980ccf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -52,12 +52,17 @@ aur:
dependencies:
- makepkg
before_script:
- - pacman -Syu --noconfirm openssh git
- - echo $SSH_KEY_B64 | base64 -di > ~/.ssh/id_rsa
- - git remote add aur ssh://aur@aur.archlinux.org/$CI_PROJECT_NAME.git
- - git fetch aur
+ - pacman -Syu --noconfirm sudo
+ - cp yay /usr/sbin/yay
+ - useradd builduser -m && passwd -d builduser
+ - printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers
+ - sudo -u builduser bash -c 'yay --noconfirm'
+ - sudo -u builduser bash -c 'yay -S --noconfirm openssh git'
+ - sudo -u builduser bash -c 'echo $SSH_KEY_B64 | base64 -di > ~/.ssh/id_rsa'
+ - sudo -u builduser bash -c 'git remote add aur ssh://aur@aur.archlinux.org/$CI_PROJECT_NAME.git'
+ - sudo -u builduser bash -c 'git fetch aur'
script:
- - git push aur master
+ - sudo -u builduser bash -c 'git push aur master'
- sleep 30
yay_after: