-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Dependabot Automerge | ||
on: | ||
workflow_run: | ||
workflows: ["E2E tests"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
dependabot: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
if: github.actor == 'dependabot[bot]' | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Enable auto-merge for Dependabot PRs | ||
if: steps.metadata.outputs.update-type == 'version-update:semver-patch' | ||
run: gh pr merge --auto --merge "$PR_URL" | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: E2E tests | ||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
test_cloudfunction_deploy: | ||
runs-on: ubuntu-latest | ||
container: google/cloud-sdk | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: deploy cloudfunction | ||
env: | ||
GCLOUD_SERVICE_KEY: ${{ secrets.gcloud_service_key }} | ||
run: | | ||
echo $GCLOUD_SERVICE_KEY | base64 -d | gcloud auth activate-service-account --key-file=- | ||
export RAND_SUFFIX=$(tr -dc A-Za-z0-9 </dev/urandom | head -c 8 ; echo '') | ||
gcloud functions deploy ckr-dummy-$RAND_SUFFIX \ | ||
--region europe-west1 \ | ||
--entry-point Request \ | ||
--runtime go119 \ | ||
--trigger-http \ | ||
--project pe-dev-185509 | ||
gcloud functions delete ckr-dummy-$RAND_SUFFIX \ | ||
--region europe-west1 \ | ||
--project pe-dev-185509 \ | ||
--quiet | ||
ci_block: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: block on ci workflows | ||
id: block | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
MIN_WAIT: 30 | ||
MAX_WAIT: 300 | ||
run: bash ./scripts/ci_concurrency.sh | ||
e2e_test: | ||
runs-on: ubuntu-latest | ||
container: eversc/aws-cli:1.19 | ||
needs: ci_block | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: e2e test rotation | ||
env: | ||
CKR_CREDENTIALS_GITHUBAPITOKEN: ${{ secrets.CKR_GITHUB_TOKEN }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_E2E_TEST }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_E2E_TEST }} | ||
run: | | ||
export GO111MODULE=on | ||
go build -o cloud-key-rotator ./cmd | ||
chmod u+x cloud-key-rotator | ||
aws secretsmanager get-secret-value --secret-id ckr-config --region eu-west-1 --query SecretString --output text > config.json | ||
echo "used aws creds" | ||
./cloud-key-rotator rotate | ||
rm config.json | ||
sleep 10 | ||
if $(aws sts get-caller-identity >/dev/null 2>/dev/null); then exit 1; fi |