Skip to content
.gitlab-ci.yml 1.73 KiB
Newer Older
Seblu's avatar
Seblu committed
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
Seblu's avatar
Seblu committed
    - useradd --create-home --shell /bin/bash build
Seblu's avatar
Seblu committed
    - "echo 'build ALL = NOPASSWD: /usr/bin/pacman' > /etc/sudoers.d/build"
Seblu's avatar
Seblu committed
    - "[ -n \"$PACKAGER\" ] && echo \"PACKAGER='$PACKAGER'\" > /home/build/.makepkg.conf"
    - echo "MAKEFLAGS='-j$(nproc)'" >> /home/build/.makepkg.conf
Seblu's avatar
Seblu committed
  script:
    - ulimit -c 0
Seblu's avatar
Seblu committed
    - sudo -u build -- makepkg --syncdeps --noconfirm
Seblu's avatar
Seblu committed
  artifacts:
    name: $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA
    expire_in: 1 week
    paths:
      - "*.pkg.tar.xz"
Seblu's avatar
Seblu committed
  only:
    changes:
      - PKGBUILD
Seblu's avatar
Seblu committed

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:
    refs:
      - master
    changes:
      - PKGBUILD