Skip to content

Commit

Permalink
Updating postCreateCommand to reinstall the latest edge
Browse files Browse the repository at this point in the history
  • Loading branch information
ytimocin committed Aug 11, 2022
1 parent 88a3e80 commit 151536f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"overrideCommand": false,

// Initialize a Kubernetes cluster, install Radius, and expose the ingress controller to the user on port 8081.
"postCreateCommand": "k3d cluster delete && k3d cluster create -p '8081:80@loadbalancer' --k3s-arg '--disable=traefik@server:0' --volume '/etc/resolv.conf:/etc/resolv.conf@server:0' && rad env init kubernetes --public-endpoint-override 'http://localhost:8081'",
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh",
"forwardPorts": [
"8081:8081"
],
Expand Down
17 changes: 17 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

echo "Starting Post Create Command"

k3d cluster delete

k3d cluster create -p '8081:80@loadbalancer' --k3s-arg '--disable=traefik@server:0' --volume '/etc/resolv.conf:/etc/resolv.conf@server:0'

RAD_VERSION=$(rad version | awk 'NR==2{print $1}')

if [ "$RAD_VERSION" = "edge" ]; then
wget -q "https://radiuspublic.blob.core.windows.net/tools/rad/install.sh" -O - | /bin/bash -s edge
fi

rad env init kubernetes --public-endpoint-override 'http://localhost:8081'

echo "Ending Post Create Command"
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
push:
branches:
- edge
- v*.*
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- edge
- v*.*

env:
VERSION: ${{ github.event.pull_request.number || 'edge' }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/codespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ name: Build codespace image
on:
push:
branches:
- v0.11
- edge
- v*.*
paths:
- '.devcontainer/**'
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- v0.11
- edge
- v*.*
paths:
- '.devcontainer/**'

env:
VERSION: ${{ github.event.pull_request.number || '0.11' }}
VERSION: ${{ github.event.pull_request.number || 'edge' }}
# Use radiusdev.azurecr.io for PR build. Otherwise, use radius.azurecr.io.
DOCKER_REGISTRY: ${{ github.event.pull_request.number && 'radiusdev.azurecr.io' || 'radius.azurecr.io' }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on:
workflow_dispatch:
push:
branches:
- v0.11
- v*.*
paths:
- 'quickstarts/**'
- 'reference-apps/**'
- '.github/workflows/**'
pull_request:
types: [opened, synchronize, reopened]
branches:
- v0.11
- v*.*
paths:
- 'quickstarts/**'
- 'reference-apps/**'
Expand Down

0 comments on commit 151536f

Please sign in to comment.