Browse Source

WIP

pull/1565/head
Borja García Rodríguez 4 years ago
parent
commit
d077926031
16 changed files with 478 additions and 0 deletions
  1. +30
    -0
      .github/workflows/apigws/workflow.yml
  2. +25
    -0
      .github/workflows/basket-api/workflow.yml
  3. +94
    -0
      .github/workflows/buildimages.yaml
  4. +25
    -0
      .github/workflows/catalog-api/workflow.yml
  5. +25
    -0
      .github/workflows/identity-api/workflow.yml
  6. +27
    -0
      .github/workflows/infrastructure/workflow.yml
  7. +24
    -0
      .github/workflows/mobile-shopping-agg/workflow.yml
  8. +25
    -0
      .github/workflows/multiarch.yaml
  9. +27
    -0
      .github/workflows/ordering-api/workflow.yml
  10. +25
    -0
      .github/workflows/payment-api/workflow.yml
  11. +24
    -0
      .github/workflows/web-shopping-agg/workflow.yml
  12. +25
    -0
      .github/workflows/webhooks-api/workflow.yml
  13. +25
    -0
      .github/workflows/webhooks-client/workflow.yml
  14. +25
    -0
      .github/workflows/webmvc/workflow.yml
  15. +27
    -0
      .github/workflows/webspa/workflow.yml
  16. +25
    -0
      .github/workflows/webstatus/workflow.yml

+ 30
- 0
.github/workflows/apigws/workflow.yml View File

