From f03eae3866a32ae175ecb84b894783685f162302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:02:59 +0000 Subject: [PATCH 01/15] Add template gitlab-ci.yml file --- .gitlab-ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..941b8e0 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,36 @@ +# This file is a template, and might need editing before it works on your project. +# see https://docs.gitlab.com/ee/ci/yaml/README.html for all available options + +# you can delete this line if you're not using Docker +image: busybox:latest + +before_script: + - echo "Before script section" + - echo "For example you might run an update here or install a build dependency" + - echo "Or perhaps you might print out some debugging details" + +after_script: + - echo "After script section" + - echo "For example you might do some cleanup here" + +build1: + stage: build + script: + - echo "Do your build here" + +test1: + stage: test + script: + - echo "Do a test here" + - echo "For example run a test suite" + +test2: + stage: test + script: + - echo "Do another parallel test here" + - echo "For example run a lint test" + +deploy1: + stage: deploy + script: + - echo "Do your deploy here" -- GitLab From c8ead512fef118faabede3890485f78b88f42800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:07:22 +0000 Subject: [PATCH 02/15] Update .gitlab-ci.yml --- .gitlab-ci.yml | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 941b8e0..89135cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,11 @@ -# This file is a template, and might need editing before it works on your project. -# see https://docs.gitlab.com/ee/ci/yaml/README.html for all available options +stages: + - build-example -# you can delete this line if you're not using Docker -image: busybox:latest +build-example: + tags: + - docker + script: + - lsb_release -a before_script: - echo "Before script section" @@ -12,25 +15,3 @@ before_script: after_script: - echo "After script section" - echo "For example you might do some cleanup here" - -build1: - stage: build - script: - - echo "Do your build here" - -test1: - stage: test - script: - - echo "Do a test here" - - echo "For example run a test suite" - -test2: - stage: test - script: - - echo "Do another parallel test here" - - echo "For example run a lint test" - -deploy1: - stage: deploy - script: - - echo "Do your deploy here" -- GitLab From 2cdf58d7f8173595f4616d96622734fd214ece3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:08:19 +0000 Subject: [PATCH 03/15] 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 89135cd..71dd1e8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,8 @@ stages: - - build-example + - build build-example: + stage: build tags: - docker script: -- GitLab From 8c1a7ece8f40057779a6dda1b21a2b924edfb163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:15:14 +0000 Subject: [PATCH 04/15] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 71dd1e8..6557d3f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,11 @@ build-example: stage: build tags: - docker + image: + - blang/latex script: - lsb_release -a + - pdflatex -v before_script: - echo "Before script section" -- GitLab From 036c77897f21b4c4d567680cd5471e905c61f028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:15:34 +0000 Subject: [PATCH 05/15] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6557d3f..5407a9a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,7 @@ build-example: stage: build tags: - docker - image: - - blang/latex + image: blang/latex script: - lsb_release -a - pdflatex -v -- GitLab From 2fd4bc1b477de924b48d588916e551d2f9f29daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:21:09 +0000 Subject: [PATCH 06/15] Update .gitlab-ci.yml --- .gitlab-ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5407a9a..f953e29 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,16 +5,14 @@ build-example: stage: build tags: - docker - image: blang/latex + image: blang/latex:ubuntu script: - - lsb_release -a + - ls - pdflatex -v before_script: - echo "Before script section" - - echo "For example you might run an update here or install a build dependency" - - echo "Or perhaps you might print out some debugging details" + - pdflatex -v after_script: - echo "After script section" - - echo "For example you might do some cleanup here" -- GitLab From 5d9cd7fb3fcc9d6039751d4ff007a941fa6d89b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:24:10 +0000 Subject: [PATCH 07/15] Update .gitlab-ci.yml --- .gitlab-ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f953e29..ef131ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,8 +7,13 @@ build-example: - docker image: blang/latex:ubuntu script: - - ls - - pdflatex -v + - cd example + - ln -s ../prace.cls . + - ln -s ../prace-logo.pdf . + - pdflatex example.tex + artifacts: + paths: + - example.pdf before_script: - echo "Before script section" -- GitLab From fba66b89d038bbb2b13a775935fa9a28226ebcf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:25:53 +0000 Subject: [PATCH 08/15] 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 ef131ed..ca44952 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,9 +11,10 @@ build-example: - ln -s ../prace.cls . - ln -s ../prace-logo.pdf . - pdflatex example.tex + - git status artifacts: paths: - - example.pdf + - example/example.pdf before_script: - echo "Before script section" -- GitLab From 9bc0a3e242666cfb2351674ea9f978d168df383e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:34:40 +0000 Subject: [PATCH 09/15] Update .gitlab-ci.yml --- .gitlab-ci.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ca44952..c94de78 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - build + - deploy build-example: stage: build @@ -10,15 +11,20 @@ build-example: - cd example - ln -s ../prace.cls . - ln -s ../prace-logo.pdf . - - pdflatex example.tex - - git status + - latexmk -pdf example.tex artifacts: + when: on_success paths: - example/example.pdf -before_script: - - echo "Before script section" - - pdflatex -v - -after_script: - - echo "After script section" +deploy-pdf: + stage: deploy + dependencies: + - build-example + script: + - git config --global user.email "${CI_EMAIL}" + - git config --global user.name "${CI_USERNAME}" + - git add example/example.pdf + - git commit -m "Compiled PDF from $CI_COMMIT_SHORT_SHA [skip ci]" || echo "No changes, nothing to commit!" + - git remote rm origin && git remote add origin git@repository.prace-ri.eu:$CI_PROJECT_PATH.git + - git push origin HEAD:$CI_COMMIT_REF_NAME # Pushes to the same branch as the trigger -- GitLab From 02ac3a4e826832b09af9850f93baf5e16664fe12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:37:10 +0000 Subject: [PATCH 10/15] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c94de78..08847e2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,6 +21,9 @@ deploy-pdf: stage: deploy dependencies: - build-example + tags: + - docker + image: blang/latex:ubuntu script: - git config --global user.email "${CI_EMAIL}" - git config --global user.name "${CI_USERNAME}" -- GitLab From 72346a7a49173730b571b60d1dbffaef631ea245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:43:34 +0000 Subject: [PATCH 11/15] Update .gitlab-ci.yml --- .gitlab-ci.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08847e2..2502097 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,10 +24,20 @@ deploy-pdf: tags: - docker image: blang/latex:ubuntu + before_script: + # I assume for this to work, I need to set up those variables in the repo + - echo "${SSH_PRIVATE_KEY}" + - echo "${SSH_PUBLIC_KEY}" + - echo "${CI_EMAIL}" + - echo "${CI_USERNAME}" + - echo "${CI_COMMIT_SHORT_SHA}" + - echo "${CI_PROJECT_PATH.git}" + - echo "${CI_COMMIT_REF_NAME}" script: - - git config --global user.email "${CI_EMAIL}" - - git config --global user.name "${CI_USERNAME}" - - git add example/example.pdf - - git commit -m "Compiled PDF from $CI_COMMIT_SHORT_SHA [skip ci]" || echo "No changes, nothing to commit!" - - git remote rm origin && git remote add origin git@repository.prace-ri.eu:$CI_PROJECT_PATH.git - - git push origin HEAD:$CI_COMMIT_REF_NAME # Pushes to the same branch as the trigger + - ls +# - git config --global user.email "${CI_EMAIL}" +# - git config --global user.name "${CI_USERNAME}" +# - git add example/example.pdf +# - git commit -m "Compiled PDF from $CI_COMMIT_SHORT_SHA [skip ci]" || echo "No changes, nothing to commit!" +# - git remote rm origin && git remote add origin git@repository.prace-ri.eu:$CI_PROJECT_PATH.git +# - git push origin HEAD:$CI_COMMIT_REF_NAME # Pushes to the same branch as the trigger -- GitLab From 17b588a369dc27ae7107f0c0eb026174e3c22bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:46:27 +0000 Subject: [PATCH 12/15] 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 2502097..6c9d041 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,12 +26,14 @@ deploy-pdf: image: blang/latex:ubuntu before_script: # I assume for this to work, I need to set up those variables in the repo + # This is likely not a good idea, adding ssh_keys or access tokens... + # https://forum.gitlab.com/t/is-it-possible-to-commit-artifacts-into-the-git/22218/6 - echo "${SSH_PRIVATE_KEY}" - echo "${SSH_PUBLIC_KEY}" - echo "${CI_EMAIL}" - echo "${CI_USERNAME}" - echo "${CI_COMMIT_SHORT_SHA}" - - echo "${CI_PROJECT_PATH.git}" + - echo "${CI_PROJECT_PATH}.git" - echo "${CI_COMMIT_REF_NAME}" script: - ls -- GitLab From 802b4eca7aacf684a9b9fe4065d283207fd2c3d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:52:56 +0000 Subject: [PATCH 13/15] Update .gitlab-ci.yml --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c9d041..54bdf22 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,9 +37,9 @@ deploy-pdf: - echo "${CI_COMMIT_REF_NAME}" script: - ls -# - git config --global user.email "${CI_EMAIL}" -# - git config --global user.name "${CI_USERNAME}" -# - git add example/example.pdf -# - git commit -m "Compiled PDF from $CI_COMMIT_SHORT_SHA [skip ci]" || echo "No changes, nothing to commit!" -# - git remote rm origin && git remote add origin git@repository.prace-ri.eu:$CI_PROJECT_PATH.git + - git config --global user.email "${CI_EMAIL}" + - git config --global user.name "${CI_USERNAME}" + - git add example/example.pdf + - git commit -m "Compiled PDF from $CI_COMMIT_SHORT_SHA [skip ci]" || echo "No changes, nothing to commit!" + - git remote rm origin && git remote add origin https://repository.prace-ri.eu/git/${CI_PROJECT_PATH} # - git push origin HEAD:$CI_COMMIT_REF_NAME # Pushes to the same branch as the trigger -- GitLab From c7e059074812ac1c1cfebf16c3d749d8dcb5111b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 14:55:22 +0000 Subject: [PATCH 14/15] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index af18e39..e9992c1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![pipeline status](https://repository.prace-ri.eu/git/latex-templates/prace-whitepaper/badges/test-CI/pipeline.svg)](https://repository.prace-ri.eu/git/latex-templates/prace-whitepaper/-/commits/test-CI) + # LaTeX package for a PRACE whitepaper (c) CSC - IT Center for Science Ltd. -- GitLab From f8306f3c522e9135dc94ed06f1fb4989038d5530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Tue, 29 Jun 2021 15:09:45 +0000 Subject: [PATCH 15/15] Update .gitlab-ci.yml [skip ci] --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 54bdf22..c16be5a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,10 +26,10 @@ deploy-pdf: image: blang/latex:ubuntu before_script: # I assume for this to work, I need to set up those variables in the repo - # This is likely not a good idea, adding ssh_keys or access tokens... + # This is likely not a good idea, adding access tokens... + # (they can easily leak with a change to .gitlab-ci.yml) # https://forum.gitlab.com/t/is-it-possible-to-commit-artifacts-into-the-git/22218/6 - - echo "${SSH_PRIVATE_KEY}" - - echo "${SSH_PUBLIC_KEY}" + - echo "${CI_ACCESS_TOKEN}" - echo "${CI_EMAIL}" - echo "${CI_USERNAME}" - echo "${CI_COMMIT_SHORT_SHA}" -- GitLab