Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev workflow update #808

Merged
merged 4 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
REACT_APP_ENV_NAME=dev

REACT_APP_TRANSITLOG_SERVER=https://dev.reittiloki.hsl.fi/server/
REACT_APP_TRANSITLOG_SERVER_GRAPHQL=https://dev.reittiloki.hsl.fi/server/graphql/
REACT_APP_TRANSITLOG=https://dev.reittiloki.hsl.fi
REACT_APP_TRANSITLOG_SERVER=https://dev.reittiloki.hsldev.com/server/
REACT_APP_TRANSITLOG_SERVER_GRAPHQL=https://dev.reittiloki.hsldev.com/server/graphql/
REACT_APP_TRANSITLOG=https://dev.reittiloki.hsldev.com

# Auth
REACT_APP_AUTH_URI=https://hslid-uat.cinfra.fi/openid/auth
REACT_APP_CLIENT_ID=7510123698297597
REACT_APP_REDIRECT_URI=https://dev.reittiloki.hsl.fi
REACT_APP_REDIRECT_URI=https://dev.reittiloki.hsldev.com
REACT_APP_AUTH_SCOPE=email+https://oneportal.trivore.com/scope/groups.readonly

# Change this to false in production.
REACT_APP_ALLOW_DEV_LOGIN=false

# The current production URL. Update when/if it changes.
REACT_APP_PRODUCTION_URL=https://dev.reittiloki.hsl.fi
REACT_APP_PRODUCTION_URL=https://dev.reittiloki.hsldev.com

