Compare commits
1 commit
stable-1.x
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e4a46dc6e |
6 changed files with 18 additions and 79 deletions
|
|
@ -27,8 +27,6 @@ test:
|
||||||
stage: test
|
stage: test
|
||||||
image: "$CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID"
|
image: "$CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID"
|
||||||
script:
|
script:
|
||||||
- node --version
|
|
||||||
- npm --version
|
|
||||||
- python --version
|
- python --version
|
||||||
- nikola --version
|
- nikola --version
|
||||||
- pip --version
|
- pip --version
|
||||||
|
|
@ -39,9 +37,8 @@ deploy:
|
||||||
- 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:
|
script:
|
||||||
- docker pull $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID
|
- docker pull $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID
|
||||||
- docker tag $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG:-latest}
|
- docker tag $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID $CI_REGISTRY_IMAGE:latest
|
||||||
- echo "deploying $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG:-latest}"
|
- docker push $CI_REGISTRY_IMAGE:latest
|
||||||
- docker push $CI_REGISTRY_IMAGE:${CI_COMMIT_REF_SLUG:-latest}
|
|
||||||
include:
|
include:
|
||||||
- template: Security/SAST.gitlab-ci.yml
|
- template: Security/SAST.gitlab-ci.yml
|
||||||
- template: Security/Container-Scanning.gitlab-ci.yml
|
- template: Security/Container-Scanning.gitlab-ci.yml
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
FROM docker.io/library/python:3.11-alpine
|
FROM docker.io/library/python:3.11-alpine
|
||||||
|
|
||||||
RUN apk --no-cache add sshpass openssh-client lftp nodejs npm; mkdir -p /opt/app
|
RUN apk --no-cache add sshpass openssh-client lftp; mkdir -p /opt/app
|
||||||
WORKDIR /opt/app
|
WORKDIR /opt/app
|
||||||
ADD requirements.txt /root/
|
ADD requirements.txt /root/
|
||||||
ADD Dockerfile /root/
|
ADD Dockerfile /root/
|
||||||
|
|
|
||||||
10
README.md
10
README.md
|
|
@ -11,16 +11,6 @@
|
||||||
This image is based on the python:3.11-alpine image and includes additional
|
This image is based on the python:3.11-alpine image and includes additional
|
||||||
Python-packages for building nikola-sites.
|
Python-packages for building nikola-sites.
|
||||||
|
|
||||||
## Configure your project
|
|
||||||
|
|
||||||
Create a configuration file in your git-repo: `.deployment-helper`
|
|
||||||
|
|
||||||
Configuration-Variables:
|
|
||||||
|
|
||||||
* DEPLOY_HELPER_ENABLE_NIKOLA (default: true)
|
|
||||||
* DEPLOY_HELPER_ENABLE_NODE (default: false)
|
|
||||||
* DEPLOY_HELPER_CONTENT_DIR (default: "website/output")
|
|
||||||
|
|
||||||
## lftp for sftp-Uploads
|
## lftp for sftp-Uploads
|
||||||
|
|
||||||
This image includes `lftp` to upload files to a sftp-server and use
|
This image includes `lftp` to upload files to a sftp-server and use
|
||||||
|
|
|
||||||
57
bin/build.sh
57
bin/build.sh
|
|
@ -1,59 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Default configurations:
|
if ! test -d website
|
||||||
DEPLOY_HELPER_ENABLE_NIKOLA=true
|
|
||||||
DEPLOY_HELPER_ENABLE_NODE=false
|
|
||||||
|
|
||||||
if test -f .deployment-helper
|
|
||||||
then
|
then
|
||||||
# shellcheck source=/dev/null
|
echo "Website directory not found"
|
||||||
. .deployment-helper
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! command -v nikola >/dev/null 2>&1
|
||||||
|
|
||||||
if $DEPLOY_HELPER_ENABLE_NODE
|
|
||||||
then
|
then
|
||||||
if ! command -v node >/dev/null 2>&1
|
echo "nikola command not found"
|
||||||
then
|
exit 1
|
||||||
echo "node not found" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if ! command -v npm >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
echo "npm not found" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if ! test -d node
|
|
||||||
then
|
|
||||||
echo "Node directory not found" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd node || { echo 'Directory "node" not found'; exit 1;}
|
|
||||||
if ! npm install
|
|
||||||
then
|
|
||||||
echo "Error installing node-dependencies" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cd ..
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $DEPLOY_HELPER_ENABLE_NIKOLA
|
cd website
|
||||||
then
|
|
||||||
if ! test -d website
|
|
||||||
then
|
|
||||||
echo "Website directory not found" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v nikola >/dev/null 2>&1
|
nikola build
|
||||||
then
|
|
||||||
echo "nikola command not found" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
cd website || { echo 'Directory "website" not found'; exit 1;}
|
|
||||||
nikola build
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
exit "$?"
|
exit "$?"
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Default configurations:
|
|
||||||
DEPLOY_HELPER_CONTENT_DIR="website/output"
|
|
||||||
|
|
||||||
if test -f .deployment-helper
|
if ! test -d website/output
|
||||||
then
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. .deployment-helper
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if ! test -d "${DEPLOY_HELPER_CONTENT_DIR}"
|
|
||||||
then
|
then
|
||||||
echo "Website-Build not found"
|
echo "Website-Build not found"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -25,9 +16,6 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
lftp -e "set sftp:auto-confirm yes; mirror -R ${DEPLOY_HELPER_CONTENT_DIR} ./web/; bye" \
|
lftp -e 'set sftp:auto-confirm yes; mirror -R ./website/output/ ./web/; bye' --env-password -u ${SSH_USER} sftp://${SSH_HOST}
|
||||||
--env-password \
|
|
||||||
-u ${SSH_USER} \
|
|
||||||
sftp://${SSH_HOST}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,8 @@ Jinja2
|
||||||
aiohttp
|
aiohttp
|
||||||
watchdog
|
watchdog
|
||||||
python-dotenv
|
python-dotenv
|
||||||
|
rstcheck
|
||||||
|
docutils
|
||||||
|
esbonio
|
||||||
|
pytz
|
||||||
|
certifi-linux
|
||||||
Loading…
Add table
Add a link
Reference in a new issue