Skip to content

Commit 8b4ff5d

Browse files
committed
Add devcontainer support
1 parent fb97372 commit 8b4ff5d

File tree

6 files changed

+81
-1
lines changed

6 files changed

+81
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/universal
3+
{
4+
"name": "zammad-org-devcontainer",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/base:debian-12",
7+
"features": {
8+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
9+
"ghcr.io/devcontainers/features/node:1": {},
10+
"ghcr.io/joshuanianji/devcontainer-features/mount-pnpm-store:1": {},
11+
"ghcr.io/devcontainers-extra/features/apt-get-packages": {
12+
"packages": "libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb" // cypress dependencies
13+
},
14+
"./features/po4a": {},
15+
},
16+
17+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
18+
// "forwardPorts": [],
19+
20+
"containerEnv": {
21+
"LC_ALL" : "C.UTF-8",
22+
"LANG": "C.UTF-8",
23+
"LANGUAGE": "C.UTF-8",
24+
"CYPRESS_BASE_URL": "http://host.docker.internal:8080"
25+
},
26+
27+
// Use 'postCreateCommand' to run commands after the container is created.
28+
"postCreateCommand": "/workspaces/${localWorkspaceFolderBasename}/.devcontainer/post_create.sh",
29+
30+
// Configure tool-specific properties.
31+
// "customizations": {},
32+
33+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
34+
// "remoteUser": "root"
35+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"id": "po4a",
3+
"version": "1.0.0",
4+
"name": "Install po4a",
5+
"description": "Installs po4a from git",
6+
"dependsOn": {
7+
"ghcr.io/devcontainers-extra/features/apt-get-packages": {
8+
"packages": "libmodule-build-perl libosp5 libpod-parser-perl libsgmls-perl libsyntax-keyword-try-perl libtext-wrapi18n-perl libunicode-linebreak-perl libxs-parse-keyword-perl libyaml-tiny-perl libterm-readkey-perl libxml2-utils opensp sgml-base xsltproc"
9+
},
10+
},
11+
"privileged": true
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env sh
2+
3+
export LC_ALL=C.UTF-8
4+
export LANG=C.UTF-8
5+
export LANGUAGE=C.UTF-8
6+
7+
# Build po4a from source to get the latest version.
8+
git clone https://github.com/mquinson/po4a.git
9+
(
10+
cd po4a
11+
perl Build.PL
12+
./Build || true # ignore errors, as the build may fail when trying to fetch an external, non-critical stylesheet
13+
./Build install
14+
)
15+
rm -rf po4a
16+
which po4a

.devcontainer/post_create.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
3+
CI=true pnpm install --frozen-lockfile
4+
CI=true pnpm screenshots:install
5+
pnpm --dir ./.screenshots exec cypress install

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "devcontainers"
10+
directory: "/"
11+
schedule:
12+
interval: weekly

.screenshots/cypress.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { defineConfig } = require("cypress");
22

33
module.exports = defineConfig({
44
e2e: {
5-
baseUrl: 'http://localhost:8080',
5+
baseUrl: process.env.CYPRESS_BASE_URL || 'http://localhost:8080',
66
env: {
77
ADMIN_LOGIN: '[email protected]',
88
ADMIN_PASS: 'lauren4711',

0 commit comments

Comments
 (0)