Skip to content

Commit

Permalink
chore: Added .devcontainer for GitHub Codespaces. (#300)
Browse files Browse the repository at this point in the history
* Added .devcontainer for GitHub Codespaces.

* Changed packages that will be installed.
  • Loading branch information
dlemstra authored Aug 9, 2022
1 parent 715563d commit 9237db5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-22.04

ADD first-run-notice.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt

RUN apt-get update -y && \
apt-get install -y php php-curl php-xml inkscape composer
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"onCreateCommand": "/workspaces/github-readme-streak-stats/.devcontainer/on-create.sh",
"postCreateCommand": "/workspaces/github-readme-streak-stats/.devcontainer/post-create.sh"}
3 changes: 3 additions & 0 deletions .devcontainer/first-run-notice.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
👋 Welcome to Codespaces! You are using the pre-configured image.

Tests can be executed with: composer test
5 changes: 5 additions & 0 deletions .devcontainer/on-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e

cd /workspaces/github-readme-streak-stats
composer install
7 changes: 7 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

cd /workspaces/github-readme-streak-stats
if [ -n "$GITHUB_TOKEN" ]; then
echo "TOKEN=$GITHUB_TOKEN" > .env
fi

0 comments on commit 9237db5

Please sign in to comment.