diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml new file mode 100644 index 000000000..a82213956 --- /dev/null +++ b/azure-pipelines-1.yml @@ -0,0 +1,31 @@ +trigger: +- main + +pool: + vmImage: 'ubuntu-latest' + +stages: +- stage: Build + displayName: 'Build Stage' + jobs: + - job: BuildJob + displayName: 'Build Job' + steps: + - script: | + echo "Restoring project dependencies..." + displayName: 'Restore dependencies' + - script: | + echo "Running unit tests..." + displayName: 'Run unit tests' + +- stage: Test + displayName: 'Test Stage' + dependsOn: Build + isSkippable: false + jobs: + - job: TestJob + displayName: 'Test Job' + steps: + - script: | + echo "Running unit tests..." + displayName: 'Run unit tests' \ No newline at end of file diff --git a/azure-pipelines-2.yml b/azure-pipelines-2.yml new file mode 100644 index 000000000..e33fdb533 --- /dev/null +++ b/azure-pipelines-2.yml @@ -0,0 +1,107 @@ +trigger: +- main + +pool: + vmImage: 'ubuntu-latest' + +stages: +- stage: Build + displayName: 'Build Stage' + jobs: + - job: BuildJob + displayName: 'Build Job' + steps: + - script: | + echo "Restoring project dependencies..." + displayName: 'Restore dependencies' + - script: | + echo "Running unit tests..." + displayName: 'Run unit tests' + +- stage: Test + displayName: 'Test Stage' + dependsOn: Build + isSkippable: false + jobs: + - job: TestJob + displayName: 'Test Job' + steps: + - script: | + echo "Running unit tests..." + displayName: 'Run unit tests' + + +- stage: DeployToStaging + displayName: 'Deploy to Staging' + dependsOn: Test + jobs: + - job: DeployStagingJob + displayName: 'Deploy to Staging Job' + pool: + vmImage: 'ubuntu-latest' + steps: + - script: | + echo "Build staging job..." + displayName: 'Build and deploy to staging' + + - job: DeployStagingJobWithValidation + pool: server + timeoutInMinutes: 4320 # job times out in 3 days + displayName: 'Deploy to Staging Job' + steps: + - task: ManualValidation@1 + timeoutInMinutes: 1440 # task times out in 1 day + inputs: + notifyUsers: mukunthanthebest@gmail.com + instructions: 'Please validate the stage configuration and resume' + onTimeout: 'resume' + +- stage: DeployToProduction + displayName: 'Deploy to Production' + dependsOn: DeployToStaging + lockBehavior: sequential + condition: and(succeeded(), in(variables['Build.SourceBranch'], 'refs/heads/main', 'refs/heads/release')) + jobs: + - job: DeployProductionJob + displayName: 'Deploy to Production Job' + steps: + - script: | + echo "Deploying to production..." + # Add your deployment commands here + displayName: 'Run deployment commands' + - job: waitForValidation + displayName: Wait for external validation + pool: server + timeoutInMinutes: 4320 # job times out in 3 days + steps: + - task: ManualValidation@1 + timeoutInMinutes: 1440 # task times out in 1 day + inputs: + notifyUsers: mukunthanthebest@gmail.com + instructions: 'Please validate the build configuration and resume' + onTimeout: 'resume' + +- stage: DeployToAlternateProduction + displayName: 'Deploy to Alternate Production' + condition: succeeded() + trigger: manual + jobs: + - job: DeployAlternateProductionJob + displayName: 'Deploy to Alternate Production Job' + steps: + - script: | + echo "Deploying to alternate production..." + # Add your deployment commands here + displayName: 'Run deployment commands' + +- stage: Rollback + displayName: 'Rollback Stage' + trigger: manual + jobs: + - job: RollbackJob + displayName: 'Rollback Job' + steps: + - script: | + echo "Rolling back the deployment..." + # Add your rollback commands here + displayName: 'Run rollback commands' \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..eef45022f --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,19 @@ +trigger: +- main + +pool: + vmImage: 'ubuntu-latest' + +stages: +- stage: Build + displayName: 'Build Stage' + jobs: + - job: BuildJob + displayName: 'Build Job' + steps: + - script: | + echo "Restoring project dependencies..." + displayName: 'Restore dependencies' + - script: | + echo "Running unit tests..." + displayName: 'Run unit tests' \ No newline at end of file