Skip to content

Commit 81932f2

Browse files
updated start.
1 parent ecc5ac8 commit 81932f2

File tree

5 files changed

+65
-40
lines changed

5 files changed

+65
-40
lines changed

src/devcontainers/base/src/.devcontainer/devcontainer.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
},
5858
"features": {
5959

60-
"ghcr.io/devcontainers/features/aws-cli:1": {
61-
"version": "latest"
62-
},
60+
// "ghcr.io/devcontainers/features/aws-cli:1": {
61+
// "version": "latest"
62+
// },
6363
"ghcr.io/devcontainers/features/common-utils:2": {
6464
"configureZshAsDefaultShell": true,
6565
"installOhMyZsh": true,
@@ -87,14 +87,11 @@
8787
"nvmVersion": "latest",
8888
"version": "lts"
8989
},
90-
"ghcr.io/devcontainers/features/ruby:1": {
91-
"version": "latest"
92-
},
90+
// "ghcr.io/devcontainers/features/ruby:1": {
91+
// "version": "latest"
92+
// },
9393
"ghcr.io/devcontainers/features/go:1": {
9494
"version": "latest"
95-
},
96-
"ghcr.io/devcontainer-community/devcontainer-features/asdf-vm.com:1": {
97-
"version": "latest"
9895
},
9996
"./nhsnotify": {
10097
"version": "1.0.1"
@@ -106,5 +103,13 @@
106103
"name": "NHS Notify Default Developer Container",
107104
"runArgs": [
108105
"--platform=linux/amd64"
106+
],
107+
"initializeCommand": "./scripts/init.sh",
108+
"mounts": [
109+
"source=/usr/local/share/ca-certificates,target=/home/ca-certificates,type=bind,consistency=cached",
110+
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached",
111+
"source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached",
112+
"source=${localEnv:HOME}/.gnupg,target=/home/vscode/.gnupg,type=bind,consistency=cached",
113+
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
109114
]
110115
}

src/devcontainers/base/src/.devcontainer/nhsnotify/install.sh

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,6 @@
33
cp ./postcreatecommand.sh /postcreatecommand.sh
44
cp ./poststartcommand.sh /poststartcommand.sh
55
cp ./welcome.sh /welcome.sh
6-
cp ./Makefile ~/Makefile
6+
cp ./Makefile /Makefile
77

8-
cp ~/.zshrc /.zshrc
9-
# rm -Rf /.asdf
10-
# git clone https://github.com/asdf-vm/asdf.git /.asdf;
11-
# chmod +x /.asdf/asdf.sh;
12-
# echo '. /.asdf/asdf.sh' >> /.zshrc
13-
# echo '. /.asdf/completions/asdf.bash' >> /.zshrc
14-
sed -i "/plugins=/c\plugins=(git ssh-agent sudo terraform dirhistory zsh-autosuggestions)" /.zshrc
158

16-
cat /.zshrc
17-
18-
cp /.zshrc ~/.zshrc
19-
source ~/.zshrc
20-
mkdir -p /zsh/plugins/zsh-autosuggestions
21-
git clone https://github.com/zsh-users/zsh-autosuggestions /zsh/plugins/zsh-autosuggestions
22-
23-
24-
mkdir -p /nhsengland/repository-template
25-
git clone https://github.com/nhs-england-tools/repository-template /nhsengland/repository-template
Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,57 @@
11
#!/bin/bash
2+
CURRENT_DIR=$(pwd)
3+
4+
echo 'install asdf via go'
5+
go install github.com/asdf-vm/asdf/cmd/[email protected]
6+
echo 'export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"' >> ~/.zshrc
7+
#git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
8+
#echo 'source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh' >> ~/.zshrc
9+
#sed -i "/plugins=/c\plugins=(git ssh-agent sudo terraform dirhistory zsh-autosuggestions)" ~/.zshrc
10+
sed -i "/plugins=/c\plugins=(git ssh-agent sudo terraform dirhistory)" ~/.zshrc
11+
cat ~/.zshrc
12+
213

3-
cp /.zshrc ~/.zshrc
4-
cp -r /zsh/* ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}
5-
ls -la ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}
14+
echo "installing asdf plugins"
15+
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
16+
echo 'eval "$(zoxide init zsh)"' >> ~/.zshrc
17+
echo "zoxide plugin added"
618

719
cat ~/.zshrc
8-
source ~/.zshrc
9-
echo 'asdf setup complete'
1020

21+
echo "copying defaults"
22+
echo "getting nhse repo template"
23+
echo "Cloning $REPO into $DEST"
24+
25+
REPO=https://github.com/NHSDigital/nhs-notify-repository-template.git
26+
DEST=$HOME/nhsengland/repository-template
1127

12-
echo 'copying defaults'
28+
mkdir -p $DEST
29+
echo "created destination directory $DEST"
30+
echo "Cloning repository from $REPO to $DEST"
31+
git clone $REPO $DEST
32+
echo "cloned repository $REPO to $DEST"
33+
git switch -C updating-the-default-files
1334

14-
cp /nhsengland/repository-template/scripts ./scripts -r
15-
cp /nhsengland/repository-template/Makefile ./
16-
cp /nhsengland/repository-template/.tool-versions ./
35+
\cp -rf $DEST/scripts ./scripts
36+
\cp -f $DEST/Makefile ./
37+
\cp -f $DEST/.tool-versions ./
1738

39+
git add .
40+
git commit -m "Update default files from $REPO" || echo "No changes to commit"
41+
42+
git switch -
43+
git merge updating-the-default-files -m "Merge default files from $REPO"
44+
echo "$REPO template complete"
45+
46+
echo "running make config"
47+
source ~/.zshrc
48+
echo "sourced .zshrc"
1849
make config
19-
echo 'make config complete'
50+
echo "make config complete"
2051

21-
# jekyll --version && cd docs && bundle install
22-
# echo 'jekyll setup complete'
52+
cd $CURRENT_DIR
2353

24-
#/welcome.sh
54+
echo "sorting certs"
55+
sudo cp -nr /home/ca-certificates/. /usr/local/share/ca-certificates
56+
sudo update-ca-certificates
57+
echo "sorted certs"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/bin/bash
22

3+
omz reload
34
/welcome.sh
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mkdir -p $HOME/.aws || true
2+
mkdir -p $HOME/.gnupg || true
3+
mkdir -p $HOME/.ssh || true

0 commit comments

Comments
 (0)