# The timezone for all dates and times in the app. For HSL this should be
# Europe/Helsinki since all scehdules are in Finnish time. Change this
Expand Down
117 changes: 53 additions & 64 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: hsldevcom/transitlog-ui
username: ddunderfelt
password: ${{ secrets.DDUNDERFELT_DOCKER_ACCESS_TOKEN }}
username: ${{ secrets.TRANSITLOG_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITLOG_DOCKERHUB_TOKEN }}
buildargs: BUILD_ENV=dev
tags: date-${{ steps.date.outputs.date }}
- name: Build UI and publish Docker image
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: hsldevcom/transitlog-ui
username: ddunderfelt
password: ${{ secrets.DDUNDERFELT_DOCKER_ACCESS_TOKEN }}
username: ${{ secrets.TRANSITLOG_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITLOG_DOCKERHUB_TOKEN }}
buildargs: BUILD_ENV=dev
tags: dev
- name: Checkout server
Expand All @@ -39,69 +39,58 @@ jobs:
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: hsldevcom/transitlog-server
username: ddunderfelt
password: ${{ secrets.DDUNDERFELT_DOCKER_ACCESS_TOKEN }}
username: ${{ secrets.TRANSITLOG_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITLOG_DOCKERHUB_TOKEN }}
tags: dev
- name: Build Server and publish timestamped Docker image
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: hsldevcom/transitlog-server
username: ddunderfelt
password: ${{ secrets.DDUNDERFELT_DOCKER_ACCESS_TOKEN }}
username: ${{ secrets.TRANSITLOG_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITLOG_DOCKERHUB_TOKEN }}
tags: date-${{ steps.date.outputs.date }}
- name: Deploy with Gitlab CI
run: curl -X POST -F token=${{ secrets.GITLAB_DEV_TRIGGER_TOKEN }} -F ref=master https://gitlab.hsl.fi/api/v4/projects/202/trigger/pipeline
- name: Notify of deployment
uses: 8398a7/action-slack@v2
if: always()
with:
status: ${{ job.status }}
text: Reittiloki DEV deployment status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
test-dev:
needs: deploy-dev
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: "14"
- uses: actions/checkout@v2
with:
ref: dev
- name: Sleep for 5 minutes
uses: jakejarvis/wait-action@master
with:
time: "5m"
- name: Cypress tests
uses: cypress-io/github-action@v2
with:
node-version: "14"
env:
CYPRESS_BASE_URL: https://dev.reittiloki.hsl.fi
CYPRESS_CLIENT_ID: ${{ secrets.CYPRESS_CLIENT_ID }}
CYPRESS_CLIENT_SECRET: ${{ secrets.CYPRESS_CLIENT_SECRET }}
CYPRESS_HSL_TESTING_HSLID_USERNAME: ${{ secrets.CYPRESS_HSL_TESTING_HSLID_USERNAME }}
CYPRESS_HSL_TESTING_HSLID_PASSWORD: ${{ secrets.CYPRESS_HSL_TESTING_HSLID_PASSWORD }}
- name: Upload screenshot artifacts
uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Upload video artifacts
uses: actions/upload-artifact@v1
if: failure()
with:
name: cypress-videos
path: cypress/videos
- name: Notify of tests
uses: 8398a7/action-slack@v2
if: failure()
with:
status: ${{ job.status }}
text: Reittiloki DEV E2E test status
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# test-dev:
# needs: deploy-dev
# runs-on: ubuntu-latest
# steps:
# - uses: actions/setup-node@v2
# with:
# node-version: "14"
# - uses: actions/checkout@v2
# with:
# ref: dev
# - name: Sleep for 5 minutes
# uses: jakejarvis/wait-action@master
# with:
# time: "5m"
# - name: Cypress tests
# uses: cypress-io/github-action@v2
# with:
# node-version: "14"
# env:
# CYPRESS_BASE_URL: https://dev.reittiloki.hsldev.com
# CYPRESS_CLIENT_ID: ${{ secrets.CYPRESS_CLIENT_ID }}
# CYPRESS_CLIENT_SECRET: ${{ secrets.CYPRESS_CLIENT_SECRET }}
# CYPRESS_HSL_TESTING_HSLID_USERNAME: ${{ secrets.CYPRESS_HSL_TESTING_HSLID_USERNAME }}
# CYPRESS_HSL_TESTING_HSLID_PASSWORD: ${{ secrets.CYPRESS_HSL_TESTING_HSLID_PASSWORD }}
# - name: Upload screenshot artifacts
# uses: actions/upload-artifact@v1
# if: failure()
# with:
# name: cypress-screenshots
# path: cypress/screenshots
# - name: Upload video artifacts
# uses: actions/upload-artifact@v1
# if: failure()
# with:
# name: cypress-videos
# path: cypress/videos
# - name: Notify of tests
# uses: 8398a7/action-slack@v2
# if: failure()
# with:
# status: ${{ job.status }}
# text: Reittiloki DEV E2E test status
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
8 changes: 4 additions & 4 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: hsldevcom/transitlog-ui
username: ddunderfelt
password: ${{ secrets.DDUNDERFELT_DOCKER_ACCESS_TOKEN }}
username: ${{ secrets.TRANSITLOG_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITLOG_DOCKERHUB_TOKEN }}
buildargs: BUILD_ENV=production
tags: production
- name: Checkout server
Expand All @@ -29,8 +29,8 @@ jobs:
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: hsldevcom/transitlog-server
username: ddunderfelt
password: ${{ secrets.DDUNDERFELT_DOCKER_ACCESS_TOKEN }}
username: ${{ secrets.TRANSITLOG_DOCKERHUB_USER }}
password: ${{ secrets.TRANSITLOG_DOCKERHUB_TOKEN }}
tags: production
- name: Deploy with Gitlab CI
run: curl -X POST -F token=${{ secrets.GITLAB_PROD_TRIGGER_TOKEN }} -F ref=master https://gitlab.hsl.fi/api/v4/projects/233/trigger/pipeline
Expand Down
2 changes: 1 addition & 1 deletion .graphqlconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"headers": { "user-agent": "JS GraphQL" }
},
"Transitlog server dev": {
"url": "https://dev.reittiloki.hsl.fi/server/graphql",
"url": "https://dev.reittiloki.hsldev.com/server/graphql",
"method": "POST",
"introspect": true,
"headers": { "user-agent": "JS GraphQL" }
Expand Down
2 changes: 1 addition & 1 deletion cypress.dev.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"baseUrl": "https://dev.reittiloki.hsl.fi"
"baseUrl": "https://dev.reittiloki.hsldev.com"
}
Loading