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

🏗✨:kick off new fish shell CentOS devcontainer #28

Merged
merged 11 commits into from
Feb 2, 2024
22 changes: 0 additions & 22 deletions .devcontainer.json

This file was deleted.

File renamed without changes.
23 changes: 23 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Ethically sourced from official fish-shell/fish-shell project:
# See: https://github.com/fish-shell/fish-shell/blob/HEAD/Dockerfile

FROM centos:centos7

# Build dependency # skipcq: DOK-W1003
RUN yum update -y \
&& yum install -y epel-release \
&& yum install -y clang cmake3 gcc-c++ make ncurses-devel \
&& yum clean all

# Test dependency # skipcq: DOK-W1003
RUN yum install -y expect vim-common \
&& yum clean all

# ADD . /src
# WORKDIR /src

# Build fish
# RUN cmake3 . &&\
# make &&\
# make install

10 changes: 10 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/openinf/docker-fisher/tree/main/templates/centos7
{
"name": "CentOS",

"build": {
// Path is relative to the devcontainer.json file.
"dockerfile": "Dockerfile"
}
}
26 changes: 26 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3'

services:
app:
build:
context: .
dockerfile: Dockerfile

volumes:
# Forwards the local Docker socket to the container.
- /var/run/docker.sock:/var/run/docker-host.sock
# Update this to wherever you want VS Code to mount the folder of your project
- ../..:/workspaces:cached

# Overrides default command so things don't shut down after the process ends.
entrypoint: /usr/local/share/docker-init.sh
command: sleep infinity

# Uncomment the next four lines if you will use a ptrace-based debuggers like C++, Go, and Rust.
# cap_add:
# - SYS_PTRACE
# security_opt:
# - seccomp:unconfined

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
76 changes: 76 additions & 0 deletions .devcontainer/post-create.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/usr/bin/fish

# If there's a .ruby-version, then run `rbenv install`.
if test -e .ruby-version
rbenv install --verbose
end

echo 'set -Ux fish_user_paths ~/.rbenv/shims/ $fish_user_paths' >> ~/.config/fish/config.fish

# To squelch yellow message re: specifying how divergent branches be reconciled.
echo 'git config pull.rebase true' >> ~/.config/fish/config.fish # rebase

source ~/.config/fish/config.fish

rbenv rehash

# If there's a Gemfile, then install Bundler and run `bundle install`.
if test -e Gemfile
# Install Bundler.
gem install bundler
# Configure Bundler setting local gem install path to avoid permission errors.
bundle config set --local path vendor/bundle
# Install the dependencies specified in the Gemfile.
bundle install
# Ensure latest versions of Bundler's dependencies are installed.
bundle update --bundler
else
# If there's no Gemfile, install Jekyll.
gem install jekyll
end

# If there's a `.nvmrc`, then run `nvm install`.
if test -e .nvmrc
# Install the specified version of Node.js.
nvm install
end

# If there's a package.json, then run `pnpm install`.
if test -e package.json
corepack enable
corepack prepare pnpm@latest --activate
pnpm install
end

echo 'rbenv rehash && nvm use' >> ~/.config/fish/config.fish

source ~/.config/fish/config.fish

# this will populate your ~/.gnupg directory with empty keyring files
# it will create the ~/.gnupg directory if it does not already exist (expected)
gpg --list-keys

# If there's a .gnupg directory, then perform the following setup tasks.
if test -e ~/.gnupg/
# Configure Git to use `gpg2`.
echo 'git config --global gpg.program gpg2' >> ~/.config/fish/config.fish

echo 'set -gx GPG_TTY (tty)' >> ~/.config/fish/config.fish

# To fix the " gpg: WARNING: unsafe permissions on homedir
# '/home/path/to/user/.gnupg' " error, make sure that the .gnupg directory and
# its contents is accessibile by your user.
# chown -R (whoami) ~/.gnupg/

# Also correct the permissions and access rights on the directory.
# chmod 600 ~/.gnupg/*
# chmod 700 ~/.gnupg

echo no-autostart >> ~/.gnupg/gpg.conf

# Remove an existing Unix-domain socket file for remote port forwarding before
# creating a new one when gpgtunnel connection is made.
# rm ~/.gnupg/S.gpg-agent

printf '\n%s\n\n\t%s\n\n' 'Enable commit signing:' 'git config --global commit.gpgsign true'
end
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
6 changes: 6 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Authors ordered by first contribution.
# For any email changes, please make a mailmap request.
# See: https://git-scm.com/docs/gitmailmap

Derek Lewis <[email protected]>
Princess Irulen <[email protected]>