diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..8346b938ba9c449f2967839a14267d590c25c54a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +build: + image: docker:git + stage: build + tags: + - docker-dind + services: + - docker:dind + before_script: + - docker info + - IMAGE=${CI_REGISTRY}/pelican + script: + - docker build -t ${IMAGE}:latest . + - alpine_version=alpine-$( docker run --rm --entrypoint /bin/sh ${IMAGE}:latest -c 'cat /etc/alpine-release' ) + - python_version=$( docker run --rm --entrypoint /usr/local/bin/python3 ${IMAGE}:latest --version | tr ' ' - ) + - pelican_version=$( docker run --rm --entrypoint /usr/local/bin/pip3 ${IMAGE}:latest list | grep pelican | sed -e 's/ \+/-/' ) + - TAG="$( ./common/image_tag.sh )_${alpine_version}_${python_version}_${pelican_version}" + - docker tag ${IMAGE}:latest ${IMAGE}:${TAG} + - docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" ${CI_REGISTRY} + - 'echo "Pushing: ${IMAGE}:${TAG}"' + - docker push ${IMAGE}:${TAG} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..0b0a8816d74a2b04ccdbc5607877a68719ec9b42 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM python:alpine +RUN pip3 install pelican[markdown] +RUN mkdir /source +ENTRYPOINT ["/usr/local/bin/pelican"] +CMD ["/source"]