From e9709897610d42e583dfaae555f612cc7cc44cb0 Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sat, 30 Aug 2025 19:19:34 +0530 Subject: [PATCH 01/17] Delete azure-pipelines.yml --- azure-pipelines.yml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 23402e427df..00000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,3 +0,0 @@ -pool: MyAgentPool -steps: -- bash: echo hello world \ No newline at end of file From f1b6be6cc91b82c2b5760f44c5d906de5dc1cfcc Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sat, 30 Aug 2025 19:22:02 +0530 Subject: [PATCH 02/17] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000000..51017777841 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,17 @@ +# ASP.NET Core +# Build and test ASP.NET Core projects targeting .NET Core. +# Add steps that run tests, create a NuGet package, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core + +trigger: +- main + +pool: + vmImage: Default + +variables: + buildConfiguration: 'Release' + +steps: +- script: dotnet build --configuration $(buildConfiguration) + displayName: 'dotnet build $(buildConfiguration)' From b61dfa86cddf561ac460e4331febbcb20fa03d8b Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sat, 30 Aug 2025 19:36:41 +0530 Subject: [PATCH 03/17] Update azure-pipelines.yml for Azure Pipelines updating the codespaces name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 51017777841..f049dc6c492 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - main pool: - vmImage: Default + vmImage: potential guacamole variables: buildConfiguration: 'Release' From bc1289235bca4ff3a894cffc47eea80468b94d3b Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sat, 30 Aug 2025 19:41:19 +0530 Subject: [PATCH 04/17] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f049dc6c492..4786113a48b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - main pool: - vmImage: potential guacamole + vmImage: ubuntu-latest variables: buildConfiguration: 'Release' From dc0de4892b8a0342d5c8515c76a8ac60982ecc0a Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sat, 30 Aug 2025 19:53:50 +0530 Subject: [PATCH 05/17] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4786113a48b..cc84151d693 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - main pool: - vmImage: ubuntu-latest + name: Default variables: buildConfiguration: 'Release' From 0fc5687a4f58b4d027a1d3caff39d95bebeb2907 Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sat, 30 Aug 2025 15:03:09 +0000 Subject: [PATCH 06/17] fixed build issues --- .devcontainer/devcontainer.json | 63 +++++++++++++-------------------- .devcontainer/start.sh | 57 +++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 39 deletions(-) create mode 100644 .devcontainer/start.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f19e448de0a..90c2d26d733 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,43 +1,28 @@ { - "name": "AzurePipelines", - "dockerFile": "Dockerfile", + "name": "AzurePipelines", + "image": "mcr.microsoft.com/devcontainers/dotnet:6.0", - // Configure tool-specific properties. - "customizations": { - // Configure properties specific to VS Code. - "vscode": { - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "ms-vscode.azurecli", - "ms-vscode.powershell", - "hashicorp.terraform", - "esbenp.prettier-vscode", - "tfsec.tfsec" - ] - } - }, + "features": { + "ghcr.io/devcontainers/features/azure-cli:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/devcontainers/features/powershell:1": {}, + "ghcr.io/devcontainers/features/terraform:1": {} + }, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postStartCommand' to run commands each time the container is successfully started.. - "postStartCommand": "/home/vscode/azure-pipelines/start.sh", - - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - // Amend Azure Pipelines agent version and arch type with 'ARCH' and 'AGENT_VERSION'. https://github.com/microsoft/azure-pipelines-agent/releases. - "build": { - "args": { - "UPGRADE_PACKAGES": "true", - "ARCH": "x64", - "AGENT_VERSION": "2.206.1" - } - }, - "features": { - "terraform": "latest", - "azure-cli": "latest", - "git-lfs": "latest", - "github-cli": "latest", - "powershell": "latest" + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.azurecli", + "ms-vscode.powershell", + "hashicorp.terraform", + "esbenp.prettier-vscode", + "tfsec.tfsec", + "ms-dotnettools.csharp" + ] } -} \ No newline at end of file + }, + + "postStartCommand": "bash .devcontainer/start.sh", + "remoteUser": "vscode" +} diff --git a/.devcontainer/start.sh b/.devcontainer/start.sh new file mode 100644 index 00000000000..d262a8c58f6 --- /dev/null +++ b/.devcontainer/start.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +set -euo pipefail + +# ---------- Config via Codespaces Secrets ---------- +# Required: set these in your repo/Org Codespaces secrets +# ADO_ORG -> org name (e.g. contoso) OR full URL (https://dev.azure.com/contoso) +# ADO_PAT -> PAT with at least "Agent Pools (Read & manage)" +: "${ADO_ORG:?Set Codespaces secret ADO_ORG to your org name or full URL}" +: "${ADO_PAT:?Set Codespaces secret ADO_PAT to your Azure DevOps PAT}" + +# Optional overrides (you can also set these as secrets/envs) +: "${AZP_POOL:=Default}" # Azure DevOps agent pool +: "${AZP_AGENT_VERSION:=2.206.1}" # Agent version +: "${AZP_AGENT_NAME:=$(hostname)}" # Agent name + +# ---------- Derive org URL ---------- +if [[ "$ADO_ORG" =~ ^https?:// ]]; then + AZP_URL="$ADO_ORG" +else + AZP_URL="https://dev.azure.com/${ADO_ORG}" +fi + +# ---------- Prepare workspace folder ---------- +AGENT_ROOT="/home/vscode/azp" +mkdir -p "$AGENT_ROOT" +chown -R vscode:vscode "$AGENT_ROOT" +cd "$AGENT_ROOT" + +# ---------- Download agent from GitHub releases (reliable) ---------- +AGENT_TGZ="vsts-agent-linux-x64-${AZP_AGENT_VERSION}.tar.gz" +AGENT_URL="https://github.com/microsoft/azure-pipelines-agent/releases/download/v${AZP_AGENT_VERSION}/${AGENT_TGZ}" + +if [[ ! -x "./bin/Agent.Listener" ]]; then + echo "Downloading Azure Pipelines agent ${AZP_AGENT_VERSION}..." + curl -fsSL -o "${AGENT_TGZ}" "${AGENT_URL}" + tar -xzf "${AGENT_TGZ}" + rm -f "${AGENT_TGZ}" + ./bin/installdependencies.sh +fi + +# ---------- Configure agent (ephemeral; auto-removes after job) ---------- +# If reconfiguring, clean stale files to avoid conflicts +if [[ -f ".agent" ]]; then + ./config.sh remove --unattended --auth pat --token "$ADO_PAT" || true +fi + +./config.sh --unattended \ + --url "$AZP_URL" \ + --auth pat --token "$ADO_PAT" \ + --pool "$AZP_POOL" \ + --agent "$AZP_AGENT_NAME" \ + --acceptTeeEula \ + --ephemeral \ + --replace + +# ---------- Run a single job, then exit ---------- +exec ./run.sh --once From 4f5b9bb874194c613dfeec7a63d60c61afa9c808 Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sat, 30 Aug 2025 20:49:52 +0530 Subject: [PATCH 07/17] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cc84151d693..9c2222e28b9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - main pool: - name: Default + vmImage: 'ubuntu-latest' variables: buildConfiguration: 'Release' From 98e58317d487897a394eca70c6474475ad2ce4fa Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sat, 30 Aug 2025 20:52:00 +0530 Subject: [PATCH 08/17] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9c2222e28b9..cc84151d693 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - main pool: - vmImage: 'ubuntu-latest' + name: Default variables: buildConfiguration: 'Release' From 3b608375fdbc6a012a4bdd5df0fa36d48dd171ef Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sat, 30 Aug 2025 21:22:25 +0530 Subject: [PATCH 09/17] fixing .net version issue --- azure-pipelines.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cc84151d693..a04e7ade0b0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,5 +13,18 @@ variables: buildConfiguration: 'Release' steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' +- task: UseDotNet@2 + displayName: 'Install .NET 8 SDK' + inputs: + packageType: 'sdk' + version: '8.x' # or pin e.g. 8.0.404 + includePreview: false + +- script: dotnet --info + displayName: 'Dotnet info (sanity check)' + +- script: dotnet restore + displayName: 'dotnet restore' + +- script: dotnet build --configuration Release --no-restore + displayName: 'dotnet build Release' From 4cfee65d5ce2ec63debbbcc3455d90091cf6affa Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sun, 31 Aug 2025 04:38:30 +0000 Subject: [PATCH 10/17] adding start.sh --- .devcontainer/start.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .devcontainer/start.sh diff --git a/.devcontainer/start.sh b/.devcontainer/start.sh old mode 100644 new mode 100755 From d93af3232deb533a83fc27392d4b5bb4e127ddcc Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sun, 31 Aug 2025 04:47:11 +0000 Subject: [PATCH 11/17] fixes --- azure-pipelines.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4786113a48b..dd11949525b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,11 +7,24 @@ trigger: - main pool: - vmImage: ubuntu-latest + name: Default variables: buildConfiguration: 'Release' steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' +- task: UseDotNet@2 + displayName: 'Install .NET 8 SDK' + inputs: + packageType: 'sdk' + version: '8.x' # or pin e.g. 8.0.404 + includePreview: false + +- script: dotnet --info + displayName: 'Dotnet info (sanity check)' + +- script: dotnet restore + displayName: 'dotnet restore' + +- script: dotnet build --configuration Release --no-restore + displayName: 'dotnet build Release' \ No newline at end of file From 0fbd9e0aa3d24e72c041c940c22f6799b9e352c7 Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sun, 31 Aug 2025 04:55:02 +0000 Subject: [PATCH 12/17] fixed the piepline --- azure-pipelines.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cc84151d693..7c71abdb1f6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,10 +8,24 @@ trigger: pool: name: Default + name: Default variables: buildConfiguration: 'Release' steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' +- task: UseDotNet@2 + displayName: 'Install .NET 8 SDK' + inputs: + packageType: 'sdk' + version: '8.x' # or pin e.g. 8.0.404 + includePreview: false + +- script: dotnet --info + displayName: 'Dotnet info (sanity check)' + +- script: dotnet restore + displayName: 'dotnet restore' + +- script: dotnet build --configuration Release --no-restore + displayName: 'dotnet build Release' \ No newline at end of file From 4a9f0390f63572f3756510061dc9ce82aa839ce7 Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:44:57 +0530 Subject: [PATCH 13/17] Update azure-pipelines.yml fixing yaml issue in main --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7c71abdb1f6..a04e7ade0b0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,7 +8,6 @@ trigger: pool: name: Default - name: Default variables: buildConfiguration: 'Release' @@ -28,4 +27,4 @@ steps: displayName: 'dotnet restore' - script: dotnet build --configuration Release --no-restore - displayName: 'dotnet build Release' \ No newline at end of file + displayName: 'dotnet build Release' From 8b5c5133c8559bccb5cfefc599e1134db8a8d700 Mon Sep 17 00:00:00 2001 From: Praveen Date: Sun, 31 Aug 2025 19:03:33 +0530 Subject: [PATCH 14/17] changing to private build agent --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a04e7ade0b0..9e91166f7ee 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - main pool: - name: Default + name: 'MyAgentPool' variables: buildConfiguration: 'Release' From 60e7c9ebccfa69c3ea715bcddd335085e2173154 Mon Sep 17 00:00:00 2001 From: Praveen Date: Sun, 31 Aug 2025 19:08:06 +0530 Subject: [PATCH 15/17] trigger for all --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9e91166f7ee..d8029768590 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ # https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core trigger: -- main +- '*' pool: name: 'MyAgentPool' From dd1409e6575a7e8d496c16859d1170dc66df64ad Mon Sep 17 00:00:00 2001 From: Praveen Date: Sun, 31 Aug 2025 19:24:15 +0530 Subject: [PATCH 16/17] changing text on home page --- Tailspin.SpaceGame.Web/Views/Home/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml b/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml index f7c4c886074..16197a5d169 100644 --- a/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml +++ b/Tailspin.SpaceGame.Web/Views/Home/Index.cshtml @@ -5,7 +5,7 @@
Space Game -

An example site for learning

+

Welcome to the oficial Space Game site!

From 7aefac9aee47fec0e4d9f28a122f400da41d131f Mon Sep 17 00:00:00 2001 From: Praveen Kandallu <58544577+kg-praveen@users.noreply.github.com> Date: Sun, 31 Aug 2025 19:39:07 +0530 Subject: [PATCH 17/17] added build badges --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ece99adf323..af94a7ee578 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +[![Build Status](https://dev.azure.com/kgpraveen/Space%20Game%20-%20web%20-%20Pipeline/_apis/build/status%2Fkg-praveen.mslearn-tailspin-spacegame-web?branchName=main)](https://dev.azure.com/kgpraveen/Space%20Game%20-%20web%20-%20Pipeline/_build/latest?definitionId=2&branchName=main) # Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a @@ -63,3 +63,4 @@ Privacy information can be found at https://privacy.microsoft.com/en-us/ Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise. +