summarylogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml57
1 files changed, 57 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 000000000000..b054fc4b6154
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,57 @@
+image: base/devel
+
+stages:
+ - test
+ - deploy
+
+test:
+ stage: test
+ only:
+ - master
+ before_script:
+ - pacman -Syyu --noconfirm
+ - pacman -S namcap --noconfirm
+ - useradd somebody
+ - echo "somebody ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
+ - mkdir -p /home/somebody/
+ - chown -R somebody:somebody /home/somebody/
+ script:
+ - sudo -u somebody ./test.sh
+
+github:
+ stage: deploy
+ before_script:
+ - pacman -Syyu git --noconfirm
+ - git checkout "$CI_BUILD_REF_NAME"
+ - git remote add github https://"$GITHUB_USERNAME":"$GITHUB_TOKEN"@github.com/sanduhrs/arch-aur-traefik-bin
+ script:
+ - echo "Deploy to Github"
+ - git push github
+ environment:
+ name: staging
+ url: https://github.com/sanduhrs/arch-aur-traefik
+ only:
+ - branches
+
+aur:
+ stage: deploy
+ before_script:
+ - pacman -Syyu git openssh --noconfirm
+ - eval $(ssh-agent -s)
+ - ssh-add <(echo "$SSH_PRIVATE_KEY")
+ # For Docker builds disable host key checking. Be aware that by adding that
+ # you are suspectible to man-in-the-middle attacks.
+ # WARNING: Use this only with the Docker executor, if you use it with shell
+ # you will overwrite your user's SSH config.
+ - mkdir -p ~/.ssh
+ - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
+ - git checkout master
+ - git remote add aur ssh://aur@aur.archlinux.org/traefik-bin.git
+ script:
+ - echo "Deploy to Github"
+ - git push aur
+ environment:
+ name: production
+ url: https://aur.archlinux.org/packages/traefik-bin
+ only:
+ - master