File tree Expand file tree Collapse file tree 3 files changed +78
-0
lines changed
Expand file tree Collapse file tree 3 files changed +78
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Dev Container Feature
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch :
8+
9+ jobs :
10+ publish :
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+ packages : write
15+
16+ steps :
17+ - name : Checkout
18+ uses : actions/checkout@v4
19+
20+ - name : Log in to GitHub Container Registry
21+ uses : docker/login-action@v3
22+ with :
23+ registry : ghcr.io
24+ username : ${{ github.actor }}
25+ password : ${{ secrets.GITHUB_TOKEN }}
26+
27+ - name : Publish Features
28+ uses : devcontainers/action@v1
29+ with :
30+ publish-features : true
31+ base-path-to-features : ./src
Original file line number Diff line number Diff line change 1+ {
2+ "id" : " my-team-setup" ,
3+ "version" : " 1.0.0" ,
4+ "name" : " My Team Setup" ,
5+ "description" : " Installs Python3 with common packages and adds 'Hello World!' to the terminal prompt" ,
6+ "options" : {
7+ "packages" : {
8+ "type" : " string" ,
9+ "default" : " requests numpy pandas" ,
10+ "description" : " Space-separated list of Python packages to install"
11+ }
12+ },
13+ "installsAfter" : [
14+ " ghcr.io/devcontainers/features/common-utils"
15+ ]
16+ }
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ PACKAGES=" ${PACKAGES:- requests numpy pandas} "
5+
6+ echo " Installing Python3..."
7+ apt-get update
8+ apt-get install -y python3 python3-pip python3-venv
9+
10+ echo " Installing Python packages: $PACKAGES "
11+ pip3 install --break-system-packages $PACKAGES
12+
13+ echo " Configuring terminal prompt with 'Hello World!'..."
14+
15+ # Add prompt customization to /etc/bash.bashrc for all users
16+ cat >> /etc/bash.bashrc << 'EOF '
17+
18+ # Added by my-team-setup devcontainer feature
19+ export PS1="Hello World! \$PS1"
20+ EOF
21+
22+ # Also add to /etc/zsh/zshrc if zsh is available
23+ if [ -d /etc/zsh ]; then
24+ cat >> /etc/zsh/zshrc << 'EOF '
25+
26+ # Added by my-team-setup devcontainer feature
27+ export PS1="Hello World! $PS1"
28+ EOF
29+ fi
30+
31+ echo " my-team-setup feature installed successfully!"
You can’t perform that action at this time.
0 commit comments