* Update pt.json - Brazilian Portuguese translations (#752)

* Update pt.json

Update Brazilian Portuguese translations:
- Updated Modules
- Engineering & Experimental Effect
- Corrections

* Update Portuguese Brazilian

Fixed Tab/Spaces indentation

* Updated PT-BR translation with Planetary Approach Suite

* Adds valid module checking to all types of modules on import

* Adds the Advanced MC's, AX MC's, AX MR's and Nanite Torpedo

* Changes as per comments on the PR

* Fix changed files issue (#3)

* Copied de.js contents to new file de-fix.js

* Copied de.js contents back from de-fix.js

* Copied contents of ko.js to ko-fix.js

* Copied ko.js contents back from ko-fix.js

* Copied contents from BlueprintFunctions.js to BlueprintFunctions-fix.js

* Copied contents back from BlueprintFunctions-fix.js to BlueprintFunctions.js

* Copied contents of LineChart.jsx to LineChart-fix.jsx

* Copied contents back from LineChart-fix.jsx to LineChart.jsx

* Copied contents of PieChart.jsx to PieChart-fix.jsx

* Copied contents back from PieChart-fix.jsx to PieChart.jsx

* Copied contents from Slider.jsx to Slider-fix.jsx

* Copied contents back from Slider-fix.jsx to Slider.jsx

* Copied contents from VerticalBarChart.jsx to VerticalBarChart-fix.jsx

* Copied contents back from VerticalBarChart-fix.jsx to VerticalBarChart.jsx

* Deleting 'fix' files

* Adding workflow for autodeploy

* Improving workflow

* Changed deployment ordering

* Changing to clone single branch for deployment, not the whole repo

* Adds the Advanced MC's, AX MC's, AX MR's and Nanite Torpedo (#4)

* Issue 754 imports need to be more graceful (#5)

* Adds valid module checking to all types of modules on import

* Changes as per comments on the PR

* Added 'special' field to certain modules to allow for clearer appearance in search results that they are the special type of module. Updated English descriptions of Advanced Modules and Special Modules

* Update PT-BR translations

Added translated strings for coriolis-data PRs 106 & 107

* Fixed 'Missing Module' category showing up in Optional Selection drop-down and fixed 'Missing Power Plant', 'Missing Power Distributor' and 'Missing Frameshift Drive' showing up in the Selection drop-downs for those module slots.

* Fixing bug introduced by the previous PR for ISSUE_764. The previous fix introduced a bug which caused Armour Selection to error, due to Armour modules being completely different to other modules of any other type

* Modified export to EDOMH/EDEngineer page to be less 'bodged', allow EDOMH button to be clickable without checking for EDEngineer API (If they have EDOMH, they probably don't have EDEngineer...) and added a workaround for Coriolis sending bogus data for bulkheads.

* Fixed autodeploy to do latest coriolis-data dist. Fixed sendToEDOMH function to only send the blueprint at the selected grade, not each grade up to that grade.

* Issue 703 edomh integration (#7)

* Adds valid module checking to all types of modules on import

* Adds the Advanced MC's, AX MC's, AX MR's and Nanite Torpedo

* Changes as per comments on the PR

* Modified export to EDOMH/EDEngineer page to be less 'bodged', allow EDOMH button to be clickable without checking for EDEngineer API (If they have EDOMH, they probably don't have EDEngineer...) and added a workaround for Coriolis sending bogus data for bulkheads.

---------

Co-authored-by: David Sangrey <davidsangrey@gmail.com>
Co-authored-by: Felix Linker <linkerfelix@gmail.com>

* Fixed miscalculation of mats and got rid of unhelpful 'rolls' table, as the mats are calculated for the whole build and some blueprints may not be all the way up to g5.

* Removed console.log lines which were only needed for testing.

* Adding in buildname to EDOMH Export

* Issue 703 edomh integration (#8)

* Adds valid module checking to all types of modules on import

* Adds the Advanced MC's, AX MC's, AX MR's and Nanite Torpedo

* Changes as per comments on the PR

* Modified export to EDOMH/EDEngineer page to be less 'bodged', allow EDOMH button to be clickable without checking for EDEngineer API (If they have EDOMH, they probably don't have EDEngineer...) and added a workaround for Coriolis sending bogus data for bulkheads.

* Fixed autodeploy to do latest coriolis-data dist. Fixed sendToEDOMH function to only send the blueprint at the selected grade, not each grade up to that grade.

---------

Co-authored-by: David Sangrey <davidsangrey@gmail.com>
Co-authored-by: Felix Linker <linkerfelix@gmail.com>

* Issue 703 edomh integration (#9)

* Adds valid module checking to all types of modules on import

* Adds the Advanced MC's, AX MC's, AX MR's and Nanite Torpedo

* Changes as per comments on the PR

* Modified export to EDOMH/EDEngineer page to be less 'bodged', allow EDOMH button to be clickable without checking for EDEngineer API (If they have EDOMH, they probably don't have EDEngineer...) and added a workaround for Coriolis sending bogus data for bulkheads.

* Fixed autodeploy to do latest coriolis-data dist. Fixed sendToEDOMH function to only send the blueprint at the selected grade, not each grade up to that grade.

* Fixed miscalculation of mats and got rid of unhelpful 'rolls' table, as the mats are calculated for the whole build and some blueprints may not be all the way up to g5.

---------

Co-authored-by: David Sangrey <davidsangrey@gmail.com>
Co-authored-by: Felix Linker <linkerfelix@gmail.com>

* Issue 703 edomh integration (#10)

* Adds valid module checking to all types of modules on import

* Adds the Advanced MC's, AX MC's, AX MR's and Nanite Torpedo

* Changes as per comments on the PR

* Modified export to EDOMH/EDEngineer page to be less 'bodged', allow EDOMH button to be clickable without checking for EDEngineer API (If they have EDOMH, they probably don't have EDEngineer...) and added a workaround for Coriolis sending bogus data for bulkheads.

* Fixed autodeploy to do latest coriolis-data dist. Fixed sendToEDOMH function to only send the blueprint at the selected grade, not each grade up to that grade.

* Fixed miscalculation of mats and got rid of unhelpful 'rolls' table, as the mats are calculated for the whole build and some blueprints may not be all the way up to g5.

* Removed console.log lines which were only needed for testing.

---------

Co-authored-by: David Sangrey <davidsangrey@gmail.com>
Co-authored-by: Felix Linker <linkerfelix@gmail.com>

* Issue 764 unknown modules are selectable (#11)

* Adds valid module checking to all types of modules on import

* Adds the Advanced MC's, AX MC's, AX MR's and Nanite Torpedo

* Changes as per comments on the PR

* Fixed 'Missing Module' category showing up in Optional Selection drop-down and fixed 'Missing Power Plant', 'Missing Power Distributor' and 'Missing Frameshift Drive' showing up in the Selection drop-downs for those module slots.

---------

Co-authored-by: David Sangrey <davidsangrey@gmail.com>
Co-authored-by: Felix Linker <linkerfelix@gmail.com>

* Adding tag to manual dispatch of workflow

* Adding fix for broken Armour Module Selection

* Fixed issue with special blueprint item not being correctly jsonified for export to EDOMH

* Removing Autodeploy from this branch, it was merged in by github

* Removing debugging console.log entries that are no longer needed for EDOMH fix

* Adding autodeploy for new 'beta' branch

* Fixing directory for beta deployment

* Updating beta autodeploy with nvm info

* Making autodeploy aware of its target branch name (#16)

* Fixes for autodeploy (#17)

* Autodeploy fixes (#18)

* Fixes for autodeploy

* Adding npm start command to build dist from coriolis-data

* Removing unneccessary output lines from autodeploy (#19)

* Adding missing Constants for Advanced and Enhanced Weaponry (#20)

* Setting up definitive workflows, automatic for when coriolis is being updated, either on its own, or along with coriolis-data and manual, for when we've updated coriolis-data and need to re-deploy.

* Compartmentalising the build stages in the workflows.

* Fixed deployment steps

* deployment fix

* Deployment improvements and potential webpack fix

* Removing webpack change that made no difference.

* Changing deployment workflows to clear out old build before copying new build to web directory

* Supressing npm warnings in build process to avoid failure of the pipeline erroneously.

* Shifting node build to separate runner

* Fixing syntax in autodeploy

* issues with zipping

* Adding GCP Auth to download job

* Fixing unzipping process

* fixes for autodeploy

* zip path issues

* zip path

* rm command

---------

Co-authored-by: leonardofelin <33718368+leonardofelin@users.noreply.github.com>
Co-authored-by: David Sangrey <davidsangrey@gmail.com>
Co-authored-by: Felix Linker <linkerfelix@gmail.com>
This commit is contained in:
Alex Williams
2024-06-22 16:45:12 +01:00
committed by GitHub
parent 43b4eaa866
commit bc1e332820
3 changed files with 113 additions and 14 deletions

View File

@@ -4,7 +4,6 @@ name: Auto-Deploy 'beta/live' Branch to beta.coliolis.io or coriolis.io
# Controls when the action will run. Workflow runs when the alpha branch receives a push event
on:
workflow_dispatch:
push:
branches:
- beta
@@ -12,23 +11,76 @@ on:
# Figure out the target branch name
env:
BRANCH_NAME: ${{ github.base_ref || github.ref_name }}
TARGET_ZIP: build.zip
BUCKET_FOLDER: build
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
downloadcode:
runs-on: self-hosted
build:
runs-on: builder
steps:
- shell: bash
- name: Download the code
shell: bash
run: |
rm -Rf ./coriolis
rm -Rf ./coriolis-data
git clone https://github.com/Brighter-Applications/coriolis.git --single-branch --branch ${BRANCH_NAME}
git clone https://github.com/Brighter-Applications/coriolis-data.git --single-branch --branch ${BRANCH_NAME}
cd coriolis-data
- name: Build the code
shell: bash
run: |
cd ./coriolis-data
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
npm install
npm install 2>&1
npm start
cd ../coriolis
npm install
npm run build
if [ ${BRANCH_NAME} == "beta" ]; then sudo -u www-data cp -r ./build/* /var/www/beta.coriolis.io/; else sudo -u www-data cp -r ./build/* /var/www/coriolis.io/; fi
npm install 2>&1
npm run build 2>&1
- name: Zip the code
shell: bash
run: |
zip -r ./${TARGET_ZIP} ./coriolis/build/*
- name: Authorize GCP
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.CORIOLIS_GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
version: '>=363.0.0'
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Upload to Google Cloud Storage
run: |-
TARGET_ZIP=${{ env.TARGET_ZIP }}
BUCKET_PATH=${{ secrets.CORIOLIS_GCP_TARGET_BUCKET }}/${{ env.BUCKET_FOLDER }}
EXTENSION="${TARGET_ZIP##*.}"
FILENAME="${TARGET_ZIP%.*}"
LATEST_FILENAME="${FILENAME}_latest.${EXTENSION}"
gsutil cp ./$TARGET_ZIP gs://${BUCKET_PATH}/${LATEST_FILENAME}
deploy:
runs-on: webapp
needs: build
steps:
- name: Authorize GCP
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.CORIOLIS_GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
version: '>=363.0.0'
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Download and unzip the build
shell: bash
run: |
rm -Rf ./*
EXTENSION="${TARGET_ZIP##*.}"
FILENAME="${TARGET_ZIP%.*}"
LATEST_FILENAME="${FILENAME}_latest.${EXTENSION}"
gsutil cp gs://${{ secrets.CORIOLIS_GCP_TARGET_BUCKET }}/${{ env.BUCKET_FOLDER }}/${LATEST_FILENAME} ${LATEST_FILENAME}
unzip ./${LATEST_FILENAME}
- name: Move the build to the web server
shell: bash
run: |
if [ ${{ env.BRANCH_NAME }} == "beta" ]; then sudo -u www-data cp -r ./coriolis/build/* /var/www/beta.coriolis.io/; else sudo -u www-data cp -r ./coriolis/build/* /var/www/coriolis.io/; fi

46
.github/workflows/manualdeploy.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
# This is a basic manual deployment workflow triggered by pushes to the beta and live branches.
name: Manual-Deploy 'beta/live' Branch to beta.coliolis.io or coriolis.io
# Controls when the action will run. Workflow runs when the alpha branch receives a push event
on:
workflow_dispatch:
# Get the target branch name
inputs:
branch:
type: choice
description: 'Branch Name'
required: true
default: 'beta'
# Only allow beta or live branches
options:
- beta
- live
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Download the code
shell: bash
run: |
rm -Rf ./coriolis
rm -Rf ./coriolis-data
git clone https://github.com/Brighter-Applications/coriolis.git --single-branch --branch ${{ github.events.inputs.branch }}
git clone https://github.com/Brighter-Applications/coriolis-data.git --single-branch --branch ${{ github.events.inputs.branch }}
- name: Build the code
shell: bash
run: |
cd coriolis-data
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
npm install 2>&1
npm start
cd ../coriolis
npm install 2>&1
npm run build 2>&1
- name: Deploy the code
shell: bash
run: |
cd ../coriolis
if [ ${{ github.events.inputs.branch }} == "beta" ]; then sudo rm -Rf /var/www/beta.coriolis.io/* && sudo -u www-data cp -r ./build/* /var/www/beta.coriolis.io/; else sudo rm -Rf /var/www/coriolis.io/* && sudo -u www-data cp -r ./build/* /var/www/coriolis.io/; fi

View File

@@ -5,6 +5,7 @@ const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { InjectManifest } = require('workbox-webpack-plugin');
const { max } = require('lodash');
module.exports = merge(common, {
// devtool: 'source-map',
@@ -18,9 +19,9 @@ module.exports = merge(common, {
plugins: [
new CopyWebpackPlugin({
patterns: [
'src/.htaccess',
'src/iframe.html',
'src/xdLocalStoragePostMessageApi.min.js',
'src/.htaccess',
'src/iframe.html',
'src/xdLocalStoragePostMessageApi.min.js',
{ from: 'src/schemas', to: 'schemas' },
{
from: 'src/images/logo/*',
@@ -42,11 +43,11 @@ module.exports = merge(common, {
// overwrite: true,
// appVersion: `${pkgJson.version}-${buildDate.toISOString()}`
// }),
new InjectManifest({
swSrc: './src/sw.js',
swDest: 'service-worker.js'
}),
]
});