Skip to content

Commit

Permalink
Merge branch 'development' of github.com:openforis/fra-platform into …
Browse files Browse the repository at this point in the history
…3855-move-files-to-s3-bucket
  • Loading branch information
sorja committed Jan 7, 2025
2 parents 9f98266 + 6ed3839 commit b7be87d
Show file tree
Hide file tree
Showing 3,171 changed files with 52,044 additions and 268,411 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ FRA_GOOGLE_CLIENT_SECRET=goggle-client-secret
FRA_GOOGLE_MAPS_API_KEY=google-maps-api-key

#FRA
FRA_ATLANTIS_ALLOWED='[{"assessmentName":"fra","cycleName":"2025"}]'
FRA_REPORT_COLLABORATORS_EXCLUDED=[]

# Local development mail server
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/heroku-db-backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Manual Database Backup

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to backup (production/development)'
required: true
default: 'production'
type: choice
options:
- production
- development

jobs:
backup:
runs-on: ubuntu-22.04

steps:
- name: Install Heroku CLI
run: curl https://cli-assets.heroku.com/install.sh | sh

- name: Create Heroku Postgres Backup
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
APP_NAME: ${{ github.event.inputs.environment == 'production' && secrets.HEROKU_APP_NAME_PRODUCTION || secrets.HEROKU_APP_NAME_DEVELOPMENT }}
run: |
heroku pg:backups:capture --app $APP_NAME
69 changes: 69 additions & 0 deletions .github/workflows/heroku-db-partial-backup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Manual Database Partial Backup

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to backup (production/development)'
required: true
default: 'production'
type: choice
options:
- production
- development
retention_days:
description: 'Number of days to retain backup'
required: true
default: '7'
type: number

jobs:
backup:
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install PostgreSQL client and GPG
run: |
sudo apt-get update
sudo apt-get install -y curl gnupg2
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /usr/share/keyrings/postgresql-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/postgresql-keyring.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/postgresql.list
sudo apt-get update
sudo apt-get install -y postgresql-client-15
- name: Verify PostgreSQL version
run: pg_dump --version

- name: Create Custom Database Backup
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_APP: ${{ github.event.inputs.environment == 'production' && secrets.HEROKU_APP_NAME_PRODUCTION || secrets.HEROKU_APP_NAME_DEVELOPMENT }}
BACKUP_DIR: ./backups
run: |
export PATH="/usr/lib/postgresql/15/bin:$PATH"
mkdir -p $BACKUP_DIR
./src/tools/heroku/partial-backup.sh
- name: Encrypt Backup
env:
BACKUP_DIR: ./backups
BACKUP_PASSPHRASE: ${{ secrets.BACKUP_PASSPHRASE }}
run: ./src/tools/heroku/encrypt.sh

