Skip to content

Commit

Permalink
fix: make Travis install latest dotnet release beta through snap
Browse files Browse the repository at this point in the history
  • Loading branch information
alsami committed Apr 6, 2021
1 parent 751b1d3 commit 0043cb7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
40 changes: 14 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions Covid19Api.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
11 changes: 11 additions & 0 deletions invoke-deployment.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0043cb7

Please sign in to comment.