Commit 8f049a00 authored by Josh Zamor's avatar Josh Zamor
Browse files

#724, chg ftp-put's volumes and paths and readme

parent a72b1d05
Pipeline #245188414 failed with stages
in 13 minutes and 11 seconds
# SFTP Upload Tool
This tool downloads XML files for processing by the PCMT. See
https://gitlab.com/pcmt/pcmt/-/issues/681
## Configure
Environment variables to configure how this container runs. Ones without
a default are *required*. Aside from `FTP_PUT_CREDS`, any may be set in the
file that `FTP_PUT_CREDS` points to.
1. `FTP_PUT_CREDS`: Where the file that contains the credentials will be
mounted into the container. Default: `/run/secrets/ftp-put-creds`
1. `SFTP_USER`: The SFTP username, should be in `FTP_GET_CREDS`.
1. `SFTP_HOST`: The SFTP hostname, should be in `FTP_GET_CREDS`.
1. `SFTP_PRIVKEY_FILENAME`: Set where the file that contains the SFTP user's
private OpenSSH key will be mounted into the container.
1. `SFTP_LOCAL_DIR`: Where the files to upload to the SFTP server are
to. Default: `/uploads/work`.
1. `SFTP_LOCAL_ARCHIVE_DIR`: Where the files will be moved to, locally, after
they are uploaded. Defaults to `/uploads/done`.
1. `SFTP_REMOTE_DIR`: The remote working directory to upload files to.
1. `SFTP_REMOTE_ARCHIVE_DIR`: The remote final destination directory to move files
to, once they're _fully_ uploaded to `SFTP_REMOTE_DIR`.
## Example
See [ftp-get](../ftp-get/README.md) for examples.
\ No newline at end of file
......@@ -26,9 +26,9 @@ source "$FTP_PUT_CREDS"
: "${SFTP_HOST:?SFTP_HOST not set}"
: "${SFTP_PRIVKEY_FILENAME:?SFTP_PRIVKEY_FILENAME not set}"
error_when_unreadable "$SFTP_PRIVKEY_FILENAME"
: "${SFTP_LOCAL_DIR:=/downloads/work}"
: "${SFTP_LOCAL_DIR:=/uploads/work}"
error_when_unreadable "$SFTP_LOCAL_DIR"
: "${SFTP_LOCAL_ARCHIVE_DIR:=/downloads/done}"
: "${SFTP_LOCAL_ARCHIVE_DIR:=/uploads/done}"
error_when_unreadable "$SFTP_LOCAL_ARCHIVE_DIR"
: "${SFTP_REMOTE_DIR:?SFTP_REMOTE_DIR not set}"
: "${SFTP_REMOTE_ARCHIVE_DIR:?SFTP_REMOTE_ARCHIVE_DIR not set}"
......
......@@ -9,6 +9,7 @@ services:
fpm:
volumes:
- 'ftp-get:/srv/pim/src/PcmtCoreBundle/Resources/E2OpenImport/work/'
- 'ftp-put:/srv/pim/src/PcmtCISBundle/Resources/E2OpenCIS/'
mysql:
ports:
......@@ -70,12 +71,10 @@ services:
environment:
CRON_SCHEDULE: '*/10 * * * *'
SFTP_PRIVKEY_FILENAME: '/run/secrets/sftp-privkey'
SFTP_LOCAL_DIR: '/srv/pim/src/PcmtCISBundle/Resources/E2OpenCIS/work/'
SFTP_LOCAL_ARCHIVE_DIR: '/srv/pim/src/PcmtCISBundle/Resources/E2OpenCIS/done/'
SFTP_REMOTE_DIR: '/in/.sftp/'
SFTP_REMOTE_ARCHIVE_DIR: '/in/'
SFTP_LOCAL_DIR: '/uploads/work/'
SFTP_LOCAL_ARCHIVE_DIR: '/uploads/done/'
volumes:
- 'ftp-put:/srv/pim/src/PcmtCoreBundle/Resources/E2OpenImport/'
- 'ftp-put:/uploads'
secrets:
- ftp-put-creds
- sftp-privkey
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment