Skip to content

Commit

Permalink
added fail as this action has been deprecated for a while (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
garethahealy authored Mar 6, 2023
1 parent 7d13ac9 commit 89c4d0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 44 deletions.
7 changes: 1 addition & 6 deletions s2i/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"]
41 changes: 3 additions & 38 deletions s2i/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 89c4d0b

Please sign in to comment.