- name: Upload encrypted backup artifact
uses: actions/upload-artifact@v3
with:
name: encrypted-database-backup-${{ github.event.inputs.environment }}-${{ github.run_id }}
path: ./backups/*.gpg
retention-days: ${{ github.event.inputs.retention_days }}

# always run to ensure no artifacts are left behind
- name: Cleanup
if: always()
run: |
rm -rf ./backups
# todo: post to slack channel
46 changes: 4 additions & 42 deletions .github/workflows/heroku-production.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,19 @@ on:

jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgis/postgis:12-3.0
env:
POSTGRES_USER: frap
POSTGRES_PASSWORD: frap
POSTGRES_DB: frap-dev
ports:
- 5442:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0' # fetch all tags, default 1

- name: Use Node.js 20.11.1
uses: actions/setup-node@v1
with:
node-version: '20.11.1'
always-auth: true
auth-token: ${{secrets.ACCESS_TOKEN}}
registry-url: 'https://npm.pkg.github.com'
scope: '@openforis'

- run: yarn install --network-timeout 1000000
env:
NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}

- run: yarn build
env:
PGHOST: localhost
PGPORT: 5442
PGDATABASE: frap-dev
PGUSER: frap
PGPASSWORD: frap
# - run: yarn test
# env:
# PGHOST: localhost
# PGPORT: 5442
# PGDATABASE: frap-dev
# PGUSER: frap
# PGPASSWORD: frap

- name: Get the version
- name: Set version
id: app_version
run: echo ::set-output name=APP_VERSION::$(git describe --always --tags)

- uses: akhileshns/[email protected] # This is the action
- name: Deploy to Heroku
uses: akhileshns/[email protected] # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP_NAME_PRODUCTION}}
Expand Down
46 changes: 4 additions & 42 deletions .github/workflows/heroku-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,19 @@ on:

jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgis/postgis:12-3.0
env:
POSTGRES_USER: frap
POSTGRES_PASSWORD: frap
POSTGRES_DB: frap-dev
ports:
- 5442:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0' # fetch all tags, default 1

- name: Use Node.js 20.11.1
uses: actions/setup-node@v1
with:
node-version: '20.11.1'
always-auth: true
auth-token: ${{secrets.ACCESS_TOKEN}}
registry-url: 'https://npm.pkg.github.com'
scope: '@openforis'

- run: yarn install --network-timeout 1000000
env:
NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}

- run: yarn build
env:
PGHOST: localhost
PGPORT: 5442
PGDATABASE: frap-dev
PGUSER: frap
PGPASSWORD: frap
# - run: yarn test
# env:
# PGHOST: localhost
# PGPORT: 5442
# PGDATABASE: frap-dev
# PGUSER: frap
# PGPASSWORD: frap

- name: Get the version
- name: Set version
id: app_version
run: echo ::set-output name=APP_VERSION::$(git describe --always --tags)

- uses: akhileshns/[email protected] # This is the action
- name: Deploy to Heroku
uses: akhileshns/[email protected] # This is the action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP_NAME_DEVELOPMENT}}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- run: yarn migrations:run
- run: yarn migration-public:run
env:
PGHOST: localhost
PGPORT: 5442
Expand All @@ -64,6 +64,7 @@ jobs:
PGPASSWORD: frap
- run: yarn build
env:
CI: true
PGHOST: localhost
PGPORT: 5442
PGDATABASE: frap-dev
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/translations-download-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: New Crowdin translations PR

on:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Synchronize with Crowdin
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
download_translations: true
# Export options
export_only_approved: true

localization_branch_name: i18n_crowdin_translations
create_pull_request: true
pull_request_title: "New Crowdin translations"
pull_request_body: "New Crowdin pull request with translations"
pull_request_base_branch_name: "development"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/translations-upload-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Upload translation sources

on:
push:
paths: ["src/i18n/resources/en/**/*.json", "!src/i18n/resources/en/panEuropean/**"]
branches: [development]

jobs:
crowdin-upload-sources:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Crowdin push
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: false
download_translations: false
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
19 changes: 12 additions & 7 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
pull_request_rules:
- name: Automatic merge using squash
conditions:
queue_rules:
- name: default
queue_conditions:
- "#approved-reviews-by>=1"
actions:
queue:
method: squash
merge_conditions: []
merge_method: squash

pull_request_rules:
- name: Automatic branch update
conditions:
- -conflict # skip PRs with conflicts
Expand All @@ -17,5 +18,9 @@ pull_request_rules:
conditions:
- merged
actions:
delete_head_branch:
delete_head_branch:
force: true
- name: Automatic merge using squash
conditions: []
actions:
queue:
16 changes: 16 additions & 0 deletions .run/db_backup-import.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="db:backup-import" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="(cd src/tools/db/importBackup &amp;&amp; ./exec.sh) &amp;&amp; ts-node src/tools/generateCache/index.ts" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
33 changes: 0 additions & 33 deletions .src.legacy/_legacy_server/api/assessment/createEmail.ts

This file was deleted.

Loading

0 comments on commit b7be87d

Please sign in to comment.