Skip to content

Commit

Permalink
Merge branch 'develop' into CP-2151
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarMichalkiewicz committed Oct 25, 2023
2 parents 91a20ca + 1821d4d commit b644f80
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 12 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ FRESHDESK_API_URL=
FRESHDESK_API_TOKEN=

# [Optional] analytics.mudita.com
ANALYTICS_ENABLED=
ANALYTICS_API_URL=
ANALYTICS_API_SITE_ID=

Expand Down
56 changes: 51 additions & 5 deletions .github/workflows/nexus-development.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and push artifacts to nexus
name: Build & deploy to development

on:
push:
Expand Down Expand Up @@ -32,6 +32,7 @@ jobs:
FONTS_DIRECTORY_URL: ${{ secrets.FONTS_DIRECTORY_URL }}
FRESHDESK_API_URL: ${{ secrets.FRESHDESK_API_URL }}
FRESHDESK_API_TOKEN: ${{ secrets.FRESHDESK_API_TOKEN }}
ANALYTICS_ENABLED: ${{ secrets.ANALYTICS_ENABLED }}
ANALYTICS_API_URL: ${{ secrets.ANALYTICS_API_URL }}
ANALYTICS_API_SITE_ID: ${{ secrets.ANALYTICS_API_SITE_ID }}
FEATURE_TOGGLE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_ENVIRONMENT }}
Expand All @@ -48,15 +49,19 @@ jobs:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
export APP_VERSION=`echo -n v && cat packages/app/package.json | jq -r .version`
export APP_VERSION=`cat packages/app/package.json | jq -r .version`
export SOURCE_BRANCH=${{ github.ref_name }}
export "BUILD_VERSION=-dev.${{ github.run_number }}"
if [[ $SOURCE_BRANCH == "develop" ]]; then
export ENVIVORMENT_CATALOG_NAME=development
export "BUILD_VERSION=-dev.${{ github.run_number }}"
else
export "ENVIVORMENT_CATALOG_NAME=feature-branch/${{ github.ref_name }}"
export "BUILD_VERSION=.${{ github.run_number }}"
fi
export APP_VERSION=`echo -n v && cat packages/app/package.json | jq -r .version`
echo "GITTAG=$APP_VERSION$BUILD_VERSION" >> $GITHUB_ENV
export GITTAG="$APP_VERSION$BUILD_VERSION"
git tag "$GITTAG"
git push origin "$GITTAG"
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.exe https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION$BUILD_VERSION/Mudita-Center.exe
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.AppImage https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION$BUILD_VERSION/Mudita-Center.AppImage
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.dmg https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION$BUILD_VERSION/Mudita-Center.dmg
Expand All @@ -68,4 +73,45 @@ jobs:
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest-mac.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION$BUILD_VERSION/latest-mac.yml
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION$BUILD_VERSION/latest.yml
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/builder-debug.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION$BUILD_VERSION/builder-debug.yml
git clone https://${{ secrets.MC_GITHUB_ACCESS_TOKEN }}@github.com/mudita/mudita-center-internal-releases.git
cd mudita-center-internal-releases
git tag "$GITTAG"
git push origin "$GITTAG"
- name: Create draft release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
./packages/app/release/Mudita-Center.exe
./packages/app/release/Mudita-Center.AppImage
./packages/app/release/Mudita-Center.dmg
./packages/app/release/Mudita-Center.zip
./packages/app/release/Mudita-Center.zip.blockmap
./packages/app/release/Mudita-Center.exe.blockmap
./packages/app/release/Mudita-Center.dmg.blockmap
./packages/app/release/latest-linux.yml
./packages/app/release/latest-mac.yml
./packages/app/release/latest.yml
./packages/app/release/builder-debug.yml
tag_name: ${{ env.GITTAG }}
name: Mudita Center v${{ env.GITTAG }}
repository: mudita/mudita-center-internal-releases
token: ${{ secrets.MC_GITHUB_ACCESS_TOKEN }}
prerelease: true
- name: Push artifacts to GitHub
id: upload_assets
uses: actions/upload-artifact@v2
with:
name: release-assets
path: |
./packages/app/release/Mudita-Center.exe
./packages/app/release/Mudita-Center.AppImage
./packages/app/release/Mudita-Center.dmg
./packages/app/release/Mudita-Center.zip
./packages/app/release/Mudita-Center.zip.blockmap
./packages/app/release/Mudita-Center.exe.blockmap
./packages/app/release/Mudita-Center.dmg.blockmap
./packages/app/release/latest-linux.yml
./packages/app/release/latest-mac.yml
./packages/app/release/latest.yml
./packages/app/release/builder-debug.yml
49 changes: 46 additions & 3 deletions .github/workflows/nexus-pre-production.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and push artifacts to nexus
name: Build & deploy to pre-production

