grim/containers/trac-bootstrap

Move to mc and tweak the image name
draft
2021-04-11, Gary Kramlich
972e509e412a
Parents 3743be918e11
Children 2338a63e5d7e
Move to mc and tweak the image name
  • +2 -8
    Dockerfile
  • +24 -31
    bootstrap
  • +1 -1
    convey.yml
  • +0 -82
    s3cfg
  • +0 -82
    s3cfg.in
  • --- a/Dockerfile Tue Feb 23 04:05:54 2021 -0600
    +++ b/Dockerfile Sun Apr 11 02:16:48 2021 -0500
    @@ -1,15 +1,9 @@
    -FROM jess/s3cmd:latest
    +FROM alpine:edge
    MAINTAINER Gary Kramlich <grim@reaperworld.com>
    RUN set -ex && \
    - apt-get update && \
    - apt-get install -y --no-install-recommends gettext xz-utils && \
    - apt-get clean && \
    - rm -rf /var/lib/apt/lists
    -
    -COPY s3cfg.in /root/
    -COPY bootstrap /usr/local/bin/
    + apk add --no-cache mc bzip2 gzip tar xz zstd
    ENTRYPOINT ["/usr/local/bin/bootstrap"]
    --- a/bootstrap Tue Feb 23 04:05:54 2021 -0600
    +++ b/bootstrap Sun Apr 11 02:16:48 2021 -0500
    @@ -1,47 +1,40 @@
    #!/bin/sh -e
    -OUTPUT_FILENAME="/tmp/bootstrap.tar.xz"
    -
    -export S3CMD_SIGNATURE_V2="${S3CMD_SIGNATURE_V2:-False}"
    -export S3CMD_BUCKET_LOCATION="${S3CMD_BUCKET_LOCATION:-US}"
    -export S3CMD_HOST_BASE="${S3CMD_HOST_BASE:-s3.amazonaws.com}"
    -export S3CMD_HOST_BUCKET="${S3CMD_HOST_BUCKET:-%(bucket)s.s3.amazonaws.com}"
    -
    -# make sure our required environment variables are set
    -if [ -z "${AWS_ACCESS_KEY_ID}" ] ; then
    - echo "AWS_ACCESS_KEY_ID environment variable must be set" >&2
    - exit 1
    -fi
    -
    -if [ -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
    - echo "AWS_SECRET_ACCESS_KEY environment variable must be set" >&2
    - exit 1
    -fi
    if [ -z "${S3_URL}" ] ; then
    echo "S3_URL environment variable must be set" >&2
    exit 1
    fi
    -if [ -z "${OUTPUT}" ] ; then
    - echo "OUTPUT environment variable must be set" >&2
    +if [ -z "${S3_KEY}" ] ; then
    + echo "S3_KEY environment variable must be set" >&2
    + exit
    +fi
    +
    +if [ -z "${S3_ACCESS_KEY}" ] ; then
    + echo "S3_ACCESS_KEY environment variable must be set" >&2
    exit 1
    fi
    -# Make sure we're not already bootstrapped
    -if [ -f "${OUTPUT}/conf/trac.ini" ] ; then
    - echo "Already boot strapped"
    +if [ -z "${S3_SECRET_KEY}" ] ; then
    + echo "S3_SECRET_KEY environment variable must be set" >&2
    + exit 1
    +fi
    +
    +if [ -z "${DESTINATION}" ] ; then
    + echo "DESTINATION environment variable must be set" >&2
    + exit 1
    +fi
    +
    +# make sure we're not already bootstrapped
    +if [ -f "${DESTINATION}/conf/trac.ini" ] ; then
    + echo "${DESTINATION} has already been boot strapped"
    exit 0
    fi
    -cat /root/s3cfg.in | envsubst > /root/.s3cfg
    -rm -f /root/s3cfg.in
    -
    -s3cmd get "${S3_URL}" "${OUTPUT_FILENAME}"
    +# create our alias in mc
    +mc alias set trac-bootstrap "${S3_URL}" "${S3_ACCESS_KEY}" "${S3_SECRET_KEY}"
    -mkdir -p "${OUTPUT}"
    -cd "${OUTPUT}"
    -tar Jxf "${OUTPUT_FILENAME}"
    +mc cat "trac-bootstrap/${S3_KEY}" | tar -C "${DESTINATION}"
    +exit $?
    -exit 0
    -
    --- a/convey.yml Tue Feb 23 04:05:54 2021 -0600
    +++ b/convey.yml Sun Apr 11 02:16:48 2021 -0500
    @@ -1,5 +1,5 @@
    environment:
    - - REPO=rwgrim/pidgin-trac-bootstrap
    + - REPO=rwgrim/trac-bootstrap
    - TAG=latest
    - REGISTRY=docker.io
    - REGISTRY_USERNAME
    --- a/s3cfg Tue Feb 23 04:05:54 2021 -0600
    +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
    @@ -1,82 +0,0 @@
    -[default]
    -access_key = ${AWS_ACCESS_KEY_ID}
    -access_token =
    -add_encoding_exts =
    -add_headers =
    -bucket_location = main
    -ca_certs_file =
    -cache_file =
    -check_ssl_certificate = True
    -check_ssl_hostname = True
    -cloudfront_host = cloudfront.amazonaws.com
    -content_disposition =
    -content_type =
    -default_mime_type = binary/octet-stream
    -delay_updates = False
    -delete_after = False
    -delete_after_fetch = False
    -delete_removed = False
    -dry_run = False
    -enable_multipart = True
    -encoding = UTF-8
    -encrypt = False
    -expiry_date =
    -expiry_days =
    -expiry_prefix =
    -follow_symlinks = False
    -force = False
    -get_continue = False
    -gpg_command = None
    -gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
    -gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
    -gpg_passphrase =
    -guess_mime_type = True
    -host_base = data.imfreedom.org
    -host_bucket = data.imfreedom.org/%(bucket)s/
    -human_readable_sizes = False
    -invalidate_default_index_on_cf = False
    -invalidate_default_index_root_on_cf = True
    -invalidate_on_cf = False
    -kms_key =
    -limit = -1
    -limitrate = 0
    -list_md5 = False
    -log_target_prefix =
    -long_listing = False
    -max_delete = -1
    -mime_type =
    -multipart_chunk_size_mb = 15
    -multipart_max_chunks = 10000
    -preserve_attrs = True
    -progress_meter = True
    -proxy_host =
    -proxy_port = 0
    -put_continue = False
    -recursive = False
    -recv_chunk = 65536
    -reduced_redundancy = False
    -requester_pays = False
    -restore_days = 1
    -restore_priority = Standard
    -secret_key = ${AWS_SECRET_ACCESS_KEY}
    -send_chunk = 65536
    -server_side_encryption = False
    -signature_v2 = False
    -signurl_use_https = False
    -simpledb_host = sdb.amazonaws.com
    -skip_existing = False
    -socket_timeout = 300
    -stats = False
    -stop_on_error = False
    -storage_class =
    -throttle_max = 100
    -upload_id =
    -urlencoding_mode = normal
    -use_http_expect = False
    -use_https = True
    -use_mime_magic = True
    -verbosity = WARNING
    -website_endpoint = http://%(bucket)s.s3-website-%(location)s.amazonaws.com/
    -website_error =
    -website_index = index.html
    -
    --- a/s3cfg.in Tue Feb 23 04:05:54 2021 -0600
    +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
    @@ -1,82 +0,0 @@
    -[default]
    -access_key = ${AWS_ACCESS_KEY_ID}
    -access_token =
    -add_encoding_exts =
    -add_headers =
    -bucket_location = ${S3CMD_BUCKET_LOCATION}
    -ca_certs_file =
    -cache_file =
    -check_ssl_certificate = True
    -check_ssl_hostname = True
    -cloudfront_host = cloudfront.amazonaws.com
    -content_disposition =
    -content_type =
    -default_mime_type = binary/octet-stream
    -delay_updates = False
    -delete_after = False
    -delete_after_fetch = False
    -delete_removed = False
    -dry_run = False
    -enable_multipart = True
    -encoding = UTF-8
    -encrypt = False
    -expiry_date =
    -expiry_days =
    -expiry_prefix =
    -follow_symlinks = False
    -force = False
    -get_continue = False
    -gpg_command = None
    -gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
    -gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
    -gpg_passphrase =
    -guess_mime_type = True
    -host_base = ${S3CMD_HOST_BASE}
    -host_bucket = ${S3CMD_HOST_BUCKET}
    -human_readable_sizes = False
    -invalidate_default_index_on_cf = False
    -invalidate_default_index_root_on_cf = True
    -invalidate_on_cf = False
    -kms_key =
    -limit = -1
    -limitrate = 0
    -list_md5 = False
    -log_target_prefix =
    -long_listing = False
    -max_delete = -1
    -mime_type =
    -multipart_chunk_size_mb = 15
    -multipart_max_chunks = 10000
    -preserve_attrs = True
    -progress_meter = True
    -proxy_host =
    -proxy_port = 0
    -put_continue = False
    -recursive = False
    -recv_chunk = 65536
    -reduced_redundancy = False
    -requester_pays = False
    -restore_days = 1
    -restore_priority = Standard
    -secret_key = ${AWS_SECRET_ACCESS_KEY}
    -send_chunk = 65536
    -server_side_encryption = False
    -signature_v2 = ${S3CMD_SIGNATURE_V2}
    -signurl_use_https = False
    -simpledb_host = sdb.amazonaws.com
    -skip_existing = False
    -socket_timeout = 300
    -stats = False
    -stop_on_error = False
    -storage_class =
    -throttle_max = 100
    -upload_id =
    -urlencoding_mode = normal
    -use_http_expect = False
    -use_https = True
    -use_mime_magic = True
    -verbosity = WARNING
    -website_endpoint = http://%(bucket)s.s3-website-%(location)s.amazonaws.com/
    -website_error =
    -website_index = index.html
    -