From e97b3d440096654a39d9a557e5920d61f22787b0 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 8 Sep 2023 10:53:44 +1200 Subject: [PATCH 1/4] MNT Use dispatch-ci --- .github/workflows/ci.yml | 5 ----- .github/workflows/dispatch-ci.yml | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/dispatch-ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4521a4b..bf02210 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,13 +4,8 @@ on: push: pull_request: workflow_dispatch: - # Every Tuesday at 15:40 UTC - schedule: - - cron: '40 15 * * 2' jobs: ci: name: CI - # Only run cron on the silverstripe account - if: (github.event_name == 'schedule' && startsWith(github.repository, 'silverstripe/')) || (github.event_name != 'schedule') uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 diff --git a/.github/workflows/dispatch-ci.yml b/.github/workflows/dispatch-ci.yml new file mode 100644 index 0000000..fcb4f4b --- /dev/null +++ b/.github/workflows/dispatch-ci.yml @@ -0,0 +1,16 @@ +name: Dispatch CI + +on: + # At 5:25 AM UTC, only on Tuesday and Wednesday + schedule: + - cron: '25 5 * * 2,3' + +jobs: + dispatch-ci: + name: Dispatch CI + # Only run cron on the silverstripe account + if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule') + runs-on: ubuntu-latest + steps: + - name: Dispatch CI + uses: silverstripe/gha-dispatch-ci@v1 From 437f71a1b7165ffcc3ef48cd08c8953336e69b04 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 8 Sep 2023 10:53:55 +1200 Subject: [PATCH 2/4] DOC Update README --- README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a433512..0ca8eb7 100644 --- a/README.md +++ b/README.md @@ -46,8 +46,10 @@ in EC2 instances, as credentials are automatically handled by the IAM role insid ```sh # The AWS access key and secret. This is optional if you've configured an instance with an IAM role # https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html -AWS_ACCESS_KEY=my-access-key -AWS_SECRET_KEY=my-secret +# Note that AWS_ACCESS_KEY can only contain alphanumeric characters +# https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html#DynamoDBLocal.DownloadingAndRunning.title +AWS_ACCESS_KEY=myaccesskey +AWS_SECRET_KEY=mysecret ``` ## Local Testing @@ -57,10 +59,10 @@ You can simulate DynamoDB locally for easier development through [DynamoDB Local Set environment constants. Note that actual access keys and regions are ignored, they just need to be defined. -```sh +```bash AWS_DYNAMODB_SESSION_TABLE=mysession -AWS_ACCESS_KEY=my-access-key -AWS_SECRET_KEY=my-secret +AWS_ACCESS_KEY=myaccesskey +AWS_SECRET_KEY=mysecret AWS_DYNAMODB_ENDPOINT=http://localhost:8000 AWS_REGION_NAME=ap-southeast-2 ``` @@ -71,6 +73,16 @@ and start it - it'll be available under `http://localhost:8000`. Now use the [AWS CLI Tools](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) to interact with your local DynamoDB. +Configure user (optional): + +You can configure a user to use with the AWS CLI tools. Use this if you are having issues with the environment variables being picked up. + +```bash +aws configure set aws_access_key_id myaccesskey +aws configure set aws_secret_access_key myaccesskey +aws configure set default.region ap-southeast-2 +``` + Create table: ```bash From 0b2f879d9a9e09566945fc3d0649692bb32d86b3 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 8 Sep 2023 10:54:18 +1200 Subject: [PATCH 3/4] DEP Update minimum version of aws/aws-sdk-php --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 7c75c65..2946f5e 100644 --- a/composer.json +++ b/composer.json @@ -19,11 +19,11 @@ } ], "require": { - "aws/aws-sdk-php": "^3.105", + "aws/aws-sdk-php": "^3.281", "silverstripe/framework": "^5" }, "require-dev": { - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6", "squizlabs/php_codesniffer": "^3.7" }, "autoload": { From 44f49220e9e4b0c260fa4f71bacfcb4041302dae Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 25 Sep 2023 14:07:27 +1300 Subject: [PATCH 4/4] MNT Run module-standardiser --- .github/workflows/keepalive.yml | 8 ++++---- .github/workflows/merge-up.yml | 17 +++++++++++++++++ license.md => LICENSE | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/merge-up.yml rename license.md => LICENSE (97%) diff --git a/.github/workflows/keepalive.yml b/.github/workflows/keepalive.yml index dbd6ebe..f604d79 100644 --- a/.github/workflows/keepalive.yml +++ b/.github/workflows/keepalive.yml @@ -1,16 +1,16 @@ name: Keepalive on: - workflow_dispatch: - # The 15th of every month at 15:20 UTC + # At 5:25 AM UTC, on day 10 of the month schedule: - - cron: '20 15 15 * *' + - cron: '25 5 10 * *' + workflow_dispatch: jobs: keepalive: name: Keepalive # Only run cron on the silverstripe account - if: (github.event_name == 'schedule' && startsWith(github.repository, 'silverstripe/')) || (github.event_name != 'schedule') + if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule') runs-on: ubuntu-latest steps: - name: Keepalive diff --git a/.github/workflows/merge-up.yml b/.github/workflows/merge-up.yml new file mode 100644 index 0000000..62dd390 --- /dev/null +++ b/.github/workflows/merge-up.yml @@ -0,0 +1,17 @@ +name: Merge-up + +on: + # At 5:25 AM UTC, only on Saturday + schedule: + - cron: '25 5 * * 6' + workflow_dispatch: + +jobs: + merge-up: + name: Merge-up + # Only run cron on the silverstripe account + if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule') + runs-on: ubuntu-latest + steps: + - name: Merge-up + uses: silverstripe/gha-merge-up@v1 diff --git a/license.md b/LICENSE similarity index 97% rename from license.md rename to LICENSE index 9445c8e..acbaea1 100644 --- a/license.md +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016, SilverStripe Limited +Copyright (c) 2016, Silverstripe Limited All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: