diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..62514e8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +* +.* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..75cadee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +ARG ALPINE_VERSION + +FROM alpine:${ALPINE_VERSION} + +ARG GITFTP_VERSION + +CMD ["bash"] + +# hadolint ignore=DL3018 +RUN set -eux; \ + apk add --no-cache \ + bash \ + curl \ + git; + +RUN set -eux; \ + curl -fsSL -o /usr/local/bin/git-ftp "https://raw.githubusercontent.com/git-ftp/git-ftp/${GITFTP_VERSION}/git-ftp"; \ + chmod +x /usr/local/bin/git-ftp diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d6e1912 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 IMAGIN Sp. z o.o. + +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 or substantial portions of the 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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..11ee226 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# Lightweight Docker image with a git-ftp + +An extremely lightweight and well versioned Docker image with a [git-ftp](https://git-ftp.github.io/) - git powered FTP client. + +## Usage + +```yaml +image: octivi/git-ftp:1.6.0-alpine3.11 + +pipelines: + default: + - step: + script: + - git ftp push -v --auto-init --user "${FTP_USER}" --passwd "${FTP_PASSWORD}" "${FTP_DESTINATION}" +``` diff --git a/bin/release b/bin/release new file mode 100755 index 0000000..4677d5c --- /dev/null +++ b/bin/release @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Copyright (C) 2020 IMAGIN Sp. z o.o. +# Author: Marcin Engelmann + +# Unofficial Bash "Strict Mode" http://redsymbol.net/articles/unofficial-bash-strict-mode/ +set -euo pipefail +IFS=$'\n\t' + +if (( $# < 1 )); then + echo "Usage: $0 " + exit 1 +fi + +command -v docker >/dev/null 2>&1 || { echo "docker not installed"; exit 2; } +command -v git >/dev/null 2>&1 || { echo "git not installed"; exit 2; } + +GITFTP_VERSION="$1" +ALPINE_VERSION="$2" + +docker build \ + --tag "octivi/git-ftp:${GITFTP_VERSION}-alpine${ALPINE_VERSION}" \ + --tag "octivi/git-ftp:latest" \ + --build-arg "ALPINE_VERSION=${ALPINE_VERSION}" \ + --build-arg "GITFTP_VERSION=${GITFTP_VERSION}" \ + . + +docker push "octivi/git-ftp:${GITFTP_VERSION}-alpine${ALPINE_VERSION}" +docker push "octivi/git-ftp:latest" + +git tag \ + -a \ + -m "git-ftp version ${GITFTP_VERSION} on alpine linux version ${ALPINE_VERSION}" \ + "${GITFTP_VERSION}-alpine${ALPINE_VERSION}" + +cat <