Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Commit 4aa000f

Browse files
committed
Updating the template per PR feedback - Update the names of the place-holders and their description. Also update the template to be in sync with the changes in the actual workflow for the sample - bikes.yml
1 parent 2a0be60 commit 4aa000f

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

.github/workflows/pullrequest.yml.template

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
# Name of the PlaceHolder - Description
2-
########################################################################################################################
3-
# <Name of the WorkFlow> - Workflow name. example: Bikes
4-
# <Path to the service> - Path to the service where the developer would like to trigger the Flow/ action on pull request - Example: samples/BikeSharingApp/Bikes.
5-
# <Path to the Dockerfile> - Path to the folder which contains the Dockerfile
6-
# <Name of the Service> - Pass this as a parameter for multiple steps below. Lower Cased Name of the Service, for example: bikes
7-
# <Path to the Charts for that service> - Pass this in as a parameter for the Helm Install PR step
8-
# This is the path to the folder where the charts are present for that service. example: samples/BikeSharingApp/Bikes/charts/bikes
9-
# <ReleaseName> - Pass this in as a parameter for the Helm Install PR step
10-
#
111
# Note: This template assumes that you use Helm. If not, replace the Helm Install PR step with your own step
122
# Note: For the secrets below please refer to the document: http://aka.ms/devspaces/pr-flow
133
#
4+
# Name of the PlaceHolder - Description
5+
########################################################################################################################
6+
# <NAME_OF_THE_WORKFLOW> - Workflow name. example: Bikes
7+
# <PATH_TO_THE_SERVICE> - The path to the service that must be modified in order for the workflow to trigger. - Example: samples/BikeSharingApp/Bikes.
8+
# <PATH_TO_THE_DOCKERFILE> - Path to the directory which contains the DockerFile for the modified service.
9+
# <NAME_OF_THE_SERVICE> - Pass this as a parameter for multiple steps below. Lower Cased Name of the Service, for example: bikes
10+
# <PATH_TO_THE_CHARTS_FOR_THAT_SERVICE> - Pass this in as a parameter for the Helm Install PR step
11+
# Path to the service's helm charts. example: samples/BikeSharingApp/Bikes/charts/bikes
12+
# <RELEASE_NAME> - Pass this in as a parameter for the Helm Install PR step
13+
# More details at Helm documentation at https://helm.sh/docs/helm/#helm-upgrade
14+
# This is [RELEASE] in the helm upgrade [RELEASE] [CHART] [flags] command
15+
# helm upgrade --install command is used for: If a release by this name doesn't already exist, run an install
1416

15-
name: PRFlow <Name of the Workflow>
17+
name: PRFlow <NAME_OF_THE_WORKFLOW>
1618

1719
on:
1820
pull_request:
1921
branches:
2022
- master
2123
paths:
22-
- <Path to the Service>/**
24+
- <PATH_TO_THE_SERVICE>/**
2325

2426
jobs:
2527
build:
@@ -36,8 +38,8 @@ jobs:
3638

3739
- name: docker build
3840
run: |
39-
docker build <Path to the Dockerfile>/ -t ${{ secrets.CONTAINER_REGISTRY }}/<Name of the Service>:$GITHUB_SHA
40-
docker push ${{ secrets.CONTAINER_REGISTRY }}/<Name of the Service>:$GITHUB_SHA
41+
docker build <PATH_TO_THE_DOCKERFILE>/ -t ${{ secrets.CONTAINER_REGISTRY }}/<NAME_OF_THE_SERVICE>:$GITHUB_SHA
42+
docker push ${{ secrets.CONTAINER_REGISTRY }}/<NAME_OF_THE_SERVICE>:$GITHUB_SHA
4143

4244
- uses: azure/k8s-actions/aks-set-context@master
4345
with:
@@ -55,20 +57,18 @@ jobs:
5557

5658
- uses: azure/k8s-actions/k8s-create-secret@master
5759
with:
58-
namespace: ${{ GITHUB_HEAD_REF }}
60+
namespace: ${{ github.head_ref }}
5961
container-registry-url: ${{ secrets.CONTAINER_REGISTRY }}
6062
container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
6163
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
6264
secret-name: ${{ secrets.IMAGE_PULL_SECRET }}
6365

6466
- name: Helm Install PR
6567
run: |
66-
helm upgrade --install --namespace $GITHUB_HEAD_REF <ReleaseName>-$GITHUB_HEAD_REF <Path to the charts for the Service> \
67-
--set image.repository=${{ secrets.CONTAINER_REGISTRY }}/<Name of the Service> \
68+
helm upgrade --install --namespace $GITHUB_HEAD_REF <RELEASE_NAME>-$GITHUB_HEAD_REF <PATH_TO_THE_CHARTS_FOR_THAT_SERVICE> \
69+
--set image.repository=${{ secrets.CONTAINER_REGISTRY }}/<NAME_OF_THE_SERVICE> \
6870
--set image.tag=$GITHUB_SHA \
69-
--set imagePullSecrets[0].name=${{ secrets.IMAGE_PULL_SECRET }} \
70-
--set ingress.hosts[0]=$GITHUB_HEAD_REF.s.${{ secrets.HOST }} \
71-
--set ingress.annotations.kubernetes\\.io/ingress\\.class=traefik-azds
71+
--set imagePullSecrets[0].name=${{ secrets.IMAGE_PULL_SECRET }}
7272

7373
- uses: azure/dev-spaces/actions/add-review-url@Releases/v1
7474
with:

0 commit comments

Comments
 (0)