Skip to content

Commit

Permalink
Try with a custom "feature"
Browse files Browse the repository at this point in the history
  • Loading branch information
eikek committed Feb 4, 2025
1 parent 2688d30 commit 74ff57b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
"command": "alias k=kubectl"
},
"ghcr.io/devcontainers-contrib/features/rclone:1": {},
"./k3d": {},
"ghcr.io/devcontainers/features/nix:1": {
"flakeUrl": "https://github.com/eikek/devshell-tools"
}
"./k3d": {},
"ghcr.io/devcontainers/features/java:1": {
"version": "21",
"jdkDistro": "open"
},
"./solr": {}
},
"overrideFeatureInstallOrder": [
"ghcr.io/devcontainers-contrib/features/poetry",
Expand Down
18 changes: 18 additions & 0 deletions .devcontainer/solr/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "solr",
"id": "solr",
"version": "1.0.0",
"description": "A feature adding solr",
"options": {
"solr_version": {
"type": "string",
"description": "solr version to install",
"proposals": ["9.8.0"],
"default": "9.8.0"
}
},
"installsAfter": [
"ghcr.io/devcontainers/features/java",
"ghcr.io/devcontainers-contrib/features/bash-command"
],
}
16 changes: 16 additions & 0 deletions .devcontainer/solr/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
set -e

echo "Activation SOLR feature"

download_url="https://dlcdn.apache.org/solr/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz"

curl -sSL -o solr.tgz "$download_url"
mkdir -p /opt
tar -C /opt -xzf solr.tgz
ln -snf "/opt/solr-$SOLR_VERSION" /opt/solr
ln -snf /opt/solr/bin/solr /usr/local/bin/solr
mkdir -p /opt/solr/server/logs
chmod 777 /opt/solr/server/logs
chmod 777 /opt/solr/bin
chown -R vscode:vscode "/opt/solr-$SOLR_VERSION"

0 comments on commit 74ff57b

Please sign in to comment.