From f2d6f8921e7f49ae735003044c2babf416d68d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Thu, 10 Jan 2019 10:44:35 +0100 Subject: [PATCH] Add gitlab-ci --- .gitlab-ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..e4a4710 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,46 @@ +stages: + - build + - deploy + +makepkg: + stage: build + image: archlinux/base:latest + before_script: + - echo 'Server = http://mir.archlinux.fr/$repo/os/$arch' > /etc/pacman.d/mirrorlist + - echo '[seblu]' >> /etc/pacman.conf + - echo 'Server = http://al.seblu.net/$repo/$arch' >> /etc/pacman.conf + - echo 'SigLevel = Required TrustedOnly' >> /etc/pacman.conf + - pacman --sync --refresh --sysupgrade --noconfirm + - pacman --sync --noconfirm base-devel devtools + - useradd --home-dir /root --groups root,wheel --shell /bin/bash build + - chmod 770 /root + script: + - ulimit -c 0 + - pwd + - ls -Rl + - sudo -u build -- makepkg --syncdeps + artifacts: + name: $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA + expire_in: 1 week + paths: + - "*.pkg.tar.xz" + +commitpkg: + stage: deploy + image: archlinux/base:latest + before_script: + - echo 'Server = http://mir.archlinux.fr/$repo/os/$arch' > /etc/pacman.d/mirrorlist + - echo '[seblu]' >> /etc/pacman.conf + - echo 'Server = http://al.seblu.net/$repo/$arch' >> /etc/pacman.conf + - echo 'SigLevel = Required TrustedOnly' >> /etc/pacman.conf + - pacman --sync --refresh --sysupgrade --noconfirm + - pacman --sync --noconfirm openssh archrepo-git + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null + - mkdir -p ~/.ssh && chmod 700 ~/.ssh + - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts && + - chmod 644 ~/.ssh/known_hosts + script: + - seblu-push + only: + - master -- GitLab