Compare commits
10 commits
271abf6b33
...
1e4a46dc6e
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e4a46dc6e | |||
|
a241676ca5 |
|||
| 9cb60ea79f | |||
| bc6d70023c | |||
| e7ef82927c | |||
| 46d1858893 | |||
| 671a4cac96 | |||
| bd0db3a18c | |||
| a672836e97 | |||
| d4a5ceef5f |
4 changed files with 41 additions and 18 deletions
|
|
@ -1,20 +1,21 @@
|
||||||
# You can override the included template(s) by including variable overrides
|
# 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
|
# 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
|
# 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
|
# Note that environment variables can be set in several places
|
||||||
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
|
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
|
||||||
image: docker:19.03
|
image: docker:git
|
||||||
services:
|
services:
|
||||||
- docker:19.03-dind
|
- docker:dind
|
||||||
variables:
|
variables:
|
||||||
DOCKER_HOST: tcp://docker:2376
|
DOCKER_HOST: tcp://docker:2376
|
||||||
DOCKER_TLS_CERTDIR: "/certs"
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- commit
|
||||||
- build
|
- build
|
||||||
- test
|
- test
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
before_script:
|
before_script:
|
||||||
|
|
@ -22,28 +23,27 @@ build:
|
||||||
script:
|
script:
|
||||||
- docker build --tag $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID .
|
- docker build --tag $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID .
|
||||||
- docker push $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID
|
- docker push $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
image: $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID
|
image: "$CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID"
|
||||||
script:
|
script:
|
||||||
- python --version
|
- python --version
|
||||||
- nikola --version
|
- nikola --version
|
||||||
- pip --version
|
- pip --version
|
||||||
- pip freeze
|
- pip freeze
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
before_script:
|
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:
|
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:latest
|
- docker tag $CI_REGISTRY_IMAGE:job-$CI_PIPELINE_ID $CI_REGISTRY_IMAGE:latest
|
||||||
- docker push $CI_REGISTRY_IMAGE:latest
|
- docker push $CI_REGISTRY_IMAGE:latest
|
||||||
|
|
||||||
|
|
||||||
sast:
|
|
||||||
stage: test
|
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- template: Security/SAST.gitlab-ci.yml
|
- 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"
|
||||||
|
sast:
|
||||||
|
stage: test
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ 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/
|
||||||
ADD bin/deploy.sh /usr/local/bin/deploy.sh
|
ADD bin/*.sh /usr/local/bin/
|
||||||
|
|
||||||
# ignore "Running pip as root" warning
|
# ignore "Running pip as root" warning
|
||||||
ENV PIP_ROOT_USER_ACTION=ignore
|
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)"
|
||||||
|
|
||||||
|
|
|
||||||
18
bin/build.sh
Normal file
18
bin/build.sh
Normal file
|
|
@ -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 "$?"
|
||||||
|
|
@ -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