on:
push:
Expand Down Expand Up @@ -33,6 +33,7 @@ jobs:
FONTS_DIRECTORY_URL: ${{ secrets.FONTS_DIRECTORY_URL }}
FRESHDESK_API_URL: ${{ secrets.FRESHDESK_API_URL }}
FRESHDESK_API_TOKEN: ${{ secrets.FRESHDESK_API_TOKEN }}
ANALYTICS_ENABLED: ${{ secrets.ANALYTICS_ENABLED }}
ANALYTICS_API_URL: ${{ secrets.ANALYTICS_API_URL }}
ANALYTICS_API_SITE_ID: ${{ secrets.ANALYTICS_API_SITE_ID }}
FEATURE_TOGGLE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_ENVIRONMENT }}
Expand All @@ -50,7 +51,9 @@ jobs:
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
export ENVIVORMENT_CATALOG_NAME=pre-production
export APP_VERSION=`echo -n v && cat packages/app/package.json | jq -r .version`
export APP_VERSION=`cat packages/app/package.json | jq -r .version`
echo "GITTAG=$APP_VERSION" >> $GITHUB_ENV
export GITTAG="$APP_VERSION"
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.exe https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.exe
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.AppImage https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.AppImage
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.dmg https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.dmg
Expand All @@ -62,4 +65,44 @@ jobs:
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest-mac.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/latest-mac.yml
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/latest.yml
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/builder-debug.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/builder-debug.yml
git clone https://${{ secrets.MC_GITHUB_ACCESS_TOKEN }}@github.com/mudita/mudita-center-internal-releases.git
cd mudita-center-internal-releases
git tag "$GITTAG"
git push origin "$GITTAG"
- name: Create draft release on internal repository
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
./packages/app/release/Mudita-Center.exe
./packages/app/release/Mudita-Center.AppImage
./packages/app/release/Mudita-Center.dmg
./packages/app/release/Mudita-Center.zip
./packages/app/release/Mudita-Center.zip.blockmap
./packages/app/release/Mudita-Center.exe.blockmap
./packages/app/release/Mudita-Center.dmg.blockmap
./packages/app/release/latest-linux.yml
./packages/app/release/latest-mac.yml
./packages/app/release/latest.yml
./packages/app/release/builder-debug.yml
name: Mudita Center ${{ env.GITTAG }}
tag_name: ${{ env.GITTAG }}
repository: mudita/mudita-center-internal-releases
token: ${{ secrets.MC_GITHUB_ACCESS_TOKEN }}
- name: Push artifacts to github
id: upload_assets
uses: actions/upload-artifact@v2
with:
name: release-assets
path: |
./packages/app/release/Mudita-Center.exe
./packages/app/release/Mudita-Center.AppImage
./packages/app/release/Mudita-Center.dmg
./packages/app/release/Mudita-Center.zip
./packages/app/release/Mudita-Center.zip.blockmap
./packages/app/release/Mudita-Center.exe.blockmap
./packages/app/release/Mudita-Center.dmg.blockmap
./packages/app/release/latest-linux.yml
./packages/app/release/latest-mac.yml
./packages/app/release/latest.yml
./packages/app/release/builder-debug.yml
44 changes: 41 additions & 3 deletions .github/workflows/nexus-production.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and push artifacts to nexus
name: Build & deploy to production

