diff options
author | Jan Kohnert | 2021-01-23 13:59:26 +0100 |
---|---|---|
committer | Jan Kohnert | 2021-02-14 15:15:25 +0100 |
commit | 339be9ae36d9f6bcedecf20938fa027ada784d39 (patch) | |
tree | 691faed674c4a02e857449c119ddd9055e0552bf | |
parent | f3982f7e75cd48746cb5f69497e98610d15dcac8 (diff) | |
download | aur-339be9ae36d9f6bcedecf20938fa027ada784d39.tar.gz |
Added CI/CD.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | .gitlab-ci.yml | 80 | ||||
-rw-r--r-- | Dockerfile.build_and_test | 9 | ||||
-rw-r--r-- | PKGBUILD | 2 |
5 files changed, 94 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = clockify-desktop pkgdesc = Truly free time tracker for teams, Desktop App pkgver = 1.8.61 - pkgrel = 1 + pkgrel = 2 url = https://clockify.me arch = x86_64 license = custom diff --git a/.gitignore b/.gitignore index 018a3de08144..0daffa4bb733 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -* +/* +!.gitignore +!.gitlab-ci.yml !PKGBUILD !.SRCINFO -!.gitignore diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000000..385fed9dd987 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,80 @@ +include: + - project: 'common/gitlab-helper' + ref: master + file: 'container-helper.yml' + - project: 'common/gitlab-helper' + ref: master + file: 'deploy-helper.yml' + +variables: + BUILD_AND_TEST_IMAGE: "build-and-test" + +workflow: + rules: + # don't create pipeline if the commit message starts with WIP + - if: $CI_COMMIT_MESSAGE =~ /^WIP/ + when: never + # don't create pipeline if we're merging from master or version branches + - if: $CI_MERGE_REQUEST_IID && $CI_COMMIT_REF_NAME =~ /^(master|VER_\d+_\d+)$/ + when: never + - if: $CI_MERGE_REQUEST_IID + - if: $CI_COMMIT_REF_NAME =~ /^(master|VER_\d+_\d+)$/ + - if: $CI_COMMIT_TAG + - if: $CI_PIPELINE_SOURCE =~ /^(trigger|pipeline|web|api|merge_request_event)$/ + +.rules_templates: + rules: + - if: &on_master $CI_COMMIT_REF_NAME =~ /^master$/ + +stages: + - prepareBuild + - build + - test + - deploy + +docker-build-and-test: + stage: prepareBuild + extends: .container-build-and-push + variables: + WORKING_DIR: ${CI_PROJECT_DIR} + DOCKERFILE_NAME: "Dockerfile.build_and_test" + IMAGE_NAME: ${CI_REGISTRY_IMAGE}/${BUILD_AND_TEST_IMAGE}:${CI_COMMIT_REF_NAME} + BUILD_ARGS: REGISTRY=${CI_REGISTRY} + +build-clockify-desktop: + stage: build + image: ${CI_REGISTRY_IMAGE}/${BUILD_AND_TEST_IMAGE}:${CI_COMMIT_REF_NAME} + needs: + - job: "docker-build-and-test" + artifacts: no + artifacts: + name: "${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" + expire_in: 1 day + paths: + - clockify-desktop*.pkg.tar.zst + script: + - makepkg + +test-clockify-desktop: + stage: test + image: ${CI_REGISTRY_IMAGE}/${BUILD_AND_TEST_IMAGE}:${CI_COMMIT_REF_NAME} + needs: ["build-clockify-desktop"] + script: + - sudo pacman -U --noconfirm clockify-desktop*.pkg.tar.zst + # This is not a very sophisticated test but at least checks the binary is + # in place and there are all shared libs found in the system + - ls /opt/Clockify/clockify + - if [[ -n $(ldd /opt/Clockify/clockify | grep "not found") ]]; then exit 1; fi + +deploy-clockify-desktop: + stage: deploy + extends: .git-ssh-push-remote + variables: + REMOTE_HOST: "aur.archlinux.org" + REMOTE_USER: "aur" + REMOTE_REPOSITORY: "clockify-desktop.git" + before_script: + - echo "Uploading to AUR..." + rules: + - if: *on_master + when: manual diff --git a/Dockerfile.build_and_test b/Dockerfile.build_and_test new file mode 100644 index 000000000000..000affb56474 --- /dev/null +++ b/Dockerfile.build_and_test @@ -0,0 +1,9 @@ +ARG REGISTRY + +FROM "$REGISTRY/common/gitlab-helper/archlinux-yay:master" + +RUN (\ + yay -Syu --noconfirm --needed gtk3 libxss nss \ + && yes | yay -Scc --noconfirm \ + && sudo rm -rf /var/cache/pacman/pkg/* \ +) @@ -4,7 +4,7 @@ # Contributor: Lorenz Wellmer pkgname=clockify-desktop pkgver=1.8.61 -pkgrel=1 +pkgrel=2 pkgdesc="Truly free time tracker for teams, Desktop App" arch=('x86_64') url="https://clockify.me" |