Skip to content

Commit

Permalink
Migrate to Azure Samples (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-uk authored Dec 21, 2023
1 parent a01b3e2 commit 480613d
Show file tree
Hide file tree
Showing 60 changed files with 2,694 additions and 3,429 deletions.
4 changes: 2 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#AUTH_CLIENT_ID="CHANGEME"

#
# Here be dragons!
# Here be dragons, you really have no reason to ever change these!
#
#DAPR_STORE_NAME="statestore"
#DAPR_ORDERS_TOPIC="orders-queue"
#DAPR_PUBSUB_NAME="pubsub"
#DAPR_PUBSUB_NAME="pubsub"
2 changes: 0 additions & 2 deletions .github/act/.secrets.sample

This file was deleted.

33 changes: 0 additions & 33 deletions .github/act/readme.md

This file was deleted.

5 changes: 0 additions & 5 deletions .github/act/release.json

This file was deleted.

5 changes: 0 additions & 5 deletions .github/act/workflow_dispatch.json

This file was deleted.

109 changes: 0 additions & 109 deletions .github/scripts/url-check.sh

This file was deleted.

30 changes: 3 additions & 27 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
branches: [main]

env:
VERSION: 0.8.3
VERSION: 0.8.4
STORAGE_ACCT_NAME: benc
BUILD_INFO: "Build:development / Workflow:${{ github.workflow }} / RunId:${{ github.run_id }} / Ref:${{ github.ref }} / SHA:${{ github.sha }} / ImageTag:${{ github.run_id }}"
IMAGE_REG: ghcr.io
Expand All @@ -32,7 +32,7 @@ jobs:
- name: "Set Go version and paths"
uses: actions/setup-go@v3
with:
go-version: "^1.19.0"
go-version: "^1.21.0"

- name: "Install extra tools"
run: |
Expand All @@ -45,15 +45,7 @@ jobs:
make lint
- name: "Run all unit tests"
run: make test-reports

# Very optional - upload of test results
- name: "Upload test reports to Azure"
if: ${{ success() || failure() }}
run: |
az storage blob upload-batch --account-name $STORAGE_ACCT_NAME --account-key "${{ secrets.STORAGE_KEY }}" \
--source ./output --destination \$web/${{ github.run_id }} --no-progress > /dev/null
echo -e "📜🌍 Test reports uploaded and viewable here - https://$STORAGE_ACCT_NAME.z6.web.core.windows.net/${{ github.run_id }}/"
run: make test

# ===== Build container images ======
build-images:
Expand All @@ -79,19 +71,3 @@ jobs:
echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REG -u $GITHUB_ACTOR --password-stdin
make docker-push-${{ matrix.serviceName }} IMAGE_TAG=$IMAGE_TAG
make docker-push-${{ matrix.serviceName }} IMAGE_TAG=latest
# ===== Fire off the deployment workflow ======
trigger-deployment:
runs-on: ubuntu-latest
needs:
- build-images
- tests-linting
steps:
# Continuous deployment trigger
- name: "Trigger deployment with workflows_dispatch"
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Deploy To Kubernetes
token: ${{ secrets.GH_PAT }}
inputs: '{ "IMAGE_TAG": "${{ env.IMAGE_TAG }}" }'
60 changes: 0 additions & 60 deletions .github/workflows/deploy-k8s.yaml

This file was deleted.

30 changes: 13 additions & 17 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# =================================================================
# An opinionated config for linting Go code with golangci-lint
# See https://golangci-lint.run/usage/linters
# See https://golangci-lint.run/usage/linters
# =================================================================

linters:
enable:
- revive # Replacement for golint
- gofmt # Runs gofmt as part of the linter
#- gosec # Find security issues
- wsl # Whitespace style enforcer, a matter of taste
- stylecheck # A few Go style rules
- nosnakecase # We are not writing Python here
- misspell # Find misspelled words
- cyclop # Find cyclomatic complexity
- gocyclo # Also find cyclomatic complexity
- bodyclose # Check for HTTP body close errors
- nilerr # Find bad nil/err handling
- nilnil # Also find bad nil/err handling
#- tagliatelle # Find badly named struct tags
#- gomnd # Find magic numbers, enable at your peril
- revive # Replacement for golint
- gofmt # Runs gofmt as part of the linter
- wsl # Whitespace style enforcer, a matter of taste
- stylecheck # A few Go style rules
- misspell # Find misspelled words
- cyclop # Find cyclomatic complexity
- gocyclo # Also find cyclomatic complexity
- bodyclose # Check for HTTP body close errors
- nilerr # Find bad nil/err handling
- nilnil # Also find bad nil/err handling

linters-settings:
misspell:
Expand All @@ -33,7 +29,7 @@ linters-settings:
yaml: goCamel

revive:
severity: error
severity: error
enable-all-rules: false
confidence: 0.5
rules:
Expand All @@ -42,4 +38,4 @@ linters-settings:
# And https://golangci-lint.run/usage/linters/#revive
- name: line-length-limit
severity: error
arguments: [160]
arguments: [160]
4 changes: 0 additions & 4 deletions .vscode/settings.json

This file was deleted.

Loading

0 comments on commit 480613d

Please sign in to comment.