From 3a595cc3576c76d1155de160acd9d99592c52211 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Pokorn=C3=BD?= <lukas@easy.cz>
Date: Wed, 21 Jun 2023 14:52:34 +0200
Subject: [PATCH] mirror our redis

---
 .gitlab-ci.yml           | 59 ++++++++++++++++++++--------------------
 LICENSE                  | 38 ++++++++++++--------------
 README.md                |  4 ++-
 build_redis-6/Dockerfile |  1 -
 build_redis-6/VERSION    |  1 -
 redis-server/Dockerfile  |  2 ++
 6 files changed, 52 insertions(+), 53 deletions(-)
 delete mode 100644 build_redis-6/Dockerfile
 delete mode 100644 build_redis-6/VERSION
 create mode 100644 redis-server/Dockerfile

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2e579be..9fbed3c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,35 +1,36 @@
-# This file is a template, and might need editing before it works on your project.
-# To contribute improvements to CI/CD templates, please follow the Development guide at:
-# https://docs.gitlab.com/ee/development/cicd/templates.html
-# This specific template is located at:
-# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Docker.gitlab-ci.yml
-
-# Build a Docker image with CI/CD and push to the GitLab registry.
-# Docker-in-Docker documentation: https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
-#
-# This template uses one generic job with conditional builds
-# for the default branch and all other (MR) branches.
-
-docker-build:
-  # Use the official docker image.
+.default:
   image: docker:latest
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+      when: never
+    - if: $CI_PIPELINE_SOURCE == "push"
+      when: manual
+    - when: always
+  variables:
+    DOCKER_BUILDKIT: 1
+  tags:
+    - docker-privileged
   stage: build
   services:
     - docker:dind
   before_script:
-    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
-  # Default branch leaves tag empty (= latest tag)
-  # All other branches are tagged with the escaped branch name (commit ref slug)
+    - docker login -u "${CI_REGISTRY_USER}" -p "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
+
+.build redis:
+  extends:
+    - .default
   script:
-    - |
-      if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
-        tag=""
-      else
-        tag="-$CI_COMMIT_REF_SLUG"
-      fi
-    - |
-      for build in ./build_*; do
-        VERSION=$(cat ${build}/VERSION)
-        docker build --pull -t "$CI_REGISTRY_IMAGE:${VERSION}${tag}" ${build}/.
-        docker push "$CI_REGISTRY_IMAGE:${VERSION}${tag}"
-      done
+    - docker build --pull -t "${CI_REGISTRY_IMAGE}:${VERSION}" --build-arg "REDIS_VERSION=${VERSION}" .
+    - docker push "${CI_REGISTRY_IMAGE}:${VERSION}"
+
+build redis 6:
+  extends:
+    - .build redis
+  variables:
+    VERSION: 6
+
+build redis 7:
+    extends:
+        - .build redis
+    variables:
+        VERSION: 7
diff --git a/LICENSE b/LICENSE
index 30ed729..ad790b9 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,25 +1,21 @@
-BSD 2-Clause License
+MIT License
 
-Copyright (c) 2022, Marek Sirovy
-All rights reserved.
+Copyright (c) 2023 Lukáš Pokorný
 
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
+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:
 
-1. Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
 
-2. Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+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
index a7510f6..b98e053 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
 # Redis
 
-Update run every week during sunday by pipeline scheduler
+Easy mirror of https://hub.docker.com/_/ruby with our base image.
 
+* for speedup installation
+* for prevent BAN from dockerhub
diff --git a/build_redis-6/Dockerfile b/build_redis-6/Dockerfile
deleted file mode 100644
index 56c65f6..0000000
--- a/build_redis-6/Dockerfile
+++ /dev/null
@@ -1 +0,0 @@
-FROM redis:6
diff --git a/build_redis-6/VERSION b/build_redis-6/VERSION
deleted file mode 100644
index 1e8b314..0000000
--- a/build_redis-6/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-6
diff --git a/redis-server/Dockerfile b/redis-server/Dockerfile
new file mode 100644
index 0000000..ab53475
--- /dev/null
+++ b/redis-server/Dockerfile
@@ -0,0 +1,2 @@
+ARG REDIS_VERSION=6
+FROM redis:$REDIS_VERSION
-- 
GitLab