Fix Dockerfile
This commit is contained in:
parent
cb6d0705e5
commit
fa0749ae81
12
Dockerfile
12
Dockerfile
@ -1,14 +1,14 @@
|
||||
FROM alpine:3.19
|
||||
|
||||
# התקנת כלים שאתה צריך
|
||||
RUN apk add --no-cache bash git yq curl
|
||||
|
||||
# workaround: הורדה ל־/tmp ואז העברה
|
||||
RUN mkdir -p /kaniko && \
|
||||
curl -sSL https://github.com/GoogleContainerTools/kaniko/releases/download/v1.21.0/executor -o /tmp/executor && \
|
||||
mv /tmp/executor /kaniko/executor && \
|
||||
chmod +x /kaniko/executor
|
||||
# הורדת Kaniko למיקום יציב
|
||||
RUN curl -sSL -o /usr/local/bin/kaniko \
|
||||
https://github.com/GoogleContainerTools/kaniko/releases/download/v1.21.0/executor && \
|
||||
chmod +x /usr/local/bin/kaniko
|
||||
|
||||
ENV PATH="/kaniko:$PATH"
|
||||
ENV PATH="/usr/local/bin:$PATH"
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
@ -6,7 +6,8 @@ echo "🚀 Starting wp-kaniko-sync"
|
||||
TAG="${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}"
|
||||
echo "🧩 Using tag: $TAG"
|
||||
|
||||
/kaniko/executor \
|
||||
echo "🔨 Building Docker image for ${PLUGIN_CONTEXT}"
|
||||
kaniko \
|
||||
--dockerfile="${PLUGIN_DOCKERFILE}" \
|
||||
--context="${PLUGIN_CONTEXT}" \
|
||||
--destination="${PLUGIN_REGISTRY}/${PLUGIN_REPO}:${TAG}" \
|
||||
@ -18,14 +19,20 @@ echo "🧩 Using tag: $TAG"
|
||||
echo "✅ Image pushed successfully"
|
||||
|
||||
if [[ -n "$PLUGIN_GIT_REPO" ]]; then
|
||||
echo "📡 Cloning GitOps repo"
|
||||
|
||||
git config --global user.name "woodpecker-bot"
|
||||
git config --global user.email "ci@dvirlabs.com"
|
||||
|
||||
git clone "https://${PLUGIN_GIT_USERNAME}:${PLUGIN_GIT_TOKEN}@${PLUGIN_GIT_REPO}"
|
||||
cd $(basename "$PLUGIN_GIT_REPO" .git)
|
||||
|
||||
echo "📝 Updating tag in ${PLUGIN_VALUES_FILE}"
|
||||
yq -i ".$PLUGIN_VALUES_PATH = \"$TAG\"" "$PLUGIN_VALUES_FILE"
|
||||
|
||||
git add "$PLUGIN_VALUES_FILE"
|
||||
git commit -m "${PLUGIN_NAME}: update tag to $TAG" || echo "⚠️ No changes"
|
||||
git push origin HEAD
|
||||
fi
|
||||
|
||||
echo "🎉 Done"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user