From f9f6786f950b10afde6e4d548fe374190dc740d5 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Wed, 12 Jun 2019 15:22:29 +0200 Subject: [PATCH] Improve production builds and deployment Removes all custom build & deploy scripts, switching to 5apps Deploy's new build directory config instead. Builds production to `release/` when updating the version using `npm version`. --- package.json | 7 ++++--- scripts/deploy.sh | 20 -------------------- scripts/update-version-file.sh | 10 ---------- 3 files changed, 4 insertions(+), 33 deletions(-) delete mode 100755 scripts/deploy.sh delete mode 100644 scripts/update-version-file.sh diff --git a/package.json b/package.json index 6486fc2..23b5684 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,10 @@ "start": "KREDITS_APM_DOMAIN=open.aragonpm.eth ember serve", "start:local": "WEB3_PROVIDER_URL=http://localhost:7545 ember s", "build": "ember build", - "build-prod": "ember build --environment production", - "update-version-file": "bash scripts/update-version-file.sh", - "deploy": "npm run build-prod && npm run update-version-file && bash scripts/deploy.sh" + "build-prod": "rm -rf release/* && ember build -prod --output-path release", + "preversion": "npm test", + "version": "npm run build-prod && git add release/", + "deploy": "git push 5apps master" }, "devDependencies": { "@ember/jquery": "^0.5.2", diff --git a/scripts/deploy.sh b/scripts/deploy.sh deleted file mode 100755 index 4e6f9eb..0000000 --- a/scripts/deploy.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -set -xe - -# Get revision from local master -rev=`git rev-parse HEAD` -short_rev=${rev:0:7} -# Check out build branch -git checkout build-production -# Copy from build dir to root -cp -r dist/* . -# Add all files -git add --all -# Commit build files -git commit -m "Build production from $short_rev" -# Push to remote -git push 5apps build-production:master -# Push build branch to collab repo -git push origin build-production:build-production -# Go back to previous branch -git checkout - diff --git a/scripts/update-version-file.sh b/scripts/update-version-file.sh deleted file mode 100644 index ac29f68..0000000 --- a/scripts/update-version-file.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -PACKAGE_VERSION=$(cat package.json \ - | grep version \ - | head -1 \ - | awk -F: '{ print $2 }' \ - | sed 's/[",]//g' \ - | tr -d '[[:space:]]') - -echo $PACKAGE_VERSION > dist/VERSION