From 0043cb7eae0b566423d348b6738df2f09cff48c4 Mon Sep 17 00:00:00 2001 From: alsami Date: Sat, 3 Apr 2021 08:42:55 +0200 Subject: [PATCH] fix: make Travis install latest dotnet release beta through snap --- .travis.yml | 40 ++++++++++++++-------------------------- Covid19Api.sln | 1 + invoke-deployment.sh | 11 +++++++++++ 3 files changed, 26 insertions(+), 26 deletions(-) create mode 100755 invoke-deployment.sh diff --git a/.travis.yml b/.travis.yml index 44581de..14e1b66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,44 +2,32 @@ os: linux dist: bionic language: csharp mono: none -dotnet: 6.0.100-preview.2.21155.3 solution: Covid19Api.sln stages: - build - - test - - publish - - deploy + - invoke-deployment jobs: include: - stage: build name: dotnet-build + addons: + snaps: + - name: dotnet-sdk + confinement: classic + channel: 6.0/beta if: tag IS NOT present - script: - - dotnet build - - - stage: test - name: dotnet-test - before_script: - - sudo apt-get update && sudo apt-get install curl -y - script: - - ./test.sh - - - stage: publish - name: docker-container-publish - if: tag IS present - services: - - docker before_script: - - docker login -u ${REGISTRY_USER} -p ${REGISTRY_PASSWORD} ${REGISTRY} + - sudo snap alias dotnet-sdk.dotnet dotnet script: - - ./publish-docker.sh - - - stage: deploy - name: deploy + - dotnet build + + - stage: invoke-deployment + name: Invoke Device Deployment if: tag IS present - before_script: + before_script: - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + - az config set extension.use_dynamic_install=yes_without_prompt script: - - ./deploy-app.sh + - ./invoke-deployment.sh \ No newline at end of file diff --git a/Covid19Api.sln b/Covid19Api.sln index 5a18321..1675853 100644 --- a/Covid19Api.sln +++ b/Covid19Api.sln @@ -27,6 +27,7 @@ ProjectSection(SolutionItems) = preProject test.sh = test.sh execute-database-updates.sh = execute-database-updates.sh execute-database-migrations.sh = execute-database-migrations.sh + invoke-deployment.sh = invoke-deployment.sh EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Covid19Api.IoC", "src\Covid19Api.IoC\Covid19Api.IoC.csproj", "{783AD7D5-5C4D-4A63-86DE-543B972F3F46}" diff --git a/invoke-deployment.sh b/invoke-deployment.sh new file mode 100755 index 0000000..554a84f --- /dev/null +++ b/invoke-deployment.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +function authenticate() { + az login --service-principal -u ${SERVICE_PRINCIPAL_USER} -p ${SERVICE_PRINCIPAL_PASSWORD} --tenant ${SERVICE_PRINCIPAL_TENANT} +} + +function invoke() { + az iot hub invoke-device-method -n ${IOT_HUB_NAME} -d ${IOT_DEVICE_NAME} --mn ${IOT_DEVICE_METHOD_NAME} --mp '{ "tag": "'${TRAVIS_TAG}'" }' --to 60 +} + +authenticate +invoke \ No newline at end of file