From 89c4d0bd275287492915d000d4b66d7a0528ae90 Mon Sep 17 00:00:00 2001 From: Gareth Healy Date: Mon, 6 Mar 2023 23:40:16 +0000 Subject: [PATCH] added fail as this action has been deprecated for a while (#76) --- s2i/Dockerfile | 7 +------ s2i/entrypoint.sh | 41 +++-------------------------------------- 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/s2i/Dockerfile b/s2i/Dockerfile index 2a25522..f37b532 100644 --- a/s2i/Dockerfile +++ b/s2i/Dockerfile @@ -1,4 +1,4 @@ -FROM docker:19.03.2 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.1 LABEL version="1.0.0" LABEL repository="http://github.com/redhat-cop/github-actions" @@ -9,10 +9,5 @@ LABEL "com.github.actions.description"="Runs source2image build" LABEL "com.github.actions.icon"="package" LABEL "com.github.actions.color"="purple" -RUN apk --no-cache add bash curl tar && \ - cd /tmp && \ - curl -L https://github.com/openshift/source-to-image/releases/download/v1.2.0/source-to-image-v1.2.0-2a579ecd-linux-amd64.tar.gz | tar xvz && \ - cp /tmp/s2i /usr/bin/ - ADD entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/s2i/entrypoint.sh b/s2i/entrypoint.sh index fe0a7c9..c307893 100755 --- a/s2i/entrypoint.sh +++ b/s2i/entrypoint.sh @@ -1,39 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash -set -e - -# Set named vars -SRC=$1 -BASE=$2 -OUTPUT_IMAGE=$3 -IMAGE_PULL_REGISTRY=$4 -IMAGE_PULL_USERNAME=$5 -IMAGE_PULL_PASSWORD=$6 -IMAGE_PUSH_REGISTRY=$7 -IMAGE_PUSH_USERNAME=$8 -IMAGE_PUSH_PASSWORD=$9 -IMAGE_TAGS=${10} - -if [ -z $IMAGE_PULL_USERNAME ]; then - echo "Skipping login for image pull - username not set." -else - echo "Credentials for builder image registry detected - logging in." - echo "${IMAGE_PULL_PASSWORD}" | docker login "${IMAGE_PULL_REGISTRY}" --username "${IMAGE_PULL_USERNAME}" --password-stdin -fi -# We will always need to login to the registry we intend to push to -echo "${IMAGE_PUSH_PASSWORD}" | docker login "${IMAGE_PUSH_REGISTRY}" --username "${IMAGE_PUSH_USERNAME}" --password-stdin -# Grab builder image -docker pull "${BASE}" -# Build -s2i build "${SRC}" "${BASE}" "${OUTPUT_IMAGE}" -# Push to output registry -docker push "${OUTPUT_IMAGE}" -# Add additional tags -echo "Adding additional tags" -for tag in $(echo $IMAGE_TAGS|sed -e 's/ //g' -e 's/,/ /g'); do - TAG=$(echo $OUTPUT_IMAGE|cut -d: -f1):${tag} - echo "Tagging ${OUTPUT_IMAGE} as ${TAG}" - docker tag $OUTPUT_IMAGE $TAG - echo "Pushing ${TAG}" - docker push $TAG -done +echo "This action is deprecated, please migrate to: https://github.com/marketplace/actions/source-to-image-build" +exit 1 \ No newline at end of file