From 1131424b8f54249d38f5d957ac3745c85e339758 Mon Sep 17 00:00:00 2001 From: Simon Dalvai Date: Thu, 29 Feb 2024 10:22:53 +0100 Subject: [PATCH 1/2] ci/cd: create nighly build --- .github/workflows/nightly.yml | 267 ++++++++++++++++++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000..28cdeefb --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,267 @@ +name: CI/CD nightly build + +on: + push: + pull_request: + schedule: + # every night at 3am + - cron: '0 3 * * *' + +env: + PROJECT_NAME: "odh-mentor-otp" + API_HOST: http://localhost + API_PATH: /otp/routers/openmove + API_PORT: 8080 + DOCKER_IMAGE_OTP: ghcr.io/${{ github.repository }}/odh-mentor-otp + DOCKER_IMAGE_JOURNEY: ghcr.io/${{ github.repository }}/odh-mentor-otp-journey + DOCKER_IMAGE_GBFS: ghcr.io/${{ github.repository }}/odh-mentor-otp-gbfs + DOCKER_IMAGE_GEOCODER: ghcr.io/${{ github.repository }}/odh-mentor-otp-geocoder + DOCKER_IMAGE_CARSHARING: ghcr.io/${{ github.repository }}/odh-mentor-otp-carsharing + DOCKER_IMAGE_PARKING: ghcr.io/${{ github.repository }}/odh-mentor-otp-parking + DOCKER_IMAGE_ECHARGING: ghcr.io/${{ github.repository }}/odh-mentor-otp-echarging + DOCKER_IMAGE_DRT: ghcr.io/${{ github.repository }}/odh-mentor-otp-drt + DOCKER_IMAGE_TRAFFIC: ghcr.io/${{ github.repository }}/odh-mentor-otp-traffic + DOCKER_TAG: ${{ github.sha }} + +jobs: + test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + + - name: REUSE Compliance Check + uses: fsfe/reuse-action@v1 + + - name: Build graph + run: sh build-graph.sh + + - name: Build docker file + uses: noi-techpark/github-actions/docker-build@v2 + with: + docker-compose-file: docker-compose.build.execute.yml + + execute-test: + runs-on: ubuntu-22.04 + needs: test + concurrency: deploy-test + env: + API_HOST: "https://otp.opendatahub.testingmachine.eu" + API_PORT: "443" + API_PATH: "/otp/routers/openmove" + GEOCODER_BASEURL: "https://geocoder.otp.opendatahub.testingmachine.eu" + PARKING_BASEURL: "https://parking.otp.opendatahub.testingmachine.eu" + DRT_BASEURL: "https://drt.otp.opendatahub.testingmachine.eu" + CHARGER_BASEURL: "https://charger.otp.opendatahub.testingmachine.eu" + CARSHARING_BASEURL: "https://carsharing.otp.opendatahub.testingmachine.eu" + TRAFFIC_BASEURL: "https://traffic.otp.opendatahub.testingmachine.eu" + MATOMO_BASE_URL: "https://digital.matomo.cloud/" + MATOMO_SITE_ID: 20 + + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Create .env file + uses: noi-techpark/github-actions/env-file@v2 + env: + X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} + X_DOCKER_IMAGE_OTP: ${{ env.DOCKER_IMAGE_OTP }} + X_DOCKER_IMAGE_JOURNEY: ${{ env.DOCKER_IMAGE_JOURNEY }} + X_DOCKER_IMAGE_GBFS: ${{ env.DOCKER_IMAGE_GBFS }} + X_DOCKER_IMAGE_GEOCODER: ${{ env.DOCKER_IMAGE_GEOCODER }} + X_DOCKER_IMAGE_CARSHARING: ${{ env.DOCKER_IMAGE_CARSHARING }} + X_DOCKER_IMAGE_PARKING: ${{ env.DOCKER_IMAGE_PARKING }} + X_DOCKER_IMAGE_ECHARGING: ${{ env.DOCKER_IMAGE_ECHARGING }} + X_DOCKER_IMAGE_DRT: ${{ env.DOCKER_IMAGE_DRT }} + X_DOCKER_IMAGE_TRAFFIC: ${{ env.DOCKER_IMAGE_TRAFFIC }} + X_DOCKER_TAG: ${{ env.DOCKER_TAG }} + + X_EFS_FOLDER: "/opt/odh-mentor-otp-test/" + + X_SERVER_PORT_OTP: 1080 + X_SERVER_PORT_JOURNEY: 1081 + X_GBFS_HOST : "https://gbfs.otp.opendatahub.testingmachine.eu/" + X_DOCKER_GBFS_PORT: 1082 + X_DOCKER_GEOCODER_PORT: 1083 + X_DOCKER_CARSHARING_PORT: 1084 + X_DOCKER_PARKING_PORT: 1085 + X_DOCKER_DRT_PORT: 1086 + X_DOCKER_ECHARGING_PORT: 1087 + X_DOCKER_TRAFFIC_PORT: 1088 + + X_JAVA_MX: "14G" + X_BUILD_GRAPH: "False" + X_DOWNLOAD_DATA: "False" + X_BACKUP_GRAPH: "False" + + X_OTP_RR_BRANCH: "mentor-meran" + X_OTP_UI_BRANCH: "master" + + X_API_HOST: ${{ env.API_HOST }} + X_API_PORT: ${{ env.API_PORT }} + X_API_PATH: ${{ env.API_PATH }} + + X_HERE_APPID: ${{ secrets.HERE_APPID_TEST }} + X_HERE_APPCODE: ${{ secrets.HERE_APPCODE_TEST }} + X_HERE_APIKEY: ${{ secrets.HERE_APIKEY_TEST }} + + X_GEOCODER_BASEURL: ${{ env.GEOCODER_BASEURL }} + X_PARKING_BASEURL: ${{ env.PARKING_BASEURL }} + X_DRT_BASEURL: ${{ env.DRT_BASEURL }} + X_CHARGER_BASEURL: ${{ env.CHARGER_BASEURL }} + X_CARSHARING_BASEURL: ${{ env.CARSHARING_BASEURL }} + X_TRAFFIC_BASEURL: ${{ env.TRAFFIC_BASEURL }} + + X_OTP_OFFICIAL: "False" + X_GBFS_VERSION: 1 + X_CARSHARING_HOST: "https://carsharing.otp.opendatahub.testingmachine.eu/" + X_PARKING_HOST: "https://parking.otp.opendatahub.testingmachine.eu/" + X_DRT_HOST: "https://drt.otp.opendatahub.testingmachine.eu/" + X_CHARGER_HOST: "https://charger.otp.opendatahub.testingmachine.eu/" + + X_GTFS_URL: "ftp://ftp.sta.bz.it/gtfs/google_transit_shp.zip" + X_GTFS_URL_UPDATETIME: "0 2 * * *" + X_GTFS_WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_WORKFLOW_ACCESS_TOKEN }} + X_GTFS_WORKFLOW_DISPATCH_URL: "https://api.github.com/repos/noi-techpark/odh-mentor-otp/actions/workflows/run_calculate.yml/dispatches" + X_GTFS_WORKFLOW_BRANCH: ${{ github.ref }} + + X_GTFS_RT_URL: "https://efa.sta.bz.it/gtfs-r/" + X_GTFS_FEED_ID: 1 + + # disable in test + # X_MATOMO_BASE_URL: ${{ env.MATOMO_BASE_URL }} + # X_MATOMO_SITE_ID: ${{ env.MATOMO_SITE_ID }} + + - name: use mobility.api.opendatahub.testingmachine.eu for testing + run: sed -i 's/mobility.api.opendatahub.com/mobility.api.opendatahub.testingmachine.eu/' */config.yml + + - name: Build graph + run: sh build-graph.sh + + - name: Build and push + uses: noi-techpark/github-actions/docker-build-and-push@v2 + with: + docker-username: ${{ github.actor }} + docker-password: ${{ secrets.GITHUB_TOKEN }} + docker-compose-file: docker-compose.build.execute.yml + + - name: Deploy application + uses: noi-techpark/github-actions/docker-deploy@v2 + with: + hosts: 'test' + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + docker-username: 'noi-techpark-bot' + docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + project-name: ${{ env.PROJECT_NAME }} + playbook-file: deploy.execute.yml + + execute-prod: + runs-on: ubuntu-22.04 + needs: test + concurrency: deploy-prod + env: + API_HOST: "https://otp.opendatahub.com" + API_PORT: "443" + API_PATH: "/otp/routers/openmove" + GEOCODER_BASEURL: "https://geocoder.otp.opendatahub.com" + PARKING_BASEURL: "https://parking.otp.opendatahub.com" + DRT_BASEURL: "https://drt.otp.opendatahub.com" + CHARGER_BASEURL: "https://charger.otp.opendatahub.com" + CARSHARING_BASEURL: "https://carsharing.otp.opendatahub.com" + TRAFFIC_BASEURL: "https://traffic.otp.opendatahub.com" + MATOMO_BASE_URL: "https://digital.matomo.cloud/" + MATOMO_SITE_ID: 20 + + steps: + - name: Checkout source code + uses: actions/checkout@v2 + + - name: Create .env file + uses: noi-techpark/github-actions/env-file@v2 + env: + X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} + X_DOCKER_IMAGE_OTP: ${{ env.DOCKER_IMAGE_OTP }} + X_DOCKER_IMAGE_JOURNEY: ${{ env.DOCKER_IMAGE_JOURNEY }} + X_DOCKER_IMAGE_GBFS: ${{ env.DOCKER_IMAGE_GBFS }} + X_DOCKER_IMAGE_GEOCODER: ${{ env.DOCKER_IMAGE_GEOCODER }} + X_DOCKER_IMAGE_CARSHARING: ${{ env.DOCKER_IMAGE_CARSHARING }} + X_DOCKER_IMAGE_PARKING: ${{ env.DOCKER_IMAGE_PARKING }} + X_DOCKER_IMAGE_ECHARGING: ${{ env.DOCKER_IMAGE_ECHARGING }} + X_DOCKER_IMAGE_DRT: ${{ env.DOCKER_IMAGE_DRT }} + X_DOCKER_IMAGE_TRAFFIC: ${{ env.DOCKER_IMAGE_TRAFFIC }} + X_DOCKER_TAG: ${{ env.DOCKER_TAG }} + + X_EFS_FOLDER: "/opt/odh-mentor-otp-prod/" + + X_SERVER_PORT_OTP: 1080 + X_SERVER_PORT_JOURNEY: 1081 + X_GBFS_HOST : "https://gbfs.otp.opendatahub.com/" + X_DOCKER_GBFS_PORT: 1082 + X_DOCKER_GEOCODER_PORT: 1083 + X_DOCKER_CARSHARING_PORT: 1084 + X_DOCKER_PARKING_PORT: 1085 + X_DOCKER_DRT_PORT: 1086 + X_DOCKER_ECHARGING_PORT: 1087 + X_DOCKER_TRAFFIC_PORT: 1088 + + X_JAVA_MX: "16G" + X_BUILD_GRAPH: "False" + X_DOWNLOAD_DATA: "False" + X_BACKUP_GRAPH: "False" + + X_OTP_RR_BRANCH: "mentor-meran" + X_OTP_UI_BRANCH: "master" + + X_API_HOST: ${{ env.API_HOST }} + X_API_PORT: ${{ env.API_PORT }} + X_API_PATH: ${{ env.API_PATH }} + + X_HERE_APPID: ${{ secrets.HERE_APPID_TEST }} + X_HERE_APPCODE: ${{ secrets.HERE_APPCODE_TEST }} + X_HERE_APIKEY: ${{ secrets.HERE_APIKEY_TEST }} + + X_GEOCODER_BASEURL: ${{ env.GEOCODER_BASEURL }} + X_PARKING_BASEURL: ${{ env.PARKING_BASEURL }} + X_DRT_BASEURL: ${{ env.DRT_BASEURL }} + X_CHARGER_BASEURL: ${{ env.CHARGER_BASEURL }} + X_CARSHARING_BASEURL: ${{ env.CARSHARING_BASEURL }} + X_TRAFFIC_BASEURL: ${{ env.TRAFFIC_BASEURL }} + + X_OTP_OFFICIAL: "False" + X_GBFS_VERSION: 1 + X_CARSHARING_HOST: "https://carsharing.otp.opendatahub.com/" + X_PARKING_HOST: "https://parking.otp.opendatahub.com/" + X_DRT_HOST: "https://drt.otp.opendatahub.com/" + X_CHARGER_HOST: "https://charger.otp.opendatahub.com/" + + X_GTFS_URL: "ftp://ftp.sta.bz.it/gtfs/google_transit_shp.zip" + X_GTFS_URL_UPDATETIME: "0 4 * * *" + X_GTFS_WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_WORKFLOW_ACCESS_TOKEN }} + X_GTFS_WORKFLOW_DISPATCH_URL: "https://api.github.com/repos/noi-techpark/odh-mentor-otp/actions/workflows/run_calculate.yml/dispatches" + X_GTFS_WORKFLOW_BRANCH: ${{ github.ref }} + + X_GTFS_RT_URL: "https://efa.sta.bz.it/gtfs-r/" + X_GTFS_FEED_ID: 1 + + X_MATOMO_BASE_URL: "https://digital.matomo.cloud/" + X_MATOMO_SITE_ID: 20 + + - name: Build graph + run: sh build-graph.sh + + - name: Build and push + uses: noi-techpark/github-actions/docker-build-and-push@v2 + with: + docker-username: ${{ github.actor }} + docker-password: ${{ secrets.GITHUB_TOKEN }} + docker-compose-file: docker-compose.build.execute.yml + + - name: Deploy application + uses: noi-techpark/github-actions/docker-deploy@v2 + with: + hosts: 'prod' + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + docker-username: 'noi-techpark-bot' + docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + project-name: ${{ env.PROJECT_NAME }} + playbook-file: deploy.execute.yml From 0fce413c5e43de54486910bd6fd6aeb09b0a4e45 Mon Sep 17 00:00:00 2001 From: Simon Dalvai Date: Thu, 29 Feb 2024 10:47:08 +0100 Subject: [PATCH 2/2] ci/cd: disable niglhty pord build for now --- .github/workflows/execute.yml | 248 ---------------------------------- .github/workflows/nightly.yml | 218 +++++++++++++++--------------- 2 files changed, 109 insertions(+), 357 deletions(-) delete mode 100644 .github/workflows/execute.yml diff --git a/.github/workflows/execute.yml b/.github/workflows/execute.yml deleted file mode 100644 index b650a8a0..00000000 --- a/.github/workflows/execute.yml +++ /dev/null @@ -1,248 +0,0 @@ -name: CI/CD - -on: - push: - workflow_dispatch: - -env: - PROJECT_NAME: "odh-mentor-otp" - API_HOST: http://localhost - API_PATH: /otp/routers/openmove - API_PORT: 8080 - DOCKER_IMAGE_OTP: ghcr.io/${{ github.repository }}/odh-mentor-otp - DOCKER_IMAGE_JOURNEY: ghcr.io/${{ github.repository }}/odh-mentor-otp-journey - DOCKER_IMAGE_GBFS: ghcr.io/${{ github.repository }}/odh-mentor-otp-gbfs - DOCKER_IMAGE_GEOCODER: ghcr.io/${{ github.repository }}/odh-mentor-otp-geocoder - DOCKER_IMAGE_CARSHARING: ghcr.io/${{ github.repository }}/odh-mentor-otp-carsharing - DOCKER_IMAGE_PARKING: ghcr.io/${{ github.repository }}/odh-mentor-otp-parking - DOCKER_IMAGE_ECHARGING: ghcr.io/${{ github.repository }}/odh-mentor-otp-echarging - DOCKER_IMAGE_DRT: ghcr.io/${{ github.repository }}/odh-mentor-otp-drt - DOCKER_IMAGE_TRAFFIC: ghcr.io/${{ github.repository }}/odh-mentor-otp-traffic - DOCKER_TAG: ${{ github.sha }} - -jobs: - execute-test: - runs-on: ubuntu-20.04 - if: github.ref == 'refs/heads/main' - concurrency: deploy-test - env: - API_HOST: "https://otp.opendatahub.testingmachine.eu" - API_PORT: "443" - API_PATH: "/otp/routers/openmove" - GEOCODER_BASEURL: "https://geocoder.otp.opendatahub.testingmachine.eu" - PARKING_BASEURL: "https://parking.otp.opendatahub.testingmachine.eu" - DRT_BASEURL: "https://drt.otp.opendatahub.testingmachine.eu" - CHARGER_BASEURL: "https://charger.otp.opendatahub.testingmachine.eu" - CARSHARING_BASEURL: "https://carsharing.otp.opendatahub.testingmachine.eu" - TRAFFIC_BASEURL: "https://traffic.otp.opendatahub.testingmachine.eu" - MATOMO_BASE_URL: "https://digital.matomo.cloud/" - MATOMO_SITE_ID: 20 - - steps: - - name: Checkout source code - uses: actions/checkout@v2 - - - name: Create .env file - uses: noi-techpark/github-actions/env-file@v2 - env: - X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} - X_DOCKER_IMAGE_OTP: ${{ env.DOCKER_IMAGE_OTP }} - X_DOCKER_IMAGE_JOURNEY: ${{ env.DOCKER_IMAGE_JOURNEY }} - X_DOCKER_IMAGE_GBFS: ${{ env.DOCKER_IMAGE_GBFS }} - X_DOCKER_IMAGE_GEOCODER: ${{ env.DOCKER_IMAGE_GEOCODER }} - X_DOCKER_IMAGE_CARSHARING: ${{ env.DOCKER_IMAGE_CARSHARING }} - X_DOCKER_IMAGE_PARKING: ${{ env.DOCKER_IMAGE_PARKING }} - X_DOCKER_IMAGE_ECHARGING: ${{ env.DOCKER_IMAGE_ECHARGING }} - X_DOCKER_IMAGE_DRT: ${{ env.DOCKER_IMAGE_DRT }} - X_DOCKER_IMAGE_TRAFFIC: ${{ env.DOCKER_IMAGE_TRAFFIC }} - X_DOCKER_TAG: ${{ env.DOCKER_TAG }} - - X_EFS_FOLDER: "/opt/odh-mentor-otp-test/" - - X_SERVER_PORT_OTP: 1080 - X_SERVER_PORT_JOURNEY: 1081 - X_GBFS_HOST : "https://gbfs.otp.opendatahub.testingmachine.eu/" - X_DOCKER_GBFS_PORT: 1082 - X_DOCKER_GEOCODER_PORT: 1083 - X_DOCKER_CARSHARING_PORT: 1084 - X_DOCKER_PARKING_PORT: 1085 - X_DOCKER_DRT_PORT: 1086 - X_DOCKER_ECHARGING_PORT: 1087 - X_DOCKER_TRAFFIC_PORT: 1088 - - X_JAVA_MX: "14G" - X_BUILD_GRAPH: "False" - X_DOWNLOAD_DATA: "False" - X_BACKUP_GRAPH: "False" - - X_OTP_RR_BRANCH: "mentor-meran" - X_OTP_UI_BRANCH: "master" - - X_API_HOST: ${{ env.API_HOST }} - X_API_PORT: ${{ env.API_PORT }} - X_API_PATH: ${{ env.API_PATH }} - - X_HERE_APPID: ${{ secrets.HERE_APPID_TEST }} - X_HERE_APPCODE: ${{ secrets.HERE_APPCODE_TEST }} - X_HERE_APIKEY: ${{ secrets.HERE_APIKEY_TEST }} - - X_GEOCODER_BASEURL: ${{ env.GEOCODER_BASEURL }} - X_PARKING_BASEURL: ${{ env.PARKING_BASEURL }} - X_DRT_BASEURL: ${{ env.DRT_BASEURL }} - X_CHARGER_BASEURL: ${{ env.CHARGER_BASEURL }} - X_CARSHARING_BASEURL: ${{ env.CARSHARING_BASEURL }} - X_TRAFFIC_BASEURL: ${{ env.TRAFFIC_BASEURL }} - - X_OTP_OFFICIAL: "False" - X_GBFS_VERSION: 1 - X_CARSHARING_HOST: "https://carsharing.otp.opendatahub.testingmachine.eu/" - X_PARKING_HOST: "https://parking.otp.opendatahub.testingmachine.eu/" - X_DRT_HOST: "https://drt.otp.opendatahub.testingmachine.eu/" - X_CHARGER_HOST: "https://charger.otp.opendatahub.testingmachine.eu/" - - X_GTFS_URL: "ftp://ftp.sta.bz.it/gtfs/google_transit_shp.zip" - X_GTFS_URL_UPDATETIME: "0 2 * * *" - X_GTFS_WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_WORKFLOW_ACCESS_TOKEN }} - X_GTFS_WORKFLOW_DISPATCH_URL: "https://api.github.com/repos/noi-techpark/odh-mentor-otp/actions/workflows/run_calculate.yml/dispatches" - X_GTFS_WORKFLOW_BRANCH: ${{ github.ref }} - - X_GTFS_RT_URL: "https://efa.sta.bz.it/gtfs-r/" - X_GTFS_FEED_ID: 1 - - # disable in test - # X_MATOMO_BASE_URL: ${{ env.MATOMO_BASE_URL }} - # X_MATOMO_SITE_ID: ${{ env.MATOMO_SITE_ID }} - - - name: use mobility.api.opendatahub.testingmachine.eu for testing - run: sed -i 's/mobility.api.opendatahub.com/mobility.api.opendatahub.testingmachine.eu/' */config.yml - - - name: Build graph - run: sh build-graph.sh - - - name: Build and push - uses: noi-techpark/github-actions/docker-build-and-push@v2 - with: - docker-username: ${{ github.actor }} - docker-password: ${{ secrets.GITHUB_TOKEN }} - docker-compose-file: docker-compose.build.execute.yml - - - name: Deploy application - uses: noi-techpark/github-actions/docker-deploy@v2 - with: - hosts: 'test' - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - docker-username: 'noi-techpark-bot' - docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - project-name: ${{ env.PROJECT_NAME }} - playbook-file: deploy.execute.yml - - execute-prod: - runs-on: ubuntu-20.04 - if: github.ref == 'refs/heads/prod' - concurrency: deploy-prod - env: - API_HOST: "https://otp.opendatahub.com" - API_PORT: "443" - API_PATH: "/otp/routers/openmove" - GEOCODER_BASEURL: "https://geocoder.otp.opendatahub.com" - PARKING_BASEURL: "https://parking.otp.opendatahub.com" - DRT_BASEURL: "https://drt.otp.opendatahub.com" - CHARGER_BASEURL: "https://charger.otp.opendatahub.com" - CARSHARING_BASEURL: "https://carsharing.otp.opendatahub.com" - TRAFFIC_BASEURL: "https://traffic.otp.opendatahub.com" - MATOMO_BASE_URL: "https://digital.matomo.cloud/" - MATOMO_SITE_ID: 20 - - steps: - - name: Checkout source code - uses: actions/checkout@v2 - - - name: Create .env file - uses: noi-techpark/github-actions/env-file@v2 - env: - X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} - X_DOCKER_IMAGE_OTP: ${{ env.DOCKER_IMAGE_OTP }} - X_DOCKER_IMAGE_JOURNEY: ${{ env.DOCKER_IMAGE_JOURNEY }} - X_DOCKER_IMAGE_GBFS: ${{ env.DOCKER_IMAGE_GBFS }} - X_DOCKER_IMAGE_GEOCODER: ${{ env.DOCKER_IMAGE_GEOCODER }} - X_DOCKER_IMAGE_CARSHARING: ${{ env.DOCKER_IMAGE_CARSHARING }} - X_DOCKER_IMAGE_PARKING: ${{ env.DOCKER_IMAGE_PARKING }} - X_DOCKER_IMAGE_ECHARGING: ${{ env.DOCKER_IMAGE_ECHARGING }} - X_DOCKER_IMAGE_DRT: ${{ env.DOCKER_IMAGE_DRT }} - X_DOCKER_IMAGE_TRAFFIC: ${{ env.DOCKER_IMAGE_TRAFFIC }} - X_DOCKER_TAG: ${{ env.DOCKER_TAG }} - - X_EFS_FOLDER: "/opt/odh-mentor-otp-prod/" - - X_SERVER_PORT_OTP: 1080 - X_SERVER_PORT_JOURNEY: 1081 - X_GBFS_HOST : "https://gbfs.otp.opendatahub.com/" - X_DOCKER_GBFS_PORT: 1082 - X_DOCKER_GEOCODER_PORT: 1083 - X_DOCKER_CARSHARING_PORT: 1084 - X_DOCKER_PARKING_PORT: 1085 - X_DOCKER_DRT_PORT: 1086 - X_DOCKER_ECHARGING_PORT: 1087 - X_DOCKER_TRAFFIC_PORT: 1088 - - X_JAVA_MX: "16G" - X_BUILD_GRAPH: "False" - X_DOWNLOAD_DATA: "False" - X_BACKUP_GRAPH: "False" - - X_OTP_RR_BRANCH: "mentor-meran" - X_OTP_UI_BRANCH: "master" - - X_API_HOST: ${{ env.API_HOST }} - X_API_PORT: ${{ env.API_PORT }} - X_API_PATH: ${{ env.API_PATH }} - - X_HERE_APPID: ${{ secrets.HERE_APPID_TEST }} - X_HERE_APPCODE: ${{ secrets.HERE_APPCODE_TEST }} - X_HERE_APIKEY: ${{ secrets.HERE_APIKEY_TEST }} - - X_GEOCODER_BASEURL: ${{ env.GEOCODER_BASEURL }} - X_PARKING_BASEURL: ${{ env.PARKING_BASEURL }} - X_DRT_BASEURL: ${{ env.DRT_BASEURL }} - X_CHARGER_BASEURL: ${{ env.CHARGER_BASEURL }} - X_CARSHARING_BASEURL: ${{ env.CARSHARING_BASEURL }} - X_TRAFFIC_BASEURL: ${{ env.TRAFFIC_BASEURL }} - - X_OTP_OFFICIAL: "False" - X_GBFS_VERSION: 1 - X_CARSHARING_HOST: "https://carsharing.otp.opendatahub.com/" - X_PARKING_HOST: "https://parking.otp.opendatahub.com/" - X_DRT_HOST: "https://drt.otp.opendatahub.com/" - X_CHARGER_HOST: "https://charger.otp.opendatahub.com/" - - X_GTFS_URL: "ftp://ftp.sta.bz.it/gtfs/google_transit_shp.zip" - X_GTFS_URL_UPDATETIME: "0 4 * * *" - X_GTFS_WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_WORKFLOW_ACCESS_TOKEN }} - X_GTFS_WORKFLOW_DISPATCH_URL: "https://api.github.com/repos/noi-techpark/odh-mentor-otp/actions/workflows/run_calculate.yml/dispatches" - X_GTFS_WORKFLOW_BRANCH: ${{ github.ref }} - - X_GTFS_RT_URL: "https://efa.sta.bz.it/gtfs-r/" - X_GTFS_FEED_ID: 1 - - X_MATOMO_BASE_URL: "https://digital.matomo.cloud/" - X_MATOMO_SITE_ID: 20 - - - name: Build graph - run: sh build-graph.sh - - - name: Build and push - uses: noi-techpark/github-actions/docker-build-and-push@v2 - with: - docker-username: ${{ github.actor }} - docker-password: ${{ secrets.GITHUB_TOKEN }} - docker-compose-file: docker-compose.build.execute.yml - - - name: Deploy application - uses: noi-techpark/github-actions/docker-deploy@v2 - with: - hosts: 'prod' - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - docker-username: 'noi-techpark-bot' - docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - project-name: ${{ env.PROJECT_NAME }} - playbook-file: deploy.execute.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 28cdeefb..4cc9c71b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,7 +2,7 @@ name: CI/CD nightly build on: push: - pull_request: + workflow_dispatch: schedule: # every night at 3am - cron: '0 3 * * *' @@ -155,113 +155,113 @@ jobs: project-name: ${{ env.PROJECT_NAME }} playbook-file: deploy.execute.yml - execute-prod: - runs-on: ubuntu-22.04 - needs: test - concurrency: deploy-prod - env: - API_HOST: "https://otp.opendatahub.com" - API_PORT: "443" - API_PATH: "/otp/routers/openmove" - GEOCODER_BASEURL: "https://geocoder.otp.opendatahub.com" - PARKING_BASEURL: "https://parking.otp.opendatahub.com" - DRT_BASEURL: "https://drt.otp.opendatahub.com" - CHARGER_BASEURL: "https://charger.otp.opendatahub.com" - CARSHARING_BASEURL: "https://carsharing.otp.opendatahub.com" - TRAFFIC_BASEURL: "https://traffic.otp.opendatahub.com" - MATOMO_BASE_URL: "https://digital.matomo.cloud/" - MATOMO_SITE_ID: 20 - - steps: - - name: Checkout source code - uses: actions/checkout@v2 - - - name: Create .env file - uses: noi-techpark/github-actions/env-file@v2 - env: - X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} - X_DOCKER_IMAGE_OTP: ${{ env.DOCKER_IMAGE_OTP }} - X_DOCKER_IMAGE_JOURNEY: ${{ env.DOCKER_IMAGE_JOURNEY }} - X_DOCKER_IMAGE_GBFS: ${{ env.DOCKER_IMAGE_GBFS }} - X_DOCKER_IMAGE_GEOCODER: ${{ env.DOCKER_IMAGE_GEOCODER }} - X_DOCKER_IMAGE_CARSHARING: ${{ env.DOCKER_IMAGE_CARSHARING }} - X_DOCKER_IMAGE_PARKING: ${{ env.DOCKER_IMAGE_PARKING }} - X_DOCKER_IMAGE_ECHARGING: ${{ env.DOCKER_IMAGE_ECHARGING }} - X_DOCKER_IMAGE_DRT: ${{ env.DOCKER_IMAGE_DRT }} - X_DOCKER_IMAGE_TRAFFIC: ${{ env.DOCKER_IMAGE_TRAFFIC }} - X_DOCKER_TAG: ${{ env.DOCKER_TAG }} + # execute-prod: + # runs-on: ubuntu-22.04 + # needs: test + # concurrency: deploy-prod + # env: + # API_HOST: "https://otp.opendatahub.com" + # API_PORT: "443" + # API_PATH: "/otp/routers/openmove" + # GEOCODER_BASEURL: "https://geocoder.otp.opendatahub.com" + # PARKING_BASEURL: "https://parking.otp.opendatahub.com" + # DRT_BASEURL: "https://drt.otp.opendatahub.com" + # CHARGER_BASEURL: "https://charger.otp.opendatahub.com" + # CARSHARING_BASEURL: "https://carsharing.otp.opendatahub.com" + # TRAFFIC_BASEURL: "https://traffic.otp.opendatahub.com" + # MATOMO_BASE_URL: "https://digital.matomo.cloud/" + # MATOMO_SITE_ID: 20 + + # steps: + # - name: Checkout source code + # uses: actions/checkout@v2 + + # - name: Create .env file + # uses: noi-techpark/github-actions/env-file@v2 + # env: + # X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }} + # X_DOCKER_IMAGE_OTP: ${{ env.DOCKER_IMAGE_OTP }} + # X_DOCKER_IMAGE_JOURNEY: ${{ env.DOCKER_IMAGE_JOURNEY }} + # X_DOCKER_IMAGE_GBFS: ${{ env.DOCKER_IMAGE_GBFS }} + # X_DOCKER_IMAGE_GEOCODER: ${{ env.DOCKER_IMAGE_GEOCODER }} + # X_DOCKER_IMAGE_CARSHARING: ${{ env.DOCKER_IMAGE_CARSHARING }} + # X_DOCKER_IMAGE_PARKING: ${{ env.DOCKER_IMAGE_PARKING }} + # X_DOCKER_IMAGE_ECHARGING: ${{ env.DOCKER_IMAGE_ECHARGING }} + # X_DOCKER_IMAGE_DRT: ${{ env.DOCKER_IMAGE_DRT }} + # X_DOCKER_IMAGE_TRAFFIC: ${{ env.DOCKER_IMAGE_TRAFFIC }} + # X_DOCKER_TAG: ${{ env.DOCKER_TAG }} - X_EFS_FOLDER: "/opt/odh-mentor-otp-prod/" - - X_SERVER_PORT_OTP: 1080 - X_SERVER_PORT_JOURNEY: 1081 - X_GBFS_HOST : "https://gbfs.otp.opendatahub.com/" - X_DOCKER_GBFS_PORT: 1082 - X_DOCKER_GEOCODER_PORT: 1083 - X_DOCKER_CARSHARING_PORT: 1084 - X_DOCKER_PARKING_PORT: 1085 - X_DOCKER_DRT_PORT: 1086 - X_DOCKER_ECHARGING_PORT: 1087 - X_DOCKER_TRAFFIC_PORT: 1088 - - X_JAVA_MX: "16G" - X_BUILD_GRAPH: "False" - X_DOWNLOAD_DATA: "False" - X_BACKUP_GRAPH: "False" - - X_OTP_RR_BRANCH: "mentor-meran" - X_OTP_UI_BRANCH: "master" - - X_API_HOST: ${{ env.API_HOST }} - X_API_PORT: ${{ env.API_PORT }} - X_API_PATH: ${{ env.API_PATH }} - - X_HERE_APPID: ${{ secrets.HERE_APPID_TEST }} - X_HERE_APPCODE: ${{ secrets.HERE_APPCODE_TEST }} - X_HERE_APIKEY: ${{ secrets.HERE_APIKEY_TEST }} - - X_GEOCODER_BASEURL: ${{ env.GEOCODER_BASEURL }} - X_PARKING_BASEURL: ${{ env.PARKING_BASEURL }} - X_DRT_BASEURL: ${{ env.DRT_BASEURL }} - X_CHARGER_BASEURL: ${{ env.CHARGER_BASEURL }} - X_CARSHARING_BASEURL: ${{ env.CARSHARING_BASEURL }} - X_TRAFFIC_BASEURL: ${{ env.TRAFFIC_BASEURL }} - - X_OTP_OFFICIAL: "False" - X_GBFS_VERSION: 1 - X_CARSHARING_HOST: "https://carsharing.otp.opendatahub.com/" - X_PARKING_HOST: "https://parking.otp.opendatahub.com/" - X_DRT_HOST: "https://drt.otp.opendatahub.com/" - X_CHARGER_HOST: "https://charger.otp.opendatahub.com/" - - X_GTFS_URL: "ftp://ftp.sta.bz.it/gtfs/google_transit_shp.zip" - X_GTFS_URL_UPDATETIME: "0 4 * * *" - X_GTFS_WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_WORKFLOW_ACCESS_TOKEN }} - X_GTFS_WORKFLOW_DISPATCH_URL: "https://api.github.com/repos/noi-techpark/odh-mentor-otp/actions/workflows/run_calculate.yml/dispatches" - X_GTFS_WORKFLOW_BRANCH: ${{ github.ref }} - - X_GTFS_RT_URL: "https://efa.sta.bz.it/gtfs-r/" - X_GTFS_FEED_ID: 1 + # X_EFS_FOLDER: "/opt/odh-mentor-otp-prod/" + + # X_SERVER_PORT_OTP: 1080 + # X_SERVER_PORT_JOURNEY: 1081 + # X_GBFS_HOST : "https://gbfs.otp.opendatahub.com/" + # X_DOCKER_GBFS_PORT: 1082 + # X_DOCKER_GEOCODER_PORT: 1083 + # X_DOCKER_CARSHARING_PORT: 1084 + # X_DOCKER_PARKING_PORT: 1085 + # X_DOCKER_DRT_PORT: 1086 + # X_DOCKER_ECHARGING_PORT: 1087 + # X_DOCKER_TRAFFIC_PORT: 1088 + + # X_JAVA_MX: "16G" + # X_BUILD_GRAPH: "False" + # X_DOWNLOAD_DATA: "False" + # X_BACKUP_GRAPH: "False" + + # X_OTP_RR_BRANCH: "mentor-meran" + # X_OTP_UI_BRANCH: "master" + + # X_API_HOST: ${{ env.API_HOST }} + # X_API_PORT: ${{ env.API_PORT }} + # X_API_PATH: ${{ env.API_PATH }} + + # X_HERE_APPID: ${{ secrets.HERE_APPID_TEST }} + # X_HERE_APPCODE: ${{ secrets.HERE_APPCODE_TEST }} + # X_HERE_APIKEY: ${{ secrets.HERE_APIKEY_TEST }} + + # X_GEOCODER_BASEURL: ${{ env.GEOCODER_BASEURL }} + # X_PARKING_BASEURL: ${{ env.PARKING_BASEURL }} + # X_DRT_BASEURL: ${{ env.DRT_BASEURL }} + # X_CHARGER_BASEURL: ${{ env.CHARGER_BASEURL }} + # X_CARSHARING_BASEURL: ${{ env.CARSHARING_BASEURL }} + # X_TRAFFIC_BASEURL: ${{ env.TRAFFIC_BASEURL }} + + # X_OTP_OFFICIAL: "False" + # X_GBFS_VERSION: 1 + # X_CARSHARING_HOST: "https://carsharing.otp.opendatahub.com/" + # X_PARKING_HOST: "https://parking.otp.opendatahub.com/" + # X_DRT_HOST: "https://drt.otp.opendatahub.com/" + # X_CHARGER_HOST: "https://charger.otp.opendatahub.com/" + + # X_GTFS_URL: "ftp://ftp.sta.bz.it/gtfs/google_transit_shp.zip" + # X_GTFS_URL_UPDATETIME: "0 4 * * *" + # X_GTFS_WORKFLOW_AUTH_TOKEN: ${{ secrets.GH_WORKFLOW_ACCESS_TOKEN }} + # X_GTFS_WORKFLOW_DISPATCH_URL: "https://api.github.com/repos/noi-techpark/odh-mentor-otp/actions/workflows/run_calculate.yml/dispatches" + # X_GTFS_WORKFLOW_BRANCH: ${{ github.ref }} + + # X_GTFS_RT_URL: "https://efa.sta.bz.it/gtfs-r/" + # X_GTFS_FEED_ID: 1 - X_MATOMO_BASE_URL: "https://digital.matomo.cloud/" - X_MATOMO_SITE_ID: 20 - - - name: Build graph - run: sh build-graph.sh - - - name: Build and push - uses: noi-techpark/github-actions/docker-build-and-push@v2 - with: - docker-username: ${{ github.actor }} - docker-password: ${{ secrets.GITHUB_TOKEN }} - docker-compose-file: docker-compose.build.execute.yml - - - name: Deploy application - uses: noi-techpark/github-actions/docker-deploy@v2 - with: - hosts: 'prod' - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - docker-username: 'noi-techpark-bot' - docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} - project-name: ${{ env.PROJECT_NAME }} - playbook-file: deploy.execute.yml + # X_MATOMO_BASE_URL: "https://digital.matomo.cloud/" + # X_MATOMO_SITE_ID: 20 + + # - name: Build graph + # run: sh build-graph.sh + + # - name: Build and push + # uses: noi-techpark/github-actions/docker-build-and-push@v2 + # with: + # docker-username: ${{ github.actor }} + # docker-password: ${{ secrets.GITHUB_TOKEN }} + # docker-compose-file: docker-compose.build.execute.yml + + # - name: Deploy application + # uses: noi-techpark/github-actions/docker-deploy@v2 + # with: + # hosts: 'prod' + # ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + # docker-username: 'noi-techpark-bot' + # docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} + # project-name: ${{ env.PROJECT_NAME }} + # playbook-file: deploy.execute.yml