diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 74dd9a1c64a66e9d8422aa440f720b0c63196a39..d360a9a4c725d18d951923fbc10b00edc9e7b97a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -30,6 +30,9 @@ build-tag: - IMAGE_6="$CI_REGISTRY_IMAGE/pvs_ingestor" - docker pull "$IMAGE_6":latest || true - docker build --cache-from "$IMAGE_6":latest -t "$IMAGE_6":dev -t "$IMAGE_6":$CI_COMMIT_TAG ingestor/ + - IMAGE_7="$CI_REGISTRY_IMAGE/pvs_sftp" + - docker pull "$IMAGE_7":latest || true + - docker build --cache-from "$IMAGE_7":latest -t "$IMAGE_7":latest -t "$IMAGE_7":$CI_COMMIT_TAG sftp/ - cd ./testing && ./gitlab_test.sh - if [ $? -ne 0 ]; then exit 1; fi # actually fail build - docker push "$IMAGE_1":$CI_COMMIT_TAG @@ -70,6 +73,9 @@ build-master-staging: - IMAGE_6="$CI_REGISTRY_IMAGE/pvs_ingestor" - docker pull "$IMAGE_6":"$TAG_USED" || true - docker build --cache-from "$IMAGE_6":"$TAG_USED" -t "$IMAGE_6":dev -t "$IMAGE_6":"$TAG_USED" ingestor/ + - IMAGE_7="$CI_REGISTRY_IMAGE/pvs_sftp" + - docker pull "$IMAGE_7":latest || true + - docker build --cache-from "$IMAGE_7":latest -t "$IMAGE_7":latest -t "$IMAGE_7":$CI_COMMIT_TAG sftp/ - cd ./testing && ./gitlab_test.sh - if [ $? -ne 0 ]; then exit 1; fi # actually fail build - docker push "$IMAGE_1":"$TAG_USED" @@ -112,6 +118,9 @@ build: - IMAGE="$CI_REGISTRY_IMAGE/pvs_ingestor" - docker pull "$IMAGE":staging || true - docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev ingestor/ + - IMAGE="$CI_REGISTRY_IMAGE/pvs_sftp" + - docker pull "$IMAGE":staging || true + - docker build --cache-from "$IMAGE":staging -t "$IMAGE":dev sftp/ - cd ./testing && ./gitlab_test.sh - if [ $? -ne 0 ]; then exit 1; fi # actually fail build except: diff --git a/docker-compose.dem.yml b/docker-compose.dem.yml index e24433b4d6d2c99cb5df5d098c2904dce5622169..6178f53c03ae8f19c2684722193be18c55e03af7 100644 --- a/docker-compose.dem.yml +++ b/docker-compose.dem.yml @@ -173,7 +173,7 @@ services: deploy: replicas: 1 sftp: - image: atmoz/sftp:latest + image: registry.gitlab.eox.at/esa/prism/vs/pvs_sftp:latest volumes: - type: volume source: report-data diff --git a/docker-compose.emg.yml b/docker-compose.emg.yml index 1f681ac9fdf49c9b051e6aee8872809f842946f6..a74d3460c750debac5d88ba48c9f1c43cb0bcaea 100644 --- a/docker-compose.emg.yml +++ b/docker-compose.emg.yml @@ -188,7 +188,7 @@ services: deploy: replicas: 1 sftp: - image: atmoz/sftp:latest + image: registry.gitlab.eox.at/esa/prism/vs/pvs_sftp:latest volumes: - type: volume source: report-data diff --git a/docker-compose.vhr18.yml b/docker-compose.vhr18.yml index 557e100ad0b27dbe1cc3db26f3a412da6f10bcf0..40206b9e414e809ba7807aff1b8462517ec17940 100644 --- a/docker-compose.vhr18.yml +++ b/docker-compose.vhr18.yml @@ -192,7 +192,7 @@ services: deploy: replicas: 1 sftp: - image: atmoz/sftp:latest + image: registry.gitlab.eox.at/esa/prism/vs/pvs_sftp:latest volumes: - type: volume source: report-data diff --git a/sftp/Dockerfile b/sftp/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7de2476942a10ee3a19ad41c387954a9e8c0a257 --- /dev/null +++ b/sftp/Dockerfile @@ -0,0 +1,40 @@ +#------------------------------------------------------------------------------ +# +# Project: prism view server +# Authors: Stephan Meissl <stephan.meissl@eox.at> +# +#------------------------------------------------------------------------------ +# Copyright (C) 2020 EOX IT Services GmbH <https://eox.at> +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies of this Software or works derived from this Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +#----------------------------------------------------------------------------- + +FROM atmoz/sftp:latest + +LABEL name="prism view server docker base image" \ + vendor="EOX IT Services GmbH <https://eox.at>" \ + license="MIT Copyright (C) 2020 EOX IT Services GmbH <https://eox.at>" \ + type="prism view server docker base image" \ + version="1.0.0" + + +RUN mkdir /etc/sftp.d +ADD entrypoint.sh /etc/sftp.d + +RUN chmod -v +x /etc/sftp.d/entrypoint.sh diff --git a/sftp/entrypoint.sh b/sftp/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..7d70c0e8b377cf071c5c104592986e15bbd71a9b --- /dev/null +++ b/sftp/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash +echo " baloola" +for user_home in /home/* ; do +echo $user_home + if [ -d "$user_home" ]; then + username=`basename $user_home` + echo "Setup $user_home/data folder for $username" + mkdir -p $user_home/data + chown -R $username:users $user_home/data + fi + +done