Skip to content

Commit

Permalink
Merge pull request #200 from ropable/master
Browse files Browse the repository at this point in the history
Add Kustomize prod overlays, update GH workflows, remove LoggedPointResource
  • Loading branch information
ropable authored Dec 12, 2023
2 parents 6d6c3cc + b81bf8d commit 319b077
Show file tree
Hide file tree
Showing 19 changed files with 260 additions and 257 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
12 changes: 6 additions & 6 deletions .github/workflows/image-build-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ jobs:
security-events: write
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
id: checkout-repo
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=true
- name: Build and push Docker image
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
# Checkout repo and set up Python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
id: setup-python
with:
python-version: '3.10'
Expand Down
1 change: 1 addition & 0 deletions kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ spec:
emptyDir:
medium: "Memory"
restartPolicy: Always
terminationGracePeriodSeconds: 180
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../template
nameSuffix: -harvest-dplus
patches:
- path: patch.yaml
35 changes: 35 additions & 0 deletions kustomize/overlays/prod/cronjobs/harvest-email-dplus/patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: resourcetracking-cronjob
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: resourcetracking-cronjob
imagePullPolicy: IfNotPresent
args: ["manage.py", "harvest_tracking_email", "--device-type", "dplus", "--purge-email"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: DATABASE_URL
- name: EMAIL_HOST
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_HOST
- name: EMAIL_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_USER
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: EMAIL_PASSWORD
12 changes: 12 additions & 0 deletions kustomize/overlays/prod/deployment_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,15 @@ spec:
secretKeyRef:
name: resourcetracking-env-prod
key: TRACPLUS_URL
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_DSN
- name: SENTRY_TRANSACTION_SAMPLE_RATE
valueFrom:
secretKeyRef:
name: resourcetracking-env-prod
key: SENTRY_TRANSACTION_SAMPLE_RATE
- name: SENTRY_ENVIRONMENT
value: "prod"
2 changes: 1 addition & 1 deletion kustomize/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ labels:
variant: prod
images:
- name: ghcr.io/dbca-wa/resource_tracking
newTag: 1.4.1
newTag: 1.4.3
patches:
- path: deployment_patch.yaml
- path: service_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../../template
nameSuffix: -harvest-email-dplus
patches:
- path: patch.yaml
34 changes: 34 additions & 0 deletions kustomize/overlays/uat/cronjobs/harvest-email-dplus/patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: resourcetracking-cronjob
spec:
schedule: "* * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: resourcetracking-cronjob
args: ["manage.py", "harvest_tracking_email", "--device-type", "dplus"]
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: resourcetracking-env-uat
key: DATABASE_URL
- name: EMAIL_HOST
valueFrom:
secretKeyRef:
name: resourcetracking-env-uat
key: EMAIL_HOST
- name: EMAIL_USER
valueFrom:
secretKeyRef:
name: resourcetracking-env-uat
key: EMAIL_USER
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: resourcetracking-env-uat
key: EMAIL_PASSWORD
12 changes: 12 additions & 0 deletions kustomize/overlays/uat/deployment_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,15 @@ spec:
secretKeyRef:
name: resourcetracking-env-uat
key: TRACPLUS_URL
- name: SENTRY_DSN
valueFrom:
secretKeyRef:
name: resourcetracking-env-uat
key: SENTRY_DSN
- name: SENTRY_TRANSACTION_SAMPLE_RATE
valueFrom:
secretKeyRef:
name: resourcetracking-env-uat
key: SENTRY_TRANSACTION_SAMPLE_RATE
- name: SENTRY_ENVIRONMENT
value: "uat"
1 change: 1 addition & 0 deletions kustomize/overlays/uat/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ secretGenerator:
resources:
- ../../base
- cronjobs/harvest-dfes
- cronjobs/harvest-email-dplus
- cronjobs/harvest-email-iriditrak
- cronjobs/harvest-email-mp70
- cronjobs/harvest-tracplus
Expand Down
Loading

0 comments on commit 319b077

Please sign in to comment.