Commit d35cefd7 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Guarda versión en fichero en lugar de entorno

Evita la sobreescritura en tiempo de ejecución del identificador de la
versión usada de la herramienta.
parent 0e6c60c0
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -3,11 +3,7 @@ FROM docker:${DOCKER_VERSION}

LABEL maintainer="info@redmic.es"

ARG VERSION \
	OPENSSH_VERSION

LABEL version=${VERSION}
ENV VERSION=${VERSION}
ARG OPENSSH_VERSION

RUN apk --update --no-cache add \
	openssh-client-default="${OPENSSH_VERSION}"
@@ -22,6 +18,12 @@ RUN \
		ln -s "${filePath}" "${binPath}/${fileName%.*}"; \
	done

ARG VERSION

LABEL version=${VERSION}

RUN echo "${VERSION}" > /version

WORKDIR /deploy

ENTRYPOINT ["/bin/sh", "-c"]
+2 −1
Original line number Diff line number Diff line
@@ -32,4 +32,5 @@ SSH_PARAMS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLe
	-o "ControlPath=\"/ssh_connection_socket_%h_%p_%r\"" -o ControlMaster=auto \
	-o ControlPersist=${SSH_CONTROL_PERSIST} -o Port=${SSH_PORT}"

echo -e "${INFO_COLOR}*** Docker deploy [ ${DATA_COLOR}${VERSION}${INFO_COLOR} ] ***${NULL_COLOR}\n"
version=$(cat /version)
echo -e "${INFO_COLOR}*** Docker deploy [ ${DATA_COLOR}${version}${INFO_COLOR} ] ***${NULL_COLOR}\n"