-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix devfile to enable schema builds and go ls (#79)
* Fix devfile to enable schema builds and go ls * Add the vendor folder to gitIgnore * Add the badge to open PR in Che * Unify pre-requisite docker image between local one and devfile one * Fix PR comments Signed-off-by: David Festal <[email protected]>
- Loading branch information
1 parent
e6a761a
commit af56942
Showing
7 changed files
with
106 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM python:3-alpine | ||
ARG OPERATOR_SDK_VERSION=v0.17.0 | ||
ENV GOROOT /usr/lib/go | ||
|
||
RUN apk add --no-cache --update curl bash jq go \ | ||
&& pip3 install yq \ | ||
&& pip3 install jsonpatch | ||
|
||
RUN curl -JL https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk-${OPERATOR_SDK_VERSION}-x86_64-linux-gnu -o /bin/operator-sdk && chmod a+x /bin/operator-sdk | ||
RUN mkdir -p /home/user/go && chmod -R a+w /home/user | ||
ENV HOME /home/user | ||
ENV GOPATH /home/user/go | ||
|
||
# Set permissions on /etc/passwd and /home to allow arbitrary users to write | ||
COPY --chown=0:0 entrypoint.sh / | ||
RUN mkdir -p /home/user && chgrp -R 0 /home && chmod -R g=u /etc/passwd /etc/group /home && chmod +x /entrypoint.sh \ | ||
&& chgrp -R 0 /usr/lib/go && chmod -R g=u /usr/lib/go | ||
|
||
USER 10001 | ||
WORKDIR /projects | ||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
CMD ["tail", "-f", "/dev/null"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Ensure $HOME exists when starting | ||
if [ ! -d "${HOME}" ]; then | ||
mkdir -p "${HOME}" | ||
fi | ||
|
||
# Setup $PS1 for a consistent and reasonable prompt | ||
if [ -w "${HOME}" ] && [ ! -f "${HOME}"/.bashrc ]; then | ||
echo "PS1='\s-\v \w \$ '" > "${HOME}"/.bashrc | ||
fi | ||
|
||
# Add current (arbitrary) user to /etc/passwd and /etc/group | ||
if ! whoami &> /dev/null; then | ||
if [ -w /etc/passwd ]; then | ||
echo "${USER_NAME:-user}:x:$(id -u):0:${USER_NAME:-user} user:${HOME}:/bin/bash" >> /etc/passwd | ||
echo "${USER_NAME:-user}:x:$(id -u):" >> /etc/group | ||
fi | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
# Add Che link on PRs | ||
name: che | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
add-link: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Eclipse Che Pull Request Check | ||
id: che-pr-check-gh-action | ||
uses: benoitf/che-pr-check-gh-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,3 +75,4 @@ tags | |
.vscode/* | ||
.history | ||
# End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters