Skip to content

Commit

Permalink
Working on building sample images
Browse files Browse the repository at this point in the history
  • Loading branch information
willdavsmith committed Dec 12, 2023
1 parent 2ca2b42 commit cd54f4d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
app: demo
env: default
path: ./samples/demo/app.bicep
args: --application demo
args: --application demo --image localhost:51351/samples/demo
uiTestFile: tests/demo/demo.app.spec.ts
port: 3000
container: demo
Expand All @@ -49,13 +49,19 @@ jobs:
app: dapr
env: default
path: ./samples/dapr/dapr.bicep
args: --frontendImage localhost:51351/samples/dapr-frontend --backendImage localhost:51351/samples/dapr-backend
enableDapr: true
images: samples/dapr-frontend,samples/dapr-backend
directories: samples/dapr/ui/,samples/dapr/nodeapp/
- name: volumes
runOnPullRequest: true
app: myapp
env: default
path: ./samples/volumes/app.bicep
args: --image localhost:51351/samples/volumes
enableDapr: false
images: samples/volumes
directories: samples/volumes/
- name: eshop-containers
runOnPullRequest: true
app: eshop
Expand Down Expand Up @@ -171,13 +177,13 @@ jobs:
timeout-minutes: 60
continue-on-error: false
- name: Download k3d
if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.credential != 'aws'
if: steps.gen-id.outputs.RUN_TEST == 'true'
run: wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
- name: Create k3d cluster
if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.credential != 'aws'
if: steps.gen-id.outputs.RUN_TEST == 'true'
run: k3d cluster create --agents 2 -p "80:80@loadbalancer" --k3s-arg "--disable=traefik@server:0" --registry-create reciperegistry:51351
- name: Build images
if: steps.gen-id.outputs.RUN_TEST == 'true'
if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.images != ''
run: |
images=$(echo ${{ matrix.images }} | sed "s/,/ /g")
directories=$(echo ${{ matrix.directories }} | sed "s/,/ /g")
Expand Down
6 changes: 4 additions & 2 deletions samples/aws-sqs/sqs.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ param aws_access_key_id string
param aws_secret_access_key string
param aws_region string

param image string = 'ghcr.io/radius-project/samples/aws-sqs-sample:latest'

var aws_credential = {
AWS_ACCESS_KEY_ID: aws_access_key_id
AWS_SECRET_ACCESS_KEY: aws_secret_access_key
Expand Down Expand Up @@ -44,7 +46,7 @@ resource producer 'Applications.Core/containers@2023-10-01-preview' = {
},
aws_credential
)
image: 'ghcr.io/radius-project/samples/aws-sqs-sample:latest'
image: image
}
}
}
Expand All @@ -61,7 +63,7 @@ resource consumer 'Applications.Core/containers@2023-10-01-preview' = {
},
aws_credential
)
image: 'ghcr.io/radius-project/samples/aws-sqs-sample:latest'
image: image
}
}
}
4 changes: 3 additions & 1 deletion samples/aws/awss3.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ param aws_secret_access_key string

param aws_region string

param image string = 'ghcr.io/radius-project/samples/aws:latest'

resource s3 'AWS.S3/Bucket@default' = {
alias: bucket
properties: {
Expand All @@ -39,7 +41,7 @@ resource frontend 'Applications.Core/containers@2023-10-01-preview' = {
AWS_SECRET_ACCESS_KEY: aws_secret_access_key
AWS_DEFAULT_REGION: aws_region
}
image: 'ghcr.io/radius-project/samples/aws:latest'
image: image
}
}
}
7 changes: 5 additions & 2 deletions samples/dapr/dapr.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ param environment string
@description('Specifies Kubernetes namespace for redis.')
param namespace string = 'default'

param frontendImage string = 'ghcr.io/radius-project/samples/dapr-frontend:latest'
param backendImage string = 'ghcr.io/radius-project/samples/dapr-backend:latest'

resource app 'Applications.Core/applications@2023-10-01-preview' = {
name: 'dapr'
properties: {
Expand All @@ -18,7 +21,7 @@ resource backend 'Applications.Core/containers@2023-10-01-preview' = {
properties: {
application: app.id
container: {
image: 'ghcr.io/radius-project/samples/dapr-backend:latest'
image: backendImage
ports: {
web: {
containerPort: 3000
Expand All @@ -45,7 +48,7 @@ resource frontend 'Applications.Core/containers@2023-10-01-preview' = {
properties: {
application: app.id
container: {
image: 'ghcr.io/radius-project/samples/dapr-frontend:latest'
image: frontendImage
env: {
CONNECTION_BACKEND_APPID: backend.name
ASPNETCORE_URLS: 'http://*:8080'
Expand Down
4 changes: 3 additions & 1 deletion samples/demo/app.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import radius as radius
param application string
param environment string

param image string = 'ghcr.io/radius-project/samples/demo:latest'

resource demo 'Applications.Core/containers@2023-10-01-preview' = {
name: 'demo'
properties: {
application: application
container: {
image: 'ghcr.io/radius-project/samples/demo:latest'
image: image
ports: {
web: {
containerPort: 3000
Expand Down
4 changes: 3 additions & 1 deletion samples/volumes/app.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import radius as rad

param environment string

param image string = 'ghcr.io/radius-project/samples/volumes:latest'

resource app 'Applications.Core/applications@2023-10-01-preview' = {
name: 'myapp'
properties: {
Expand All @@ -14,7 +16,7 @@ resource container 'Applications.Core/containers@2023-10-01-preview' = {
properties: {
application: app.id
container: {
image: 'ghcr.io/radius-project/samples/volumes:latest'
image: image
volumes: {
temp: {
kind: 'ephemeral'
Expand Down

0 comments on commit cd54f4d

Please sign in to comment.