From 0d3754e2d7f3c1283525fbdf6ad08e06f056cd4b Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 19:01:33 +0000 Subject: [PATCH 01/17] Add Flatpak CI and CD --- .gitlab-ci.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10d2ebf..ebdc3a4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,11 +16,20 @@ build-native: - build/ build-flatpak: - image: fedora:latest + image: black0/flatpak stage: build - before-script: dnf install flatpak + before_script: + - git submodule update --init --recursive + - cd /tmp + - git config --global user.name "$GIT_NAME" + - git config --global user.email "$GIT_EMAIL" + - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" + - cd /builds/b0/matrique script: - - flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub - - flatpak install flathub org.kde.Platform//5.11 - - gpg2 -v --import <(echo $GPG_SECRET_KEY) - + - gpg2 -v --import <(echo "$GPG_SECRET_KEY") + - cd flatpak + - flatpak-builder --repo=/tmp/matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 + - cd /tmp/matrique-repo + - git add -A + - git commit -m "$CI_COMMIT_MESSAGE" + - git push origin master From 708f260608369227871a8c49c5eb49665133a63f Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 19:15:24 +0000 Subject: [PATCH 02/17] Split work. --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ebdc3a4..0760b84 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,21 @@ stages: + - preparation - build + - deploy + +cache: + untracked: true + key: "$CI_PROJECT_ID" + paths: + - /tmp/matrique-repo + +preparation-flatpak: + image: fedora:latest + stage: preparation + script: + - cd /tmp + - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" + - cd /builds/b0/matrique build-native: image: rabits/qt:5.11-desktop @@ -20,16 +36,19 @@ build-flatpak: stage: build before_script: - git submodule update --init --recursive - - cd /tmp - - git config --global user.name "$GIT_NAME" - - git config --global user.email "$GIT_EMAIL" - - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" - - cd /builds/b0/matrique script: - gpg2 -v --import <(echo "$GPG_SECRET_KEY") - cd flatpak - flatpak-builder --repo=/tmp/matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 + +deploy-flatpak: + image: fedora:latest + stage: deploy + before_script: + - git config --global user.name "$GIT_NAME" + - git config --global user.email "$GIT_EMAIL" + script: - cd /tmp/matrique-repo - git add -A - git commit -m "$CI_COMMIT_MESSAGE" - - git push origin master + - git push origin master \ No newline at end of file From cd4e8a71c162e40389c604766f186ab0a4056797 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 19:32:54 +0000 Subject: [PATCH 03/17] Add artifacts. --- .gitlab-ci.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0760b84..05fa62b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,13 +2,7 @@ stages: - preparation - build - deploy - -cache: - untracked: true - key: "$CI_PROJECT_ID" - paths: - - /tmp/matrique-repo - + preparation-flatpak: image: fedora:latest stage: preparation @@ -16,7 +10,12 @@ preparation-flatpak: - cd /tmp - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" - cd /builds/b0/matrique - + + artifacts: + untracked: true + paths: + - /tmp/matrique-repo + build-native: image: rabits/qt:5.11-desktop stage: build @@ -40,6 +39,10 @@ build-flatpak: - gpg2 -v --import <(echo "$GPG_SECRET_KEY") - cd flatpak - flatpak-builder --repo=/tmp/matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 + artifacts: + untracked: true + paths: + - /tmp/matrique-repo deploy-flatpak: image: fedora:latest From 1a43ee1384ddd56662a8fb2d439a0c830307a494 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 19:37:29 +0000 Subject: [PATCH 04/17] Change docker image. Why does not fedora docker image have git by default? --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05fa62b..8c99012 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - deploy preparation-flatpak: - image: fedora:latest + image: black0/flatpak stage: preparation script: - cd /tmp From 37d9eb76708dc1e76420b4a1a2a3d6c7c61c6bcc Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 19:41:18 +0000 Subject: [PATCH 05/17] Fix artifacts issue. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8c99012..4e7a537 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,7 @@ preparation-flatpak: artifacts: untracked: true paths: - - /tmp/matrique-repo + - /tmp/matrique-repo/ build-native: image: rabits/qt:5.11-desktop @@ -42,7 +42,7 @@ build-flatpak: artifacts: untracked: true paths: - - /tmp/matrique-repo + - /tmp/matrique-repo/ deploy-flatpak: image: fedora:latest From adedcd5beb02a5f5480e796b166620bfa575ca10 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 19:53:25 +0000 Subject: [PATCH 06/17] Fix artifacts issue. --- .gitlab-ci.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4e7a537..12c008e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,14 +7,14 @@ preparation-flatpak: image: black0/flatpak stage: preparation script: - - cd /tmp + - cd ../ - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" - - cd /builds/b0/matrique + - cd matrique artifacts: untracked: true paths: - - /tmp/matrique-repo/ + - ../matrique-repo build-native: image: rabits/qt:5.11-desktop @@ -38,12 +38,13 @@ build-flatpak: script: - gpg2 -v --import <(echo "$GPG_SECRET_KEY") - cd flatpak - - flatpak-builder --repo=/tmp/matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 + - flatpak-builder --repo=../../matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 + - cd ../ artifacts: untracked: true paths: - - /tmp/matrique-repo/ - + - ../matrique-repo + deploy-flatpak: image: fedora:latest stage: deploy @@ -51,7 +52,7 @@ deploy-flatpak: - git config --global user.name "$GIT_NAME" - git config --global user.email "$GIT_EMAIL" script: - - cd /tmp/matrique-repo + - cd ../matrique-repo - git add -A - git commit -m "$CI_COMMIT_MESSAGE" - git push origin master \ No newline at end of file From dce1f5f48be4ab3d82072d0a731ac51ee98087dc Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 20:06:38 +0000 Subject: [PATCH 07/17] Move /tmp to tmp/. --- .gitlab-ci.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 12c008e..7bbeeee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,23 +2,25 @@ stages: - preparation - build - deploy + +cache: + paths: + - tmp/ preparation-flatpak: - image: black0/flatpak + image: alpine/git stage: preparation + before_script: + - mkdir tmp script: - - cd ../ + - cd tmp - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" - - cd matrique - - artifacts: - untracked: true - paths: - - ../matrique-repo + - cd ../ build-native: image: rabits/qt:5.11-desktop stage: build + cache: {} before_script: - git submodule update --init --recursive script: @@ -38,12 +40,8 @@ build-flatpak: script: - gpg2 -v --import <(echo "$GPG_SECRET_KEY") - cd flatpak - - flatpak-builder --repo=../../matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 + - flatpak-builder --repo=../tmp/matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 - cd ../ - artifacts: - untracked: true - paths: - - ../matrique-repo deploy-flatpak: image: fedora:latest @@ -52,7 +50,7 @@ deploy-flatpak: - git config --global user.name "$GIT_NAME" - git config --global user.email "$GIT_EMAIL" script: - - cd ../matrique-repo + - cd tmp/matrique-repo - git add -A - git commit -m "$CI_COMMIT_MESSAGE" - git push origin master \ No newline at end of file From a254436c3f9b047b21ec4810a05a987dff69954f Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 20:11:27 +0000 Subject: [PATCH 08/17] Update .gitlab-ci.yml --- .gitlab-ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7bbeeee..0f5fce9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,14 +2,14 @@ stages: - preparation - build - deploy - -cache: - paths: - - tmp/ preparation-flatpak: image: alpine/git stage: preparation + cache: + untracked: true + paths: + - tmp/ before_script: - mkdir tmp script: @@ -46,6 +46,10 @@ build-flatpak: deploy-flatpak: image: fedora:latest stage: deploy + cache: + untracked: true + paths: + - tmp/ before_script: - git config --global user.name "$GIT_NAME" - git config --global user.email "$GIT_EMAIL" From 26f49d3d9c4145987eff655b7510212c25c41d22 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 20:12:42 +0000 Subject: [PATCH 09/17] Update .gitlab-ci.yml --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0f5fce9..b509f9b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,16 +6,16 @@ stages: preparation-flatpak: image: alpine/git stage: preparation - cache: - untracked: true - paths: - - tmp/ before_script: - mkdir tmp script: - cd tmp - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" - cd ../ + cache: + untracked: true + paths: + - tmp/ build-native: image: rabits/qt:5.11-desktop From f7a3e4338e708d32dfd2f08e5652b07f7899e27e Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 20:17:18 +0000 Subject: [PATCH 10/17] Fix cache #1. --- .gitlab-ci.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b509f9b..5f7c5e9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,10 @@ stages: - preparation - build - deploy + +cache: + paths: + - tmp/ preparation-flatpak: image: alpine/git @@ -12,10 +16,6 @@ preparation-flatpak: - cd tmp - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" - cd ../ - cache: - untracked: true - paths: - - tmp/ build-native: image: rabits/qt:5.11-desktop @@ -44,12 +44,8 @@ build-flatpak: - cd ../ deploy-flatpak: - image: fedora:latest + image: alpine/git stage: deploy - cache: - untracked: true - paths: - - tmp/ before_script: - git config --global user.name "$GIT_NAME" - git config --global user.email "$GIT_EMAIL" From baff46b452b6ff9d1b4625929da92eedaf12d653 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 20:20:23 +0000 Subject: [PATCH 11/17] Revert to artifacts. --- .gitlab-ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5f7c5e9..345036b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,10 +2,6 @@ stages: - preparation - build - deploy - -cache: - paths: - - tmp/ preparation-flatpak: image: alpine/git @@ -16,11 +12,13 @@ preparation-flatpak: - cd tmp - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" - cd ../ + artifacts: + paths: + - tmp/ build-native: image: rabits/qt:5.11-desktop stage: build - cache: {} before_script: - git submodule update --init --recursive script: @@ -42,6 +40,9 @@ build-flatpak: - cd flatpak - flatpak-builder --repo=../tmp/matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 - cd ../ + artifacts: + paths: + - tmp/ deploy-flatpak: image: alpine/git From 46bae07d4d174233d34ab46a8f52878755a09b10 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 20:22:26 +0000 Subject: [PATCH 12/17] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 345036b..30d4c4a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,10 +4,12 @@ stages: - deploy preparation-flatpak: - image: alpine/git + image: debian:latest stage: preparation before_script: - mkdir tmp + - apt update + - apt install git script: - cd tmp - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" From 7a72d30195ebd1031a12100322cfb8ae7054eb03 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 20:33:24 +0000 Subject: [PATCH 13/17] Fix Debian. --- .gitlab-ci.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 30d4c4a..869a74a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,35 +2,33 @@ stages: - preparation - build - deploy + +cache: + paths: + - tmp/ preparation-flatpak: image: debian:latest stage: preparation before_script: - mkdir tmp - - apt update - - apt install git + - apt-get update + - apt-get install -y git script: - cd tmp - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" - cd ../ - artifacts: - paths: - - tmp/ build-native: image: rabits/qt:5.11-desktop stage: build + cache: {} before_script: - git submodule update --init --recursive script: - mkdir build && cd build - qmake ../matrique.pro -spec linux-g++ CONFIG+=qtquickcompiler - make -j4 - - artifacts: - paths: - - build/ build-flatpak: image: black0/flatpak @@ -42,9 +40,6 @@ build-flatpak: - cd flatpak - flatpak-builder --repo=../tmp/matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 - cd ../ - artifacts: - paths: - - tmp/ deploy-flatpak: image: alpine/git From 62b6e3bde4f7b001cdf3d41784a6eea91d91a78f Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 21:02:57 +0000 Subject: [PATCH 14/17] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 869a74a..e895fb2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ preparation-flatpak: image: debian:latest stage: preparation before_script: - - mkdir tmp + - mkdir -p tmp - apt-get update - apt-get install -y git script: @@ -26,7 +26,7 @@ build-native: before_script: - git submodule update --init --recursive script: - - mkdir build && cd build + - mkdir -p build && cd build - qmake ../matrique.pro -spec linux-g++ CONFIG+=qtquickcompiler - make -j4 From 5bba0b58d161ae1e988fc59b6edaba857b7d37e6 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 21:06:04 +0000 Subject: [PATCH 15/17] Use artifacts. --- .gitlab-ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e895fb2..ae35405 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,10 +2,6 @@ stages: - preparation - build - deploy - -cache: - paths: - - tmp/ preparation-flatpak: image: debian:latest @@ -18,6 +14,9 @@ preparation-flatpak: - cd tmp - git clone "https://$GIT_USERNAME:$GIT_PASSWORD@gitlab.com/b0/matrique-repo" - cd ../ + artifacts: + paths: + - tmp/ build-native: image: rabits/qt:5.11-desktop @@ -40,11 +39,16 @@ build-flatpak: - cd flatpak - flatpak-builder --repo=../tmp/matrique-repo/public build-dir org.eu.encom.matrique.json --force-clean --gpg-sign=52986BF4D61350EC249F2E891B0DB3358FC5E4B2 - cd ../ + artifacts: + paths: + - tmp/ deploy-flatpak: - image: alpine/git + image: debian:latest stage: deploy before_script: + - apt-get update + - apt-get install -y git - git config --global user.name "$GIT_NAME" - git config --global user.email "$GIT_EMAIL" script: From 69c52eb3e7b6fd2f1dde8dc84b796afa66ccc14e Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 21:27:48 +0000 Subject: [PATCH 16/17] Limit deploy on master only. --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae35405..57d2f91 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,6 +44,7 @@ build-flatpak: - tmp/ deploy-flatpak: + only: master image: debian:latest stage: deploy before_script: From 6b3d8faa4dbd1f4570e920c6ccc10f25db6dad82 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 2 Aug 2018 21:28:15 +0000 Subject: [PATCH 17/17] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57d2f91..31a8036 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,7 +44,8 @@ build-flatpak: - tmp/ deploy-flatpak: - only: master + only: + - master image: debian:latest stage: deploy before_script: