From ad2960c525bb220838a86e0dca3a1bca6b8be155 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 1 Jul 2021 11:55:35 +0200 Subject: [PATCH 01/14] - test first build script --- .gitlab-ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e1a4913454..21dc2f8d18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,7 @@ syntax:lint: - schedules - web - merge_requests + - /^\d+\.\d+\.\d+$/ script: - echo "Syntax checking PHP files" @@ -58,6 +59,8 @@ test:install: only: - schedules - web + - /^\d+\.\d+\.\d+$/ + script: - $CI_PROJECT_DIR/helper_scripts/test_install_docker.sh - apt-get update @@ -72,6 +75,7 @@ build:package: only: refs: - /^\d+\.\d+\.\d+$/ + - web except: - branches - merge_requests @@ -79,6 +83,14 @@ build:package: - pushes script: - echo "Building release." + - VER="$CI_COMMIT_TAG" + - if [[ "$VER" == "" ]] ; then VER="3.2dev"$(date +%s) ; fi + - if [[ "$VER" != "" ]] ; then echo "Replacing 3.2dev by $VER" ; sed -i -r 's/3\.2dev/'${VER}'/g' install/tpl/config.inc.php.master install/sql/ispconfig3.sql ; fi + - tar -cpzf ISPConfig-${VER}.tar.gz --transform 's,^,ispconfig3_install/,' . + - echo "Listing tar contents for verification" + - tar -tvf ISPConfig-${VER}.tar.gz + - rm ISPConfig-${VER}.tar.gz + needs: ["syntax:lint","test:install"] when: manual allow_failure: false \ No newline at end of file -- GitLab From 6ee7f9dfc6454363a06810c94ecf2653efb0676e Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 1 Jul 2021 12:07:36 +0200 Subject: [PATCH 02/14] - deployment script --- .gitlab-ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 21dc2f8d18..8b43291a42 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -76,11 +76,7 @@ build:package: refs: - /^\d+\.\d+\.\d+$/ - web - except: - - branches - - merge_requests - - schedules - - pushes + script: - echo "Building release." - VER="$CI_COMMIT_TAG" -- GitLab From 585b9acc21ac5c5cf6fbda13e75e79af19afe331 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 1 Jul 2021 12:11:02 +0200 Subject: [PATCH 03/14] - add needs --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b43291a42..7949e00e18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,7 +67,8 @@ test:install: - apt-get --yes install curl - curl --insecure https://127.0.0.1:8080/login/ - ps xaf - + + needs: ["syntax:lint"] build:package: stage: build -- GitLab From e2be3d6751ad06bab7f29515e7daefb048f3dc43 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 1 Jul 2021 12:25:50 +0200 Subject: [PATCH 04/14] - removed install as it does not work anymore --- .gitlab-ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7949e00e18..adfdb18618 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,22 +53,22 @@ syntax_diff:lint: # - vendor/bin/phplint -test:install: - stage: test - image: jerob/docker-ispconfig - only: - - schedules - - web - - /^\d+\.\d+\.\d+$/ - - script: - - $CI_PROJECT_DIR/helper_scripts/test_install_docker.sh - - apt-get update - - apt-get --yes install curl - - curl --insecure https://127.0.0.1:8080/login/ - - ps xaf - - needs: ["syntax:lint"] +#test:install: +# stage: test +# image: jerob/docker-ispconfig +# only: +# - schedules +# - web +# - /^\d+\.\d+\.\d+$/ +# +# script: +# - $CI_PROJECT_DIR/helper_scripts/test_install_docker.sh +# - apt-get update +# - apt-get --yes install curl +# - curl --insecure https://127.0.0.1:8080/login/ +# - ps xaf +# +# needs: ["syntax:lint"] build:package: stage: build -- GitLab From be137b5122ce4a877f5b3af44161b5b1eeee1cb1 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 1 Jul 2021 12:27:00 +0200 Subject: [PATCH 05/14] - dont run both diff and full syntax --- .gitlab-ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index adfdb18618..edf1dee427 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,6 +33,12 @@ syntax_diff:lint: - pushes - branches + except: + - schedules + - web + - merge_requests + - /^\d+\.\d+\.\d+$/ + script: - echo "Syntax checking PHP files" - bash ./.git-scripts/syntax.sh commit @@ -88,6 +94,6 @@ build:package: - tar -tvf ISPConfig-${VER}.tar.gz - rm ISPConfig-${VER}.tar.gz - needs: ["syntax:lint","test:install"] + needs: ["syntax:lint"] when: manual allow_failure: false \ No newline at end of file -- GitLab From eaeffa86ec78cd9840a940735ef895913997f09c Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 1 Jul 2021 12:57:46 +0200 Subject: [PATCH 06/14] - tar returns 1 on changed files --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index edf1dee427..6170891967 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -89,7 +89,9 @@ build:package: - VER="$CI_COMMIT_TAG" - if [[ "$VER" == "" ]] ; then VER="3.2dev"$(date +%s) ; fi - if [[ "$VER" != "" ]] ; then echo "Replacing 3.2dev by $VER" ; sed -i -r 's/3\.2dev/'${VER}'/g' install/tpl/config.inc.php.master install/sql/ispconfig3.sql ; fi - - tar -cpzf ISPConfig-${VER}.tar.gz --transform 's,^,ispconfig3_install/,' . + - RET=0 + - tar -cpzf ISPConfig-${VER}.tar.gz --exclude "ISPConfig-${VER}.tar.gz" --transform 's,^,ispconfig3_install/,' . || RET=$? + - if [[ $RET > 1 ]] ; then exit $RET ; fi - echo "Listing tar contents for verification" - tar -tvf ISPConfig-${VER}.tar.gz - rm ISPConfig-${VER}.tar.gz -- GitLab From d8683cdef3c4b39767e2c2a91136febf1ab44b75 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 1 Jul 2021 13:08:46 +0200 Subject: [PATCH 07/14] - path in tar --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6170891967..aa9ff02b6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -90,7 +90,7 @@ build:package: - if [[ "$VER" == "" ]] ; then VER="3.2dev"$(date +%s) ; fi - if [[ "$VER" != "" ]] ; then echo "Replacing 3.2dev by $VER" ; sed -i -r 's/3\.2dev/'${VER}'/g' install/tpl/config.inc.php.master install/sql/ispconfig3.sql ; fi - RET=0 - - tar -cpzf ISPConfig-${VER}.tar.gz --exclude "ISPConfig-${VER}.tar.gz" --transform 's,^,ispconfig3_install/,' . || RET=$? + - tar -cpzf ISPConfig-${VER}.tar.gz --exclude "ISPConfig-${VER}.tar.gz" --transform 's,^\./,ispconfig3_install/,' . || RET=$? - if [[ $RET > 1 ]] ; then exit $RET ; fi - echo "Listing tar contents for verification" - tar -tvf ISPConfig-${VER}.tar.gz -- GitLab From ba868f017f9667a6496fdda224ed5b84131b3809 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 1 Jul 2021 13:20:13 +0200 Subject: [PATCH 08/14] - exclude git files --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa9ff02b6d..ef2d322c7d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -90,7 +90,7 @@ build:package: - if [[ "$VER" == "" ]] ; then VER="3.2dev"$(date +%s) ; fi - if [[ "$VER" != "" ]] ; then echo "Replacing 3.2dev by $VER" ; sed -i -r 's/3\.2dev/'${VER}'/g' install/tpl/config.inc.php.master install/sql/ispconfig3.sql ; fi - RET=0 - - tar -cpzf ISPConfig-${VER}.tar.gz --exclude "ISPConfig-${VER}.tar.gz" --transform 's,^\./,ispconfig3_install/,' . || RET=$? + - tar -cpzf ISPConfig-${VER}.tar.gz --exclude "ISPConfig-${VER}.tar.gz" --exclude ".git*" --transform 's,^\./,ispconfig3_install/,' . || RET=$? - if [[ $RET > 1 ]] ; then exit $RET ; fi - echo "Listing tar contents for verification" - tar -tvf ISPConfig-${VER}.tar.gz -- GitLab From 6c77dc4891d4fd9d1bd54fe93e24d0e79f57fef2 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 1 Jul 2021 14:11:52 +0200 Subject: [PATCH 09/14] - exclude phplint file --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef2d322c7d..17cdef5e97 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -90,7 +90,7 @@ build:package: - if [[ "$VER" == "" ]] ; then VER="3.2dev"$(date +%s) ; fi - if [[ "$VER" != "" ]] ; then echo "Replacing 3.2dev by $VER" ; sed -i -r 's/3\.2dev/'${VER}'/g' install/tpl/config.inc.php.master install/sql/ispconfig3.sql ; fi - RET=0 - - tar -cpzf ISPConfig-${VER}.tar.gz --exclude "ISPConfig-${VER}.tar.gz" --exclude ".git*" --transform 's,^\./,ispconfig3_install/,' . || RET=$? + - tar -cpzf ISPConfig-${VER}.tar.gz --exclude "ISPConfig-${VER}.tar.gz" --exclude ".git*" --exclude ".phplint.yml" --transform 's,^\./,ispconfig3_install/,' . || RET=$? - if [[ $RET > 1 ]] ; then exit $RET ; fi - echo "Listing tar contents for verification" - tar -tvf ISPConfig-${VER}.tar.gz -- GitLab From 85f2da3b1f3aef7fd2531692ce1e57950e74811b Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 15 Jul 2021 11:20:53 +0200 Subject: [PATCH 10/14] - deploy test --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 17cdef5e97..84260cb030 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -94,6 +94,8 @@ build:package: - if [[ $RET > 1 ]] ; then exit $RET ; fi - echo "Listing tar contents for verification" - tar -tvf ISPConfig-${VER}.tar.gz + - echo "Uploading file to download server" + - curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://168.119.252.196/ - rm ISPConfig-${VER}.tar.gz needs: ["syntax:lint"] -- GitLab From 2bbb4b6b751809ca8d847960865fce06c54cd492 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 15 Jul 2021 11:31:56 +0200 Subject: [PATCH 11/14] - fixed upload deployment path --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 84260cb030..0184d5f802 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,7 +95,7 @@ build:package: - echo "Listing tar contents for verification" - tar -tvf ISPConfig-${VER}.tar.gz - echo "Uploading file to download server" - - curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://168.119.252.196/ + - curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://168.119.252.196/web/ - rm ISPConfig-${VER}.tar.gz needs: ["syntax:lint"] -- GitLab From 929d4ddedd99c80060e3872e9beb910d01d95f59 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 15 Jul 2021 11:56:56 +0200 Subject: [PATCH 12/14] - upload stable on x.x.x tag --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0184d5f802..982641136c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,7 +86,7 @@ build:package: script: - echo "Building release." - - VER="$CI_COMMIT_TAG" + - if [[ "$VER" == "" ]] ; then VER="$CI_COMMIT_TAG" ; fi - if [[ "$VER" == "" ]] ; then VER="3.2dev"$(date +%s) ; fi - if [[ "$VER" != "" ]] ; then echo "Replacing 3.2dev by $VER" ; sed -i -r 's/3\.2dev/'${VER}'/g' install/tpl/config.inc.php.master install/sql/ispconfig3.sql ; fi - RET=0 @@ -96,8 +96,9 @@ build:package: - tar -tvf ISPConfig-${VER}.tar.gz - echo "Uploading file to download server" - curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://168.119.252.196/web/ + - if [[ "$VER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then echo "Stable release ${VER}" ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://168.119.252.196/web/ISPConfig-3-stable.tar.gz ; echo -n "${VER}" > ispconfig3_version.txt ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ispconfig3_version.txt ftp://168.119.252.196/web/ ; else echo "Dev release ${VER}" ; fi - rm ISPConfig-${VER}.tar.gz + - echo "Download path: https://download.ispconfig.org/ISPConfig-${VER}.tar.gz" needs: ["syntax:lint"] - when: manual allow_failure: false \ No newline at end of file -- GitLab From e1047b52fedb44894bb3643fdabb5c007ee3a0c5 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Thu, 15 Jul 2021 11:59:55 +0200 Subject: [PATCH 13/14] - fixed gitlab-ci --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 982641136c..737b41e2ad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -98,7 +98,7 @@ build:package: - curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://168.119.252.196/web/ - if [[ "$VER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then echo "Stable release ${VER}" ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://168.119.252.196/web/ISPConfig-3-stable.tar.gz ; echo -n "${VER}" > ispconfig3_version.txt ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ispconfig3_version.txt ftp://168.119.252.196/web/ ; else echo "Dev release ${VER}" ; fi - rm ISPConfig-${VER}.tar.gz - - echo "Download path: https://download.ispconfig.org/ISPConfig-${VER}.tar.gz" + - echo "Download url is https://download.ispconfig.org/ISPConfig-${VER}.tar.gz" needs: ["syntax:lint"] allow_failure: false \ No newline at end of file -- GitLab From 96b550c2bdd53aaf4108b633dc861c13e2d7bbaf Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Tue, 17 Aug 2021 11:31:56 +0200 Subject: [PATCH 14/14] - ftp server to variable --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 737b41e2ad..6eedb90374 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,8 +95,8 @@ build:package: - echo "Listing tar contents for verification" - tar -tvf ISPConfig-${VER}.tar.gz - echo "Uploading file to download server" - - curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://168.119.252.196/web/ - - if [[ "$VER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then echo "Stable release ${VER}" ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://168.119.252.196/web/ISPConfig-3-stable.tar.gz ; echo -n "${VER}" > ispconfig3_version.txt ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ispconfig3_version.txt ftp://168.119.252.196/web/ ; else echo "Dev release ${VER}" ; fi + - curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://${DEPLOY_FTP_SERVER}/web/ + - if [[ "$VER" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then echo "Stable release ${VER}" ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ISPConfig-${VER}.tar.gz ftp://${DEPLOY_FTP_SERVER}/web/ISPConfig-3-stable.tar.gz ; echo -n "${VER}" > ispconfig3_version.txt ; curl -u "${DEPLOY_FTP_USER}:${DEPLOY_FTP_PASSWORD}" -T ispconfig3_version.txt ftp://${DEPLOY_FTP_SERVER}/web/ ; else echo "Dev release ${VER}" ; fi - rm ISPConfig-${VER}.tar.gz - echo "Download url is https://download.ispconfig.org/ISPConfig-${VER}.tar.gz" -- GitLab