aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2019-11-07 14:05:57 +0100
committern-peugnet <n.peugnet@free.fr>2019-11-07 15:40:45 +0100
commit14ff62ace7a8fdc21a8d2f84bd0cbd32edca24af (patch)
treeda45467a9823f8cec3ed01b184daafcbc31e1c06
parentf43d03393babc939756c9f5581343913b02c7298 (diff)
downloadwcms-14ff62ace7a8fdc21a8d2f84bd0cbd32edca24af.tar.gz
wcms-14ff62ace7a8fdc21a8d2f84bd0cbd32edca24af.zip
build: gen VERSION from make instead of release-it
- remove @release-it/bumper module - gen VERSION from make - remove VERSION from git
-rw-r--r--.gitignore1
-rw-r--r--.release-it.json8
-rw-r--r--Makefile17
-rw-r--r--VERSION1
-rw-r--r--index.php2
-rw-r--r--package-lock.json32
-rw-r--r--package.json1
7 files changed, 17 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore
index 49ce50d..241abeb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,4 +13,5 @@ vendor/*
node_modules/
config.json
error_log
+VERSION
!README.md
diff --git a/.release-it.json b/.release-it.json
index 0096671..2ac256c 100644
--- a/.release-it.json
+++ b/.release-it.json
@@ -9,14 +9,6 @@
"dist/*.zip"
]
},
- "plugins": {
- "@release-it/bumper": {
- "out": {
- "file": "VERSION",
- "type": "text/plain"
- }
- }
- },
"hooks": {
"after:git:release": "make dist"
}
diff --git a/Makefile b/Makefile
index 0753357..70722f4 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,8 @@ include .env
export
PATH := vendor/bin:node_modules/.bin:$(PATH)
-GIT_VERSION := $(shell git --no-pager describe --always --tags)
+override GIT_VERSION := $(shell git --no-pager describe --always --tags)
+override CUR_VERSION := $(strip $(shell cat VERSION))
js_sources := $(wildcard src/*.js)
js_bundles := $(js_sources:src/%.js=assets/js/%.bundle.js)
@@ -12,7 +13,7 @@ zip_release := dist/w_cms_$(GIT_VERSION).zip
all: vendor build
-build: $(js_bundles)
+build: VERSION $(js_bundles)
watch: node_modules
webpack --env dev --watch
@@ -38,6 +39,7 @@ dist/w_cms_%.zip: all
"package*" \
webpack.config.js
zip -r $@ \
+ VERSION \
assets/js \
vendor \
-x "*test*" \
@@ -51,6 +53,14 @@ assets/js/%.bundle.js assets/js/%.bundle.map: src/%.js node_modules
.env:
cp .default.env .env
+# use a force (fake) target to always rebuild this file but have Make
+# consider this updated if it was actually rewritten (a .PHONY target
+# is always considered new)
+VERSION: FORCE
+ifneq ($(CUR_VERSION),$(GIT_VERSION))
+ @echo $(GIT_VERSION) > VERSION
+endif
+
vendor: composer.json composer.lock
@echo "Installing PHP dependencies..."
composer install $(if $(filter $(ENV),prod),--no-dev --prefer-dist,)
@@ -70,7 +80,10 @@ distclean: buildclean
buildclean:
@echo "Cleaning build artifacts..."
+ rm -rf VERSION
rm -rf $(js_bundles)
rm -rf $(js_srcmaps)
+FORCE: ;
+
.PHONY: all build watch release dist clean distclean buildclean
diff --git a/VERSION b/VERSION
deleted file mode 100644
index 5849151..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-1.7.5 \ No newline at end of file
diff --git a/index.php b/index.php
index 20a424c..1c197f6 100644
--- a/index.php
+++ b/index.php
@@ -15,7 +15,7 @@ $app = new Wcms\Application();
$app->wakeup();
Sentry\init([
'dsn' => Wcms\Config::sentrydsn(),
- 'release' => 'w_cms_v' . getversion(),
+ 'release' => getversion(),
'project_root' => 'app',
]);
Sentry\configureScope(function (Sentry\State\Scope $scope): void {
diff --git a/package-lock.json b/package-lock.json
index 7dbe19c..b1f576c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -124,20 +124,6 @@
"universal-user-agent": "^4.0.0"
}
},
- "@release-it/bumper": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/@release-it/bumper/-/bumper-1.0.5.tgz",
- "integrity": "sha512-LqfiUu5IgzdYAHH8+VwVEg30+Q7sRSD44XuwqbfVwhQJYmScO6Ik0Eet+FOAxYr4EskwK8KM4TjsdX+QurgZqA==",
- "dev": true,
- "requires": {
- "detect-indent": "^6.0.0",
- "lodash.castarray": "^4.4.0",
- "lodash.get": "^4.4.2",
- "lodash.set": "^4.3.2",
- "mock-fs": "^4.10.1",
- "release-it": "^12.4.2"
- }
- },
"@sindresorhus/is": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",
@@ -1531,12 +1517,6 @@
"integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
"dev": true
},
- "detect-indent": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz",
- "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==",
- "dev": true
- },
"detect-repo-changelog": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/detect-repo-changelog/-/detect-repo-changelog-1.0.1.tgz",
@@ -3479,12 +3459,6 @@
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"dev": true
},
- "lodash.castarray": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/lodash.castarray/-/lodash.castarray-4.4.0.tgz",
- "integrity": "sha1-wCUTUV4wna3dTCTGDP3c9ZdtkRU=",
- "dev": true
- },
"lodash.find": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz",
@@ -3758,12 +3732,6 @@
}
}
},
- "mock-fs": {
- "version": "4.10.2",
- "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.2.tgz",
- "integrity": "sha512-ewPQ83O4U8/Gd8I15WoB6vgTTmq5khxBskUWCRvswUqjCfOOTREmxllztQOm+PXMWUxATry+VBWXQJloAyxtbQ==",
- "dev": true
- },
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
diff --git a/package.json b/package.json
index ad88d1d..001c71e 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,6 @@
"codemirror": "^5.49.0"
},
"devDependencies": {
- "@release-it/bumper": "^1.0.5",
"css-loader": "^3.2.0",
"prettier": "^1.18.2",
"prettier-webpack-plugin": "^1.2.0",