Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: CRW-4043 (Server) #419

Open
wants to merge 2 commits into
base: devspaces-3-rhel-8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN microdnf install java-11-openjdk-headless tar gzip shadow-utils findutils &&
microdnf update -y && \
microdnf -y clean all && rm -rf /var/cache/yum && echo "Installed Packages" && rpm -qa | sort -V && echo "End Of Installed Packages" && \
adduser -G root user && mkdir -p /home/user/devspaces
COPY entrypoint.sh /entrypoint.sh
COPY build/dockerfiles/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

# see fetch-artifacts-pnc.yaml
Expand Down
21 changes: 8 additions & 13 deletions devspaces-server/build/scripts/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ echo ".github/
.gitattributes
dockerfiles/
assets/branding/
build/dockerfiles/
build/scripts/sync.sh
/container.yaml
/content_sets.*
Expand Down Expand Up @@ -80,7 +81,11 @@ rsync -azrlt --checksum --exclude-from /tmp/rsync-excludes --delete ${SOURCEDIR}
rm -f /tmp/rsync-excludes

# copy entrypoint.sh
rsync -azrlt --checksum ${SOURCEDIR}/dockerfiles/che/entrypoint.sh ${TARGETDIR}
rsync -azrlt --checksum ${SOURCEDIR}/build/dockerfiles/entrypoint.sh ${TARGETDIR}/build/dockerfiles
#copy upstream Dockerfile as rhel.Dockerfile
rsync -azrlt --checksum ${SOURCEDIR}/build/dockerfiles/Dockerfile ${TARGETDIR}/build/dockerfiles/rhel.Dockerfile
#copy brew.dockerfile
rsync -azrlt --checksum ${SOURCEDIR}build/dockerfiles/brew.Dockerfile ${TARGETDIR}/build/dockerfiles

# ensure shell scripts are executable
find ${TARGETDIR}/ -name "*.sh" -exec chmod +x {} \;
Expand Down Expand Up @@ -158,17 +163,7 @@ else
fi
generateFetchArtifactsPNCYaml

# NOTE: upstream Dockerfile is in non-standard path (not build/dockerfiles/Dockerfile) because project has multiple container builds
sed ${SOURCEDIR}/dockerfiles/che/Dockerfile -r \
`# Strip registry from image references` \
-e 's|FROM registry.access.redhat.com/|FROM |' \
-e 's|FROM registry.redhat.io/|FROM |' \
-e 's@/home/user/eclipse-che@/home/user/devspaces@g' \
`# insert logic to unpack asset-*.tgz` \
-e 's@ADD eclipse-che .+@# see fetch-artifacts-pnc.yaml\nCOPY artifacts/assembly-main.tar.gz /tmp/assembly-main.tar.gz\nRUN tar xzf /tmp/assembly-main.tar.gz --strip-components=1 -C /home/user/devspaces; rm -f /tmp/assembly-main.tar.gz\n@g' \
-e 's@chmod g\\+w /home/user/cacerts@chmod 777 /home/user/cacerts@g' \
> ${TARGETDIR}/Dockerfile
cat << EOT >> ${TARGETDIR}/Dockerfile
cat << EOT >> ${TARGETDIR}/build/dockerfiles/brew.Dockerfile
ENV SUMMARY="Red Hat OpenShift Dev Spaces server container" \\
DESCRIPTION="Red Hat OpenShift Dev Spaces server container" \\
PRODNAME="devspaces" \\
Expand All @@ -188,7 +183,7 @@ LABEL summary="\$SUMMARY" \\
io.openshift.expose-services="" \\
usage=""
EOT
echo "Converted Dockerfile"
echo "Converted brew.Dockerfile"

# add ignore for the tarball in mid and downstream
echo "/assembly-main.tar.gz" >> ${TARGETDIR}/.gitignore
Expand Down