Skip to content

Commit

Permalink
Merge pull request #2071 from thematters/stage
Browse files Browse the repository at this point in the history
Release: v3.25.0
  • Loading branch information
devformatters authored May 28, 2021
2 parents c4b8ba8 + 22fa787 commit 1288188
Show file tree
Hide file tree
Showing 35 changed files with 1,426 additions and 82 deletions.
45 changes: 45 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ARG USERNAME=node

# [Choice] Node.js version: 16, 14, 12
ARG VARIANT=12-buster
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

# Install tslint, typescript, commitizen. eslint is installed by javascript image
ARG NODE_MODULES="tslint-to-eslint-config typescript commitizen"
COPY library-scripts/meta.env /usr/local/etc/vscode-dev-containers
RUN su node -c "umask 0002 && npm install -g ${NODE_MODULES}" \
&& npm cache clean --force > /dev/null 2>&1

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends vim

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# Install Moby CLI and Engine
COPY library-scripts/*.sh library-scripts/*.env first-run-notice.txt /tmp/library-scripts/
RUN bash /tmp/library-scripts/sshd-debian.sh \
&& bash /tmp/library-scripts/docker-in-docker-debian.sh "true" "${USERNAME}" "true"

# Mount for docker-in-docker
VOLUME [ "/var/lib/docker" ]

# Fire Docker/Moby script if needed along with Oryx's benv
ENTRYPOINT [ "/usr/local/share/docker-init.sh", "/usr/local/share/ssh-init.sh" ]
CMD [ "sleep", "infinity" ]

# [Optional] Install debugger for development of Codespaces - Not in resulting image by default
ARG DeveloperBuild
RUN if [ -z $DeveloperBuild ]; then \
echo "not including debugger" ; \
else \
curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg ; \
fi

USER ${USERNAME}

# Move first run notice to right spot
RUN mkdir -p /usr/local/etc/vscode-dev-containers/ \
&& mv -f /tmp/library-scripts/first-run-notice.txt /usr/local/etc/vscode-dev-containers/
69 changes: 69 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// For format details, see https://aka.ms/devcontainer.json.
// This is a fork from https://github.com/microsoft/vscode-dev-containers/blob/v0.177.0/containers/codespaces-linux/.devcontainer/

{
"name": "Matters Codespaces",

"build": {
"dockerfile": "Dockerfile"
},

"runArgs": ["--init", "--privileged"],
"mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"],
"overrideCommand": false,

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",

// Use this environment variable if you need to bind mount your local source code into a new container.
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-azuretools.vscode-docker",
"GitHub.vscode-pull-request-github",

// linting & formatting
"ms-vscode.vscode-typescript-tslint-plugin",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint",

// highlighting
"blanu.vscode-styled-jsx",
"tobermory.es6-string-html",
"apollographql.vscode-apollo",
"editorconfig.editorconfig",

// styling
"coenraads.bracket-pair-colorizer",
"ricard.postcss",
"wayou.vscode-todo-highlight",
"mikestead.dotenv",
"naumovs.color-highlight",
"oderwat.indent-rainbow",

// themes
"github.github-vscode-theme",
"linusu.auto-dark-mode",
"qinjia.seti-icons",

// info
"wix.vscode-import-cost"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [3000, 4000, 4569, 6379],

// Use 'postCreateCommand' to run commands after the container is created.
// "oryx build" will automatically install your dependencies and attempt to build your project
"postCreateCommand": "oryx build -p virtualenv_name=.venv --log-file /tmp/oryx-build.log || echo 'Could not auto-build. Skipping.'",

"containerEnv": {
"EDITOR": "vim",
"VISUAL": "vim"
}
}
15 changes: 15 additions & 0 deletions .devcontainer/first-run-notice.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
__ __ _ _
| \/ | __ _| |_| |_ ___ _ __ ___
| |\/| |/ _` | __| __/ _ \ '__/ __|
| | | | (_| | |_| || __/ | \__ \
|_| |_|\__,_|\__|\__\___|_| |___/


👋 Welcome to the dev environment for building the Matters community and tools!

👀 Read the README.md before your start building.

🔧 More developer resources: https://github.com/thematters/developer-resource

🌍 Visit Matters Community: https://matters.news

Loading

0 comments on commit 1288188

Please sign in to comment.