Skip to content

Commit

Permalink
Merge branch 'TryGhost:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekler authored Oct 7, 2024
2 parents 8d36f76 + 084022a commit 29278a3
Show file tree
Hide file tree
Showing 430 changed files with 13,908 additions and 4,205 deletions.
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ If your change is **user-facing** please prepend the first line of your commit w
- ✨ Feature
- 🎨 Improvement / change
- 🐛 Bug Fix
- 🌐 i18n (translation) submissions
- 💡 Anything else flagged to users or whoever is writing release notes

Good commit message examples: [one](https://github.com/TryGhost/Ghost/commit/61db6defde3b10a4022c86efac29cf15ae60983f), [two](https://github.com/TryGhost/Ghost/commit/b392d1925a9f961d7b4bf781ee86393a7773ed4b) and [three](https://github.com/TryGhost/Ghost/commit/e4807a779c28a754e3f8ae871a26a8aad12ca9a9).
Expand Down
45 changes: 45 additions & 0 deletions .github/scripts/bump-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const fs = require('fs/promises');
const exec = require('util').promisify(require('child_process').exec);
const path = require('path');

const core = require('@actions/core');
const semver = require('semver');

(async () => {
const corePackageJsonPath = path.join(__dirname, '../../ghost/core/package.json');
const corePackageJson = require(corePackageJsonPath);

const current_version = corePackageJson.version;
console.log(`Current version: ${current_version}`);

const firstArg = process.argv[2];
console.log('firstArg', firstArg);

const buildString = await exec('git rev-parse --short HEAD').then(({stdout}) => stdout.trim());

let newVersion;

if (firstArg === 'canary') {
const bumpedVersion = semver.inc(current_version, 'minor');
newVersion = `${bumpedVersion}-pre-g${buildString}`;
} else {
const gitVersion = await exec('git describe --long HEAD').then(({stdout}) => stdout.trim().replace(/^v/, ''));
newVersion = gitVersion;
}

newVersion += '+moya';
console.log('newVersion', newVersion);

corePackageJson.version = newVersion;
await fs.writeFile(corePackageJsonPath, JSON.stringify(corePackageJson, null, 2));

const adminPackageJsonPath = path.join(__dirname, '../../ghost/admin/package.json');
const adminPackageJson = require(adminPackageJsonPath);
adminPackageJson.version = newVersion;
await fs.writeFile(adminPackageJsonPath, JSON.stringify(adminPackageJson, null, 2));

console.log('Version bumped to', newVersion);

core.setOutput('BUILD_VERSION', newVersion);
core.setOutput('GIT_COMMIT_HASH', buildString)
})();
4 changes: 4 additions & 0 deletions .github/scripts/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ async function handleStripe() {
process.exit(0);
}

process.env.NX_DISABLE_DB = "true";
await exec("yarn nx reset --onlyDaemon");
await exec("yarn nx daemon --start");

console.log(`Running projects: ${commands.map(c => chalk.green(c.name)).join(', ')}`);

const {result} = concurrently(commands, {
Expand Down
22 changes: 22 additions & 0 deletions .github/scripts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,27 @@ services:
ports:
- "6379:6379"
restart: always
prometheus:
profiles: [monitoring]
image: prom/prometheus:v2.30.3
container_name: ghost-prometheus
ports:
- "9090:9090"
restart: always
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
profiles: [monitoring]
image: grafana/grafana:8.2.3
container_name: ghost-grafana
ports:
- "3000:3000"
restart: always
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
volumes:
- ./grafana/datasources:/etc/grafana/provisioning/datasources
- ./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/main.yaml
- ./grafana/dashboards:/var/lib/grafana/dashboards
volumes:
mysql-data:
15 changes: 15 additions & 0 deletions .github/scripts/grafana/dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## This file is used to point to the folder where the dashboards are stored
## To edit or create a dashboard, add a .json file to the ./dashboards folder

apiVersion: 1

providers:
- name: "Dashboard provider"
orgId: 1
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
Loading

0 comments on commit 29278a3

Please sign in to comment.