@ -0,0 +1,30 @@
on:
push:
branches:
- master
- dev
- feature/github-actions
paths:
- src/ApiGateways/*
- .github/workflows/buildimages.yml
- .github/workflows/multiarch.yml
- .github/workflows/apigws/*
- deploy/k8s/helm/apigwmm/*
- deploy/k8s/helm/apigwms/*
- deploy/k8s/helm/apigwwm/*
- deploy/k8s/helm/apigwws/*
paths-ignore:
- src/ApiGateways/Mobile.Bff.Shopping/aggregator/*
- src/ApiGateways/Web.Bff.Shopping/aggregator/*
jobs:
PublishCharts:
runs-on: ubuntu-16.04
if: ne('${{ env.Build.Reason }}', 'PullRequest')
steps:
- uses: actions/checkout@v2
- run: Copy '${{ github.workspace }}/deploy/k8s/helm/' '${{ github.workspace }}/deploy/k8s/helm'
shell: powershell
- uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/deploy/k8s/helm
name: helm

+ 25
- 0
.github/workflows/basket-api/workflow.yml View File

@ -0,0 +1,25 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/BuildingBlocks/*
- src/Services/Basket/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/basket-api/*
- deploy/k8s/helm/basket-api/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 94
- 0
.github/workflows/buildimages.yaml View File

@ -0,0 +1,94 @@
parameters:
services: ''
registryEndpoint: ''
helmfrom: ''
helmto: ''
jobs:
- job: BuildContainersForPR_Linux
condition: eq('${{ variables['Build.Reason'] }}', 'PullRequest')
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: docker-compose -f src/docker-compose.yml build ${{ parameters.services }}
displayName: Compose build ${{ parameters.services }}
env:
TAG: ${{ variables['Build.SourceBranchName'] }}
- job: BuildContainersForPR_Windows
condition: False
# condition: eq('${{ variables['Build.Reason'] }}', 'PullRequest')
pool:
vmImage: 'windows-2019'
steps:
- bash: docker-compose f src/docker-compose.yml build ${{ parameters.services }}
displayName: Compose build ${{ parameters.services }}
env:
TAG: ${{ variables['Build.SourceBranchName'] }}
PLATFORM: win
NODE_IMAGE: stefanscherer/node-windows:10
- job: BuildLinux
condition: ne('${{ variables['Build.Reason'] }}', 'PullRequest')
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DockerCompose@0
displayName: Compose build ${{ parameters.services }}
inputs:
dockerComposeCommand: 'build ${{ parameters.services }}'
containerregistrytype: Container Registry
dockerRegistryEndpoint: ${{ parameters.registryEndpoint }}
dockerComposeFile: src/docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=${{ variables['Build.SourceBranchName'] }}
- task: DockerCompose@0
displayName: Compose push ${{ parameters.images }}
inputs:
dockerComposeCommand: 'push ${{ parameters.services }}'
containerregistrytype: Container Registry
dockerRegistryEndpoint: ${{ parameters.registryEndpoint }}
dockerComposeFile: src/docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=${{ variables['Build.SourceBranchName'] }}
- task: CopyFiles@2
inputs:
sourceFolder: ${{ parameters.helmfrom }}
targetFolder: ${{ parameters.helmto }}
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: ${{ parameters.helmto }}
artifactName: helm
- job: BuildWindows
condition: False
# condition: ne('${{ variables['Build.Reason'] }}', 'PullRequest')
pool:
vmImage: 'windows-2019'
steps:
- task: DockerCompose@0
displayName: Compose build ${{ parameters.services }}
inputs:
dockerComposeCommand: 'build ${{ parameters.services }}'
containerregistrytype: Container Registry
dockerRegistryEndpoint: ${{ parameters.registryEndpoint }}
dockerComposeFile: src/docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=${{ variables['Build.SourceBranchName'] }}
PLATFORM=win
NODE_IMAGE=stefanscherer/node-windows:10
- task: DockerCompose@0
displayName: Compose push ${{ parameters.services }}
inputs:
dockerComposeCommand: 'push ${{ parameters.services }}'
containerregistrytype: Container Registry
dockerRegistryEndpoint: ${{ parameters.registryEndpoint }}
dockerComposeFile: src/docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=${{ variables['Build.SourceBranchName'] }}
PLATFORM=win

+ 25
- 0
.github/workflows/catalog-api/workflow.yml View File

@ -0,0 +1,25 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/BuildingBlocks/*
- src/Services/Catalog/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/catalog-api/*
- deploy/k8s/helm/catalog-api/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 25
- 0
.github/workflows/identity-api/workflow.yml View File

@ -0,0 +1,25 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/BuildingBlocks/*
- src/Services/Identity/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/identity-api/*
- deploy/k8s/helm/identity-api/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 27
- 0
.github/workflows/infrastructure/workflow.yml View File

@ -0,0 +1,27 @@
on:
push:
branches:
- master
- dev
paths:
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/infrastructure/*
- deploy/k8s/helm/basket-data/*
- deploy/k8s/helm/keystore-data/*
- deploy/k8s/helm/nosql-data/*
- deploy/k8s/helm/rabbitmq/*
- deploy/k8s/helm/sql-data/*
env:
registryEndpoint: eshop-registry
jobs:
build:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- run: Copy '${{ github.workspace }}/deploy/k8s/helm/' '${{ github.workspace }}/deploy/k8s/helm'
shell: powershell
- uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/deploy/k8s/helm
name: helm

+ 24
- 0
.github/workflows/mobile-shopping-agg/workflow.yml View File

@ -0,0 +1,24 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/ApiGateways/Mobile.Bff.Shopping/aggregator/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/mobile-shopping-agg/*
- deploy/k8s/helm/mobileshoppingagg/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 25
- 0
.github/workflows/multiarch.yaml View File

@ -0,0 +1,25 @@
env:
image: ''
branch: ''
registry: eshop
registryEndpoint: ''
jobs:
manifest:
runs-on: Ubuntu 16.04
needs:
- BuildLinux
if: and(,ne('${{ env.variables['Build.Reason'] }}', 'PullRequest'))
steps:
- uses: actions/checkout@v2
- name: Docker Login
run: docker login
- name: Create multiarch manifest
run: |
mkdir -p ~/.docker
sed '$ s/.$//' $DOCKER_CONFIG/config.json > ~/.docker/config.json
echo ',"experimental": "enabled" }' >> ~/.docker/config.json
docker --config ~/.docker manifest create ${{ env.parameters.registry }}/${{ env.parameters.image }}:${{ env.parameters.branch }} ${{ env.parameters.registry }}/${{ env.parameters.image }}:linux-${{ env.parameters.branch }}
docker --config ~/.docker manifest create ${{ env.parameters.registry }}/${{ env.parameters.image }}:latest ${{ env.parameters.registry }}/${{ env.parameters.image }}:linux-latest
docker --config ~/.docker manifest push ${{ env.parameters.registry }}/${{ env.parameters.image }}:${{ env.parameters.branch }}
docker --config ~/.docker manifest push ${{ env.parameters.registry }}/${{ env.parameters.image }}:latest
shell: bash

+ 27
- 0
.github/workflows/ordering-api/workflow.yml View File

@ -0,0 +1,27 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/BuildingBlocks/*
- src/Services/Ordering/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/ordering-api/*
- deploy/k8s/helm/ordering-api/*
- deploy/k8s/helm/ordering-backgroundtasks/*
- deploy/k8s/helm/ordering-signalrhub/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 25
- 0
.github/workflows/payment-api/workflow.yml View File

@ -0,0 +1,25 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/BuildingBlocks/*
- src/Services/Payment/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/payment-api/*
- deploy/k8s/helm/payment-api/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 24
- 0
.github/workflows/web-shopping-agg/workflow.yml View File

@ -0,0 +1,24 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/ApiGateways/Web.Bff.Shopping/aggregator/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/web-shopping-agg/*
- deploy/k8s/helm/webshoppingagg/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 25
- 0
.github/workflows/webhooks-api/workflow.yml View File

@ -0,0 +1,25 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/BuildingBlocks/*
- src/Services/Webhooks/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/webhooks-api/*
- deploy/k8s/helm/webhooks-api/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 25
- 0
.github/workflows/webhooks-client/workflow.yml View File

@ -0,0 +1,25 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/BuildingBlocks/*
- src/Web/WebhookClient/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/webhooks-client/*
- deploy/k8s/helm/webhooks-web/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 25
- 0
.github/workflows/webmvc/workflow.yml View File

@ -0,0 +1,25 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/BuildingBlocks/*
- src/Web/WebMVC/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/webmvc/*
- deploy/k8s/helm/webmvc/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

+ 27
- 0
.github/workflows/webspa/workflow.yml View File

@ -0,0 +1,27 @@
variables:
registryEndpoint: eshop-registry
trigger:
branches:
include:
- master
- dev
paths:
include:
- src/BuildingBlocks/*
- src/Web/WebSPA/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/webspa/*
- deploy/k8s/helm/webspa/*
jobs:
- template: ../buildimages.yaml
parameters:
services: webspa
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/deploy/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/deploy/k8s/helm
- template: ../multiarch.yaml
parameters:
image: webspa
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

+ 25
- 0
.github/workflows/webstatus/workflow.yml View File

@ -0,0 +1,25 @@
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
#Note: Azure DevOps template does not have an equivalent in GitHub Actions yet
on:
push:
branches:
- master
- dev
paths:
- src/BuildingBlocks/*
- src/Web/WebStatus/*
- build/azure-devops/buildimages.yml
- build/azure-devops/multiarch.yml
- build/azure-devops/webstatus/*
- deploy/k8s/helm/webstatus/*
env:
registryEndpoint: eshop-registry
jobs:
job_1_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2
job_2_template:
# 'Note: Azure DevOps template does not have an equivalent in GitHub Actions yet'
steps:
- uses: actions/checkout@v2

Loading…
Cancel
Save