From d4a5ceef5f0a710d384427b0449dc10e061563a7 Mon Sep 17 00:00:00 2001 From: Frank Agerholm Date: Tue, 8 Aug 2023 12:37:31 +0000 Subject: [PATCH 1/9] Update .gitlab-ci.yml --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 751067f..0e69fd6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,3 +47,4 @@ sast: include: - template: Security/SAST.gitlab-ci.yml +- template: Security/Container-Scanning.gitlab-ci.yml From a672836e97e6148c3c37599b6814548f4760d37c Mon Sep 17 00:00:00 2001 From: Frank Agerholm Date: Tue, 8 Aug 2023 12:42:19 +0000 Subject: [PATCH 2/9] Update .gitlab-ci.yml --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e69fd6..d470dac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,3 +48,7 @@ sast: include: - template: Security/SAST.gitlab-ci.yml - template: Security/Container-Scanning.gitlab-ci.yml + +container_scanning: + variables: + CS_IMAGE: $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID From bd0db3a18cc8b504558f69b96a5e630f01fba519 Mon Sep 17 00:00:00 2001 From: Frank Agerholm Date: Tue, 8 Aug 2023 12:51:23 +0000 Subject: [PATCH 3/9] Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d470dac..b65f534 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,9 +42,6 @@ deploy: - docker push $CI_REGISTRY_IMAGE:latest -sast: - stage: test - include: - template: Security/SAST.gitlab-ci.yml - template: Security/Container-Scanning.gitlab-ci.yml From 671a4cac960476492581c9a66f38c167153b95ab Mon Sep 17 00:00:00 2001 From: Frank Agerholm Date: Tue, 8 Aug 2023 12:54:50 +0000 Subject: [PATCH 4/9] Update .gitlab-ci.yml --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b65f534..b490b68 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,9 +11,10 @@ variables: DOCKER_TLS_CERTDIR: "/certs" stages: -- build -- test -- deploy + - commit + - build + - test + - deploy build: stage: build From 46d1858893a9c7d68e57a32313a4712f5aca628f Mon Sep 17 00:00:00 2001 From: Frank Agerholm Date: Tue, 8 Aug 2023 13:02:50 +0000 Subject: [PATCH 5/9] Update .gitlab-ci.yml, use latest docker images --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b490b68..debaf7b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,9 +3,11 @@ # Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings # Note that environment variables can be set in several places # See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence -image: docker:19.03 +#image: docker:19.03 +image: docker:dind services: -- docker:19.03-dind +#- docker:19.03-dind +- docker:dind variables: DOCKER_HOST: tcp://docker:2376 DOCKER_TLS_CERTDIR: "/certs" From e7ef82927cd3a9581c003c3fe34a62b700bb77f4 Mon Sep 17 00:00:00 2001 From: Frank Agerholm Date: Tue, 8 Aug 2023 13:05:28 +0000 Subject: [PATCH 6/9] Update .gitlab-ci.yml, use docker image with included git --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index debaf7b..94919b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ # Note that environment variables can be set in several places # See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence #image: docker:19.03 -image: docker:dind +image: docker:git services: #- docker:19.03-dind - docker:dind From bc6d70023cef35371df916c8858b81b187015536 Mon Sep 17 00:00:00 2001 From: Frank Agerholm Date: Tue, 8 Aug 2023 13:08:08 +0000 Subject: [PATCH 7/9] Configure SAST in `.gitlab-ci.yml`, creating this file if it does not already exist --- .gitlab-ci.yml | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94919b3..a5f09de 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,23 +1,21 @@ # You can override the included template(s) by including variable overrides # SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings # Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings +# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings +# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings # Note that environment variables can be set in several places # See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence -#image: docker:19.03 image: docker:git services: -#- docker:19.03-dind - docker:dind variables: DOCKER_HOST: tcp://docker:2376 DOCKER_TLS_CERTDIR: "/certs" - stages: - - commit - - build - - test - - deploy - +- commit +- build +- test +- deploy build: stage: build before_script: @@ -25,30 +23,27 @@ build: script: - docker build --tag $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID . - docker push $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID - test: stage: test - image: $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID + image: "$CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID" script: - python --version - nikola --version - pip --version - pip freeze - deploy: stage: deploy before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - - docker pull $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID - - docker tag $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID $CI_REGISTRY_IMAGE:latest - - docker push $CI_REGISTRY_IMAGE:latest - - + - docker pull $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID + - docker tag $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID $CI_REGISTRY_IMAGE:latest + - docker push $CI_REGISTRY_IMAGE:latest include: - template: Security/SAST.gitlab-ci.yml - template: Security/Container-Scanning.gitlab-ci.yml - container_scanning: variables: - CS_IMAGE: $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID + CS_IMAGE: "$CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID" +sast: + stage: test From a241676ca57ff80fbfeef263801ab33ab8e964a8 Mon Sep 17 00:00:00 2001 From: Frank Agerholm Date: Wed, 30 Oct 2024 22:12:10 +0100 Subject: [PATCH 8/9] build.sh Script for nikola build --- Dockerfile | 4 ++-- bin/build.sh | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 bin/build.sh diff --git a/Dockerfile b/Dockerfile index e775e3d..74bd758 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,10 @@ RUN apk --no-cache add sshpass openssh-client lftp; mkdir -p /opt/app WORKDIR /opt/app ADD requirements.txt /root/ ADD Dockerfile /root/ -ADD bin/deploy.sh /usr/local/bin/deploy.sh +ADD bin/*.sh /usr/local/bin/ # ignore "Running pip as root" warning ENV PIP_ROOT_USER_ACTION=ignore -RUN chmod 755 /usr/local/bin/deploy.sh && pip install -r /root/requirements.txt && pip freeze && rm -Rf "$(pip cache dir)" +RUN chmod 755 /usr/local/bin/*.sh && pip install -r /root/requirements.txt && pip freeze && rm -Rf "$(pip cache dir)" diff --git a/bin/build.sh b/bin/build.sh new file mode 100644 index 0000000..727aa8f --- /dev/null +++ b/bin/build.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +if ! test -d website +then + echo "Website directory not found" + exit 1 +fi + +if ! command -v nikola >/dev/null 2>&1 +then + echo "nikola command not found" + exit 1 +fi + +cd website + +nikola build +exit "$?" From 1e4a46dc6e78ff9dd7da103e7f79759873d8764e Mon Sep 17 00:00:00 2001 From: Frank Agerholm Date: Fri, 5 Dec 2025 17:11:01 +0100 Subject: [PATCH 9/9] Additional Python dependencies added. --- requirements.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/requirements.txt b/requirements.txt index ca82f01..7516d19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,8 @@ Jinja2 aiohttp watchdog python-dotenv +rstcheck +docutils +esbonio +pytz +certifi-linux \ No newline at end of file