Skip to content

Commit

Permalink
Merge pull request #4861 from mozilla/mntor-3388
Browse files Browse the repository at this point in the history
  • Loading branch information
flozia authored Jul 26, 2024
2 parents 99f3a68 + 3229589 commit 759b5ea
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "npm run get-location-data && npm run build-glean && npm run build-nimbus && next build && npm run build-cronjobs",
"cloudrun": "npm run db:migrate && npm start",
"start": "next start",
"lint": "stylelint '**/*.scss' && prettier --check './src' && next lint --max-warnings=0 && tsc -p tsconfig.json --noEmit",
"lint": "stylelint '**/*.scss' && prettier --check './src' && next lint --max-warnings=0 && tsc -p tsconfig.json --noEmit && npm run validate-nimbus",
"fix": "prettier --write './src' && next lint --fix && stylelint --fix '**/*.scss'",
"test": "npm run build-nimbus && jest",
"e2e": "playwright test src/e2e/",
Expand Down Expand Up @@ -48,7 +48,8 @@
"build-glean-types": "node src/scripts/build/gleanTypes.js",
"build-glean-docs": "npm run build-glean-frontend-docs && npm run build-glean-backend-docs",
"build-glean-frontend-docs": "glean translate src/telemetry/metrics.yaml --format markdown --output docs/telemetry/frontent",
"build-glean-backend-docs": "glean translate src/telemetry/backend-metrics.yaml --format markdown --output docs/telemetry/backend"
"build-glean-backend-docs": "glean translate src/telemetry/backend-metrics.yaml --format markdown --output docs/telemetry/backend",
"validate-nimbus": "sh src/scripts/validate-nimbus-file.sh"
},
"repository": {
"type": "git",
Expand Down
29 changes: 29 additions & 0 deletions src/scripts/validate-nimbus-file.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

TARGET_PATH=/tmp/nimbus-cli
NIMBUS_INSTALL_REMOTE_PATH=https://raw.githubusercontent.com/mozilla/application-services/main/install-nimbus-cli.sh
NIMBUS_INSTALL_LOCAL_PATH=$TARGET_PATH/install.sh

if command -v "${TARGET_PATH}/nimbus-cli"; then
echo "Skip installation of \`nimbus-cli\`"
else
if [ -d "${TARGET_PATH}" ]; then
echo "Directory for \`nimbus-cli\` already exists: $TARGET_PATH"
else
echo "Create directory for \`nimbus-cli\`: $TARGET_PATH"
mkdir -p $TARGET_PATH
fi

if [ -f "${NIMBUS_INSTALL_LOCAL_PATH}" ]; then
echo "Skip download of \`nimbus-cli\` installer"
else
echo "Download \`nimbus-cli\` installer from $NIMBUS_INSTALL_REMOTE_PATH to $TARGET_PATH"
curl --proto '=https' --tlsv1.2 -sSf -o "$NIMBUS_INSTALL_LOCAL_PATH" "$NIMBUS_INSTALL_REMOTE_PATH"
fi

echo "Install \`nimbus-cli\`"
bash $NIMBUS_INSTALL_LOCAL_PATH --directory $TARGET_PATH
fi

echo "Lint nimbus.yaml"
$TARGET_PATH/nimbus-cli fml -- validate config/nimbus.yaml

0 comments on commit 759b5ea

Please sign in to comment.