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

WIP: Add gitpod configuration #1032

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
21 changes: 21 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
image:
file: Dockerfile

tasks:
- name: Build the documentation and serve the html
before: daps -d DC-opensuse-all html
command: python3.9 -m http.server -d build
ports:
- port: 8000
onOpen: open-browser

vscode:
extensions:
- asciidoctor.asciidoctor-vscode
- mrorz.language-gettext
- redhat.vscode-xml
- EditorConfig.EditorConfig
- stkb.Rewrap
- viktorzetterstrom.non-breaking-space-highlighter
- xshrim.txt-syntax
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM registry.opensuse.org/documentation/containers/containers/opensuse-daps-toolchain:latest

RUN zypper --gpg-auto-import-keys -n ref && zypper -n in sudo system-group-wheel itstool python39

### Gitpod user ###
# '-l': see https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#user
RUN groupadd -g 33333 gitpod && \
useradd -l -u 33333 -g 33333 -G wheel -md /home/gitpod -s /bin/bash -p gitpod gitpod && \
# passwordless sudo for users in the 'wheel' group
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/00-wheel-group-nopasswd

ENV HOME=/home/gitpod
WORKDIR $HOME
# custom Bash prompt
RUN { echo && echo ". /etc/bash_completion.d/git-prompt.sh" && echo "PS1='\[\033[01;32m\]\u\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$(__git_ps1 \" (%s)\") $ '" ; } >> .bashrc

### Gitpod user (2) ###
USER gitpod
# use sudo so that user does not get sudo usage info on (the first) login
RUN sudo echo "Running 'sudo' for Gitpod: success" && \
# create .bashrc.d folder and source it in the bashrc
mkdir -p /home/gitpod/.bashrc.d && \
(echo; echo "for i in \$(ls -A \$HOME/.bashrc.d/); do source \$HOME/.bashrc.d/\$i; done"; echo) >> /home/gitpod/.bashrc