Skip to content

Commit

Permalink
Merge branch '5.0' into 5
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Sep 25, 2023
2 parents 6882588 + 23488d0 commit 2475203
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 17 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions .github/workflows/dispatch-ci.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions .github/workflows/keepalive.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/merge-up.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion license.md → LICENSE
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 2475203

Please sign in to comment.