on:
push:
Expand Down Expand Up @@ -33,6 +33,7 @@ jobs:
FONTS_DIRECTORY_URL: ${{ secrets.FONTS_DIRECTORY_URL }}
FRESHDESK_API_URL: ${{ secrets.FRESHDESK_API_URL }}
FRESHDESK_API_TOKEN: ${{ secrets.FRESHDESK_API_TOKEN }}
ANALYTICS_ENABLED: ${{ secrets.ANALYTICS_ENABLED }}
ANALYTICS_API_URL: ${{ secrets.ANALYTICS_API_URL }}
ANALYTICS_API_SITE_ID: ${{ secrets.ANALYTICS_API_SITE_ID }}
FEATURE_TOGGLE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_ENVIRONMENT }}
Expand All @@ -50,7 +51,8 @@ jobs:
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: |
export ENVIVORMENT_CATALOG_NAME=production
export APP_VERSION=`echo -n v && cat packages/app/package.json | jq -r .version`
export APP_VERSION=`cat packages/app/package.json | jq -r .version`
echo "GITTAG=$APP_VERSION" >> $GITHUB_ENV
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.exe https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.exe
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.AppImage https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.AppImage
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/Mudita-Center.dmg https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/Mudita-Center.dmg
Expand All @@ -62,4 +64,40 @@ jobs:
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest-mac.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/latest-mac.yml
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/latest.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/latest.yml
curl -v -u $NEXUS_USERNAME:$NEXUS_PASSWORD --upload-file ./packages/app/release/builder-debug.yml https://nexus.mudita.com/repository/mudita-center/releases/$ENVIVORMENT_CATALOG_NAME/$APP_VERSION/builder-debug.yml
- name: Create draft release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
./packages/app/release/Mudita-Center.exe
./packages/app/release/Mudita-Center.AppImage
./packages/app/release/Mudita-Center.dmg
./packages/app/release/Mudita-Center.zip
./packages/app/release/Mudita-Center.zip.blockmap
./packages/app/release/Mudita-Center.exe.blockmap
./packages/app/release/Mudita-Center.dmg.blockmap
./packages/app/release/latest-linux.yml
./packages/app/release/latest-mac.yml
./packages/app/release/latest.yml
./packages/app/release/builder-debug.yml
tag_name: ${{ env.GITTAG }}
name: Mudita Center v${{ env.GITTAG }}
token: ${{ secrets.MC_GITHUB_ACCESS_TOKEN }}
draft: true
- name: Push artifacts to GitHub
id: upload_assets
uses: actions/upload-artifact@v2
with:
name: release-assets
path: |
./packages/app/release/Mudita-Center.exe
./packages/app/release/Mudita-Center.AppImage
./packages/app/release/Mudita-Center.dmg
./packages/app/release/Mudita-Center.zip
./packages/app/release/Mudita-Center.zip.blockmap
./packages/app/release/Mudita-Center.exe.blockmap
./packages/app/release/Mudita-Center.dmg.blockmap
./packages/app/release/latest-linux.yml
./packages/app/release/latest-mac.yml
./packages/app/release/latest.yml
./packages/app/release/builder-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export class AnalyticDataTrackerFactory {
const appSettings = settingsService.getSettings()

const _id = appSettings.applicationId
const trackingEnabled = appSettings.privacyPolicyAccepted
const trackingEnabled =
appSettings.privacyPolicyAccepted && process.env.ANALYTICS_ENABLED === "1"

const axiosInstance: AxiosInstance = axios.create({
httpsAgent: new https.Agent({
Expand Down

0 comments on commit b644f80

Please sign in to comment.