From b25dca4a8bcb0f56dddfbec2d22b57071d43099e Mon Sep 17 00:00:00 2001 From: Jacob Sanford Date: Tue, 27 Aug 2024 09:24:15 -0300 Subject: [PATCH] DOCKW-70 Dockworker 6.x update --- .../deployment/k8s/prod/deployment.yaml | 108 ------------------ .dockworker/dockworker.yml | 72 ++++++++---- .github/workflows/deployment-workflow.yaml | 19 +-- .gitignore | 2 +- composer.json | 12 +- docker-compose.yml | 4 +- 6 files changed, 72 insertions(+), 145 deletions(-) delete mode 100644 .dockworker/deployment/k8s/prod/deployment.yaml diff --git a/.dockworker/deployment/k8s/prod/deployment.yaml b/.dockworker/deployment/k8s/prod/deployment.yaml deleted file mode 100644 index eb8eb35..0000000 --- a/.dockworker/deployment/k8s/prod/deployment.yaml +++ /dev/null @@ -1,108 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: httpd - instance: authentication.unbscholar.lib.unb.ca - tier: auth - uri: authentication.unbscholar.lib.unb.ca - name: authentication-unbscholar-lib-unb-ca - namespace: prod -spec: - selector: - matchLabels: - uri: authentication.unbscholar.lib.unb.ca - replicas: 1 - revisionHistoryLimit: 2 - minReadySeconds: 30 - strategy: - type: RollingUpdate - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - template: - metadata: - labels: - app: httpd - instance: authentication.unbscholar.lib.unb.ca - tier: auth - uri: authentication.unbscholar.lib.unb.ca - spec: - nodeSelector: - deploy_prod: 'true' - containers: - - - name: authentication-unbscholar-lib-unb-ca - readinessProbe: - httpGet: - path: /Shibboleth.sso/Status - port: 443 - scheme: HTTPS - initialDelaySeconds: 30 - timeoutSeconds: 3 - periodSeconds: 15 - livenessProbe: - exec: - command: - - /bin/bash - - -c - - /scripts/checkLiveness.sh - initialDelaySeconds: 30 - timeoutSeconds: 3 - periodSeconds: 15 - startupProbe: - httpGet: - path: /Shibboleth.sso/Status - port: 443 - scheme: HTTPS - failureThreshold: 30 - periodSeconds: 10 - env: - - - name: DEPLOY_ENV - value: prod - image: "||DEPLOYMENTIMAGE||" - imagePullPolicy: Always - ports: - - - containerPort: 443 - volumeMounts: - - name: unbscholar-dspace-lib-unb-ca-key - mountPath: "/usr/local/apache2/keys/unbscholar_dspace_lib_unb_ca.key" - subPath: "unbscholar_dspace_lib_unb_ca.key" - readOnly: true - - name: unbscholar-dspace-lib-unb-ca-crt - mountPath: "/usr/local/apache2/keys/unbscholar_dspace_lib_unb_ca.crt" - subPath: "unbscholar_dspace_lib_unb_ca.crt" - readOnly: true - - name: unbscholar-dspace-lib-unb-ca-ca-bundle - mountPath: "/usr/local/apache2/keys/unbscholar_dspace_lib_unb_ca.ca-bundle" - subPath: "unbscholar_dspace_lib_unb_ca.ca-bundle" - readOnly: true - priorityClassName: high-priority-services - imagePullSecrets: - - - name: github-container-registry-auth - restartPolicy: Always - volumes: - - name: unbscholar-dspace-lib-unb-ca-key - secret: - secretName: unbscholar-dspace-lib-unb-ca-ssl - defaultMode: 256 - items: - - key: unbscholar_dspace_lib_unb_ca.key - path: unbscholar_dspace_lib_unb_ca.key - - name: unbscholar-dspace-lib-unb-ca-crt - secret: - secretName: unbscholar-dspace-lib-unb-ca-ssl - defaultMode: 256 - items: - - key: unbscholar_dspace_lib_unb_ca.crt - path: unbscholar_dspace_lib_unb_ca.crt - - name: unbscholar-dspace-lib-unb-ca-ca-bundle - secret: - secretName: unbscholar-dspace-lib-unb-ca-ssl - defaultMode: 256 - items: - - key: unbscholar_dspace_lib_unb_ca.ca-bundle - path: unbscholar_dspace_lib_unb_ca.ca-bundle diff --git a/.dockworker/dockworker.yml b/.dockworker/dockworker.yml index 761ce0e..85b4ad0 100644 --- a/.dockworker/dockworker.yml +++ b/.dockworker/dockworker.yml @@ -1,26 +1,52 @@ dockworker: - version: '5' + version: '6' application: - name: authentication.unbscholar.lib.unb.ca - finish_marker: 'resuming normal operations' - project_prefix: - - SCHOLAR - shell: /bin/bash - upstream_images: - - httpd:2-bullseye - uuid: 3117 - deployment: - environments: + name: UNB Scholar Authentication Service + uri: https://authentication.unbscholar.lib.unb.ca + description: > + An apache proxy to authenticate users for UNB Scholar. + topics: + - auth + - apache + identifiers: + id: authentication.unbscholar.lib.unb.ca + slug: authentication-unbscholar-lib-unb-ca + short_slug: schoauth + uuid: 3117 + framework: + name: Httpd + version: 2 + startup_finished_marker: 'resuming normal operations' + endpoint: + name: http + port: 80 + readiness_timeout: 15 + license: + license: MIT + holder: University of New Brunswick Libraries + shell: + path: /bin/sh + endpoints: + env: + - dev - prod - workflow: - source: dockworker - type: deployment-workflow - github: - repo: authentication.unbscholar.lib.unb.ca - owner: unb-libraries - image: - push_branches: - - prod - name: ghcr.io/unb-libraries/authentication.unbscholar.lib.unb.ca - date_tag_image: true - repository: ghcr + deployments: + authentication-unbscholar-lib-unb-ca: + default: true + managed: true + name: authentication-unbscholar-lib-unb-ca + workflows: + vcs: + type: github + owner: unb-libraries + name: authentication.unbscholar.lib.unb.ca + jira: + project_keys: + - SCHOLAR + image: + name: ghcr.io/unb-libraries/authentication.unbscholar.lib.unb.ca + parent: httpd:2-bullseye + repository: GitHub + push-branches: + - dev + - prod diff --git a/.github/workflows/deployment-workflow.yaml b/.github/workflows/deployment-workflow.yaml index 269347d..2082138 100644 --- a/.github/workflows/deployment-workflow.yaml +++ b/.github/workflows/deployment-workflow.yaml @@ -1,4 +1,4 @@ -name: authentication.unbscholar.lib.unb.ca +name: Deploy authentication.unbscholar.lib.unb.ca on: pull_request: @@ -7,15 +7,16 @@ on: jobs: deploy: - uses: unb-libraries/dockworker/.github/workflows/deployment-workflow.yaml@5.x + uses: unb-libraries/dockworker/.github/workflows/build-push-deploy-notify.yaml@6.x with: + branch-env-map: '{"dev":"dev","prod":"prod"}' + build-themes: false deploy-branches: '["dev","prod"]' + image-name: 'ghcr.io/unb-libraries/authentication.unbscholar.lib.unb.ca' + k8s-deployment-name: 'authentication-unbscholar-lib-unb-ca' + push-branches: '["dev","prod"]' secrets: - DOCKER_CLOUD_ACCESS_TOKEN: ${{ secrets.DOCKER_CLOUD_ACCESS_TOKEN }} - DOCKER_CLOUD_USER_NAME: ${{ secrets.DOCKER_CLOUD_USER_NAME }} - GH_CONTAINER_REGISTRY_TOKEN: ${{ secrets.GH_CONTAINER_REGISTRY_TOKEN }} - GH_CONTAINER_REGISTRY_USER: ${{ secrets.GH_CONTAINER_REGISTRY_USER }} - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - NEW_RELIC_ACCOUNT_ID: ${{ secrets.NEW_RELIC_ACCOUNT_ID }} - NEW_RELIC_API_KEY: ${{ secrets.NEW_RELIC_API_KEY }} + KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_DATA }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + GH_CONTAINER_REGISTRY_USER: ${{ secrets.GH_CONTAINER_REGISTRY_USER }} + GH_CONTAINER_REGISTRY_TOKEN: ${{ secrets.GH_CONTAINER_REGISTRY_TOKEN }} diff --git a/.gitignore b/.gitignore index e6cf55f..36d2d87 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .gitkeep .idea vendor -composer.lock +/composer.lock tests/features/bootstrap build/scripts/local config-yml/.htaccess diff --git a/composer.json b/composer.json index 92c45d3..ad1406f 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,15 @@ { + "autoload": { + "psr-4": { + "Dockworker\\": ".dockworker/src" + } + }, "config": { "preferred-install": { "*": "dist" + }, + "allow-plugins": { + "php-http/discovery": true } }, "description": "Scaffold and provision local development for authentication.unbscholar.lib.unb.ca", @@ -10,11 +18,11 @@ "name": "unb-libraries/authentication.unbscholar.lib.unb.ca", "prefer-stable": true, "require-dev": { - "unb-libraries/dockworker": "^5" + "unb-libraries/dockworker-daemon": "^6" }, "scripts": { "post-update-cmd": [ - "vendor/bin/dockworker dockworker:git:setup-hooks" + "vendor/bin/dockworker git:setup-hooks" ] } } diff --git a/docker-compose.yml b/docker-compose.yml index 87af61d..7a18991 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,9 @@ services: - authentication.unbscholar.lib.unb.ca: + authentication-unbscholar-lib-unb-ca: build: context: . restart: unless-stopped - container_name: authentication.unbscholar.lib.unb.ca + container_name: authentication-unbscholar-lib-unb-ca expose: - "80" networks: