Skip to content

Commit

Permalink
Updated yml files to handle for new environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
modern-sapien committed Oct 16, 2024
1 parent 8782e2f commit aaff6de
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/checkly-fail-safe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
echo "GitHub Ref: ${{ github.ref }}"
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
echo "Setting Environment for production"
echo "NEXT_PUBLIC_NODE_PRODUCTION=production" >> $GITHUB_ENV
echo "NEXT_PUBLIC_ENVIRONMENT=production" >> $GITHUB_ENV
echo "NEXT_PUBLIC_ENVIRONMENT_URL=https://next-danube-webshop.vercel.app/" >> $GITHUB_ENV
elif [ "${{ github.ref }}" = "refs/heads/staging" ]; then
echo "Setting Environment for staging"
echo "NEXT_PUBLIC_NODE_STAGING=staging" >> $GITHUB_ENV
echo "NEXT_PUBLIC_ENVIRONMENT=staging" >> $GITHUB_ENV
echo "NEXT_PUBLIC_ENVIRONMENT_URL=https://next-danube-webshop-staging.vercel.app/" >> $GITHUB_ENV
fi
- name: Print Environment Variables
Expand All @@ -41,12 +41,12 @@ jobs:
- name: Run checks
id: run-checks
working-directory: next-webstore
run: NEXT_PUBLIC_NODE_ENV=${{ env.NEXT_PUBLIC_NODE_ENV }} npx checkly test -e NEXT_PUBLIC_ENVIRONMENT_URL=${{ env.NEXT_PUBLIC_ENVIRONMENT_URL }} --reporter=github --record
run: NEXT_PUBLIC_ENVIRONMENT=${{ env.NEXT_PUBLIC_ENVIRONMENT }} npx checkly test -e NEXT_PUBLIC_ENVIRONMENT_URL=${{ env.NEXT_PUBLIC_ENVIRONMENT_URL }} --reporter=github --record
- name: Deploy checks
id: deploy-checks
if: steps.run-checks.outcome == 'success' && contains('main staging', github.ref)
working-directory: next-webstore
run: NEXT_PUBLIC_NODE_ENV=${{ env.NEXT_PUBLIC_NODE_ENV }} npx checkly deploy --force
run: NEXT_PUBLIC_ENVIRONMENT=${{ env.NEXT_PUBLIC_ENVIRONMENT }} npx checkly deploy --force
- name: Rollback
if: steps.run-checks.outcome != 'success' && contains('main staging', github.ref)
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checkly-preview-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ jobs:
- name: Run checks
id: run-checks
working-directory: next-webstore
run: NEXT_PUBLIC_NODE_PREVIEW=preview npx checkly test -e NEXT_PUBLIC_NODE_PREVIEW=preview NEXT_PUBLIC_ENVIRONMENT_URL=${{ env.ENVIRONMENT_URL}} --record
run: NEXT_PUBLIC_ENVIRONMENT=preview npx checkly test -e NEXT_PUBLIC_ENVIRONMENT=preview NEXT_PUBLIC_ENVIRONMENT_URL=${{ env.ENVIRONMENT_URL}} --record
continue-on-error: false
2 changes: 1 addition & 1 deletion next-webstore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next

## Helpful Run Commands
```bash
NEXT_PUBLIC_ENVIRONMENT=staging npx checkly test login --record --env "NEXT_PUBLIC_ENVIRONMENT=staging
NEXT_PUBLIC_ENVIRONMENT=staging npx checkly test login --record --env "NEXT_PUBLIC_ENVIRONMENT=staging"
```

```bash
Expand Down
12 changes: 6 additions & 6 deletions next-webstore/checks/api.check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { group } from './resources/group.check';
new ApiCheck(`next-danube-${defaults.projectEnv}-books-api-check`, {
name: `Next Danube API ${defaults.projectEnv} - Books`,
group,
degradedResponseTime: 3000,
degradedResponseTime: 1500,
frequency: 1,
maxResponseTime: 5000,
maxResponseTime: 3000,
request: {
url: `https://next-danube-webshop-backend-${defaults.projectEnv}.vercel.app/api/v1/books`,
url: `${defaults.apiUrl}/books`,
method: 'GET',
followRedirects: true,
bodyType: "RAW",
Expand All @@ -22,11 +22,11 @@ new ApiCheck(`next-danube-${defaults.projectEnv}-books-api-check`, {
new ApiCheck(`next-danube-${defaults.projectEnv}-reviews-api-check`, {
name: `Next Danube API ${defaults.projectEnv} - Reviews`,
group,
degradedResponseTime: 3000,
degradedResponseTime: 1500,
frequency: 1,
maxResponseTime: 5000,
maxResponseTime: 3000,
request: {
url: `https://next-danube-webshop-backend-${defaults.projectEnv}.vercel.app/api/v1/reviews`,
url: `${defaults.apiUrl}/reviews`,
method: 'GET',
followRedirects: true,
skipSSL: false,
Expand Down
1 change: 1 addition & 0 deletions next-webstore/checks/browser.check.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BrowserCheck, Frequency, RetryStrategyBuilder } from 'checkly/constructs';
import { defaults } from '../tests/defaults';
import { group } from './resources/group.check';
// alertChannels
import * as path from 'path';

new BrowserCheck(`next-danube-${defaults.projectEnv}-login`, {
Expand Down
2 changes: 1 addition & 1 deletion next-webstore/checks/resources/group.check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CheckGroup, Frequency, RetryStrategyBuilder } from 'checkly/constructs'
import { defaults } from '../../tests/defaults';

export const group = new CheckGroup(`${defaults.projectEnv}-next-danube-group`, {
name: `next danube ${defaults.projectEnv}`,
name: `Next Danube - ${defaults.projectEnv}`,
activated: true,
frequency: Frequency.EVERY_15M,
locations: ['us-east-1', 'us-west-1'],
Expand Down
2 changes: 1 addition & 1 deletion next-webstore/tests/e2e/login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test';
import { defaults } from '../defaults';
import { validateStorageState } from '../utils/validateStorageState';
// import { validateStorageState } from '../utils/validateStorageState';
import { createChecklyContext } from '../utils/checklyRequestContext';

const apiKey = defaults.apiKey;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aaff6de

Please sign in to comment.