[*.{js,json,md,ts}]
indent_style = space
indent_size = 4
-
-[portool]
-indent_style = space
-indent_size = 4
/aspects/dotfiles/files/.npmrc
/aspects/dotfiles/files/.pypirc
/aspects/dotfiles/files/.zsh/exports.private
-/aspects/dotfiles/files/.zsh/liferay/bin/portool-helpers/licenses/activation-key-liferaycommerce-entrprise-internal.xml
-/aspects/dotfiles/files/.zsh/liferay/exports
/aspects/ssh/templates/.ssh/config.erb
/aspects/vim/files/.vim/.base16
/aspects/vim/files/.vim/.base16.previous
".corpusrc.erb",
".fehbg",
".gitconfig.erb",
- ".hammerspoon/iterm.lua.erb",
- ".zsh/liferay/exports.erb"
+ ".hammerspoon/iterm.lua.erb"
]
}
}
require 'date'
# 2017-10-31: Personal MacBook Pro (Haswell, Mid-2015, dual graphics).
-# 2019-01-14: Liferay MacBook Pro 15-Inch "Core i7" 2.6 Touch/2018
year = (ARGV[0] || 2017).to_i
month = (ARGV[1] || 10).to_i
+++ /dev/null
-#compdef portool
-
-_values 'subcommands' $(ls ~/.zsh/liferay/bin/portool-helpers)
# test -d $SOME_DIR && hash -d $SHORTCUT=$SOME_DIR
HOSTNAME=$(hostname -s)
-
-# Work stuff:
-if [ "$HOSTNAME:u" = 'LFRW044' -o "$HOSTNAME:l" = 'retiro' ]; then
- () {
- local ALLOY_EDITOR=~/code/portal/liferay-portal/modules/apps/frontend-editor/frontend-editor-alloyeditor-web
- local CKEDITOR=~/code/portal/liferay-portal/modules/apps/frontend-editor/frontend-editor-ckeditor-web
- local EE=~/code/portal-ee/liferay-portal-ee
- local PORTAL=~/code/portal/liferay-portal
- local DEPLOY=~/code/portal/bundles/deploy
- local MODULES=~/code/portal/liferay-portal/modules
- local TOMCAT=~/code/portal/bundles/tomcat-9.0.43
-
- test -d "$ALLOY_EDITOR" && hash -d alloy="$ALLOY_EDITOR"
- test -d "$CKEDITOR" && hash -d ckeditor="$CKEDITOR"
- test -d "$DEPLOY" && hash -d deploy="$DEPLOY"
- test -d "$EE" && hash -d ee="$EE"
- test -d "$MODULES" && hash -d modules="$MODULES"
- test -d "$PORTAL" && hash -d portal="$PORTAL"
- test -d "$TOMCAT" && hash -d tomcat="$TOMCAT"
- }
-fi
+++ /dev/null
-# Host-specific config.
-
-source $HOME/.zsh/liferay/aliases
-source $HOME/.zsh/liferay/exports
-source $HOME/.zsh/liferay/path
+++ /dev/null
-# Host-specific config.
-
-source $HOME/.zsh/liferay/aliases
-source $HOME/.zsh/liferay/exports
-source $HOME/.zsh/liferay/path
# Host-specific config.
alias irl=.irl.rb 2017 10 31
-
-# Some work from home stuff on this host too.
-
-source $HOME/.zsh/liferay/exports
-source $HOME/.zsh/liferay/path
+++ /dev/null
-alias irl=.irl.rb 2019 1 14
+++ /dev/null
-#!/bin/bash
-
-# Replacement for: https://www.npmjs.com/package/gradle-launcher
-#
-# Walks up from the current directory looking for a "gradlew" wrapper, and
-# executes it, if found.
-#
-# See: https://docs.gradle.org/current/userguide/gradle_wrapper.html
-
-DIR=${PWD%/}
-
-while [[ -n $DIR ]]; do
- if [[ -e $DIR/gradlew ]]; then
- exec "$DIR/gradlew" "$@"
- else
- DIR=${DIR%/*}
- fi
-done
-
-echo "error: failed to find \`gradlew\` wrapper"
-
-exit 1
+++ /dev/null
-#!/usr/bin/env node
-
-const child_process = require('child_process');
-const fs = require('fs');
-const path = require('path');
-const {createInterface} = require('readline');
-
-function log(...messages) {
- console.log(...messages);
-}
-
-function error(...messages) {
- log('error: ', ...messages);
-}
-
-function die(...messages) {
- if (messages.length) {
- log(...messages);
- }
- process.exit(1);
-}
-
-async function confirm(prompt) {
- const readline = createInterface({
- input: process.stdin,
- output: process.stdout,
- });
-
- return new Promise((resolve) => {
- readline.question(`${prompt} [y/n] `, resolve);
-
- readline.write('y');
- })
- .then((result) => {
- return /^\s*y(es?)?\s*$/i.test(result);
- })
- .finally(() => {
- readline.close();
- });
-}
-
-// The lowest signal number (via `man 3 signal`).
-const SIGHUP = 1;
-
-// The highest signal number (via `man 3 signal`).
-const SIGUSR2 = 31;
-
-function run(command, ...args) {
- return new Promise((resolve, reject) => {
- let resolved = false;
- const child = child_process.spawn(command, args, {stdio: 'inherit'});
-
- process.on('SIGINT', () => {
- child.kill('SIGINT');
- });
-
- child.on('error', (err) => {
- if (!resolved) {
- resolved = true;
- reject(err);
- }
- });
-
- child.on('exit', (code) => {
- if (!resolved) {
- resolved = true;
- if (code) {
- let err;
- const description = `\`${[command, ...args].join(' ')}\``;
- if (code >= 128 + SIGHUP && code <= 128 + SIGUSR2) {
- err = new Error(
- `${description} exited due to signal ${code - 128}`
- );
- } else {
- err = new Error(
- `${description} exited with status ${code}`
- );
- }
- reject(err);
- } else {
- resolve();
- }
- }
- });
- });
-}
-
-async function getHelper(command) {
- if (command.match(/^\w+$/)) {
- const dir = path.join(__dirname, 'portool-helpers');
- const helper = path.join(dir, command);
-
- try {
- fs.accessSync(helper, fs.constants.X_OK);
-
- if (fs.statSync(helper).isFile()) {
- return helper;
- }
- } catch (error) {
- if (error.code === 'ENOENT') {
- // Check for a possible match.
- const candidates = fs
- .readdirSync(dir)
- .filter((entry) => /^[a-z]/.test(entry));
-
- const prefixMatches = candidates.filter((entry) =>
- entry.startsWith(command)
- );
-
- if (prefixMatches.length === 1) {
- // Unambiguous prefix match.
- return getHelper(prefixMatches[0]);
- } else if (prefixMatches.length > 1) {
- // Multiple possible prefix matches.
- log(
- `Ambiguous command ${JSON.stringify(
- command
- )} - did you mean one of?\n` +
- '\n' +
- prefixMatches
- .map((prefix) => ` ${prefix}`)
- .join('\n') +
- '\n'
- );
- } else {
- // Prompt for confirmation of best fuzzy match guess.
- const fuzzyMatches = candidates
- .map((candidate) => ({
- candidate,
- score: jaroWinkler(candidate, command),
- }))
- .filter(({score}) => score)
- .sort((a, b) => {
- if (a.score < b.score) {
- return -1;
- } else if (a.score > b.score) {
- return 1;
- } else {
- return 0;
- }
- })
- .reverse();
-
- const proposed = fuzzyMatches[0];
-
- if (proposed) {
- log(
- `Command ${JSON.stringify(
- command
- )} invoked, which does not exist.\n`
- );
-
- const proceed = await confirm(
- `Do you want to run ${JSON.stringify(
- proposed.candidate
- )} instead?`
- );
-
- if (proceed) {
- return getHelper(proposed.candidate);
- }
- }
- }
- }
- }
- }
-}
-
-/**
- * Compute Jaro-Winkler similarity index (0 to 1).
- *
- * See: https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance
- *
- * Original C implementation: https://web.archive.org/web/19990822155334/http://www.census.gov/geo/msb/stand/strcmp.c
- *
- * Based on: https://github.com/jordanthomas/jaro-winkler/blob/fd14e7a65e10e63d/index.js
- *
- * The MIT License (MIT)
- * Copyright (c) 2015 Jordan Thomas
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- */
-function jaroWinkler(a, b) {
- if (!a.length || !b.length) {
- // Empty strings match nothing, not even each other.
- return 0;
- }
-
- const s1 = a.toLowerCase();
- const s2 = b.toLowerCase();
-
- if (s1 === s2) {
- // Exact match.
- return 1;
- }
-
- let m = 0;
-
- const range = Math.floor(Math.max(s1.length, s2.length) / 2) - 1;
- const s1Matches = new Array(s1.length);
- const s2Matches = new Array(s2.length);
-
- for (let i = 0; i < s1.length; i++) {
- const low = i >= range ? i - range : 0;
- const high = i + range <= s2.length - 1 ? i + range : s2.length - 1;
-
- for (let j = low; j <= high; j++) {
- if (
- s1Matches[i] !== true &&
- s2Matches[j] !== true &&
- s1[i] === s2[j]
- ) {
- ++m;
-
- s1Matches[i] = s2Matches[j] = true;
-
- break;
- }
- }
- }
-
- if (m === 0) {
- // No matching letters.
- return 0;
- }
-
- // Count transpositions.
- let k = 0;
- let transpositions = 0;
-
- for (let i = 0; i < s1.length; i++) {
- if (s1Matches[i] === true) {
- let j;
-
- for (j = k; j < s2.length; j++) {
- if (s2Matches[j] === true) {
- k = j + 1;
- break;
- }
- }
-
- if (s1[i] !== s2[j]) {
- ++transpositions;
- }
- }
- }
-
- // "sim" is the Jaro similarity ("sim[j]").
- let sim =
- (m / s1.length + m / s2.length + (m - transpositions / 2) / m) / 3;
-
- // Apply prefix scaling to obtain Jaro-Winkler similarity ("sim[w]").
-
- // Length of common prefix (up to a maximum of 4 characters).
- let l = 0;
-
- // Scaling factor. 0.1 is standard, 0.25 is upper limit to prevent similarity
- // from exceeding 1.
- const p = 0.1;
-
- if (sim > 0.7) {
- while (s1[l] === s2[l] && l < 4) {
- ++l;
- }
-
- sim = sim + l * p * (1 - sim);
- }
-
- return sim;
-}
-
-const HELP = 'run `portool help` to see available commands';
-
-async function main(_node, _script, command, ...args) {
- if (!command) {
- die(`must supply command: ${HELP}`);
- }
- const helper = await getHelper(command);
- if (!helper) {
- die(`no such command: ${command} - ${HELP}`);
- }
-
- await run(helper, ...args);
-}
-
-main(...process.argv).catch((err) => {
- error(err);
- process.exit(1);
-});
-
-// vim: ft=javascript
+++ /dev/null
-#!/bin/bash
-
-PORTOOL_BASE="${BASH_SOURCE%/*}"
-
-TOMCAT=tomcat-9.0.43
-
-if [[ $PWD = $HOME/code/portal-master* ]]; then
- PORTAL_DB=lportal2_master
- PORTAL_CONTEXT=$HOME/code/portal-master
- PORTAL_ROOT=$PORTAL_CONTEXT/liferay-portal
-elif [[ $PWD = $HOME/code/portal-ee* ]]; then
- PORTAL_DB=
- PORTAL_CONTEXT=$HOME/code/portal-ee
- PORTAL_ROOT=$PORTAL_CONTEXT/liferay-portal-ee
-elif [[ $PWD = $HOME/code/portal* ]]; then
- PORTAL_DB=lportal_master
- PORTAL_CONTEXT=$HOME/code/portal
- PORTAL_ROOT=$PORTAL_CONTEXT/liferay-portal
-else
- PORTAL_FALLBACK=1
- PORTAL_DB=lportal_master
- PORTAL_CONTEXT=$HOME/code/portal
- PORTAL_ROOT=$PORTAL_CONTEXT/liferay-portal
-fi
-
-PORTAL_BUNDLES=$PORTAL_CONTEXT/bundles
-
-# Based on: https://stackoverflow.com/a/8351489/2103996
-backoff() {
- local max_attempts=${ATTEMPTS-5}
- local timeout=${TIMEOUT-1}
- local attempt=1
- local exitCode=0
-
- while (( $attempt < $max_attempts ))
- do
- if "$@"
- then
- return 0
- else
- exitCode=$?
- fi
-
- echo "error: retrying in $timeout..." 1>&2
- sleep $timeout
- attempt=$(( attempt + 1 ))
- timeout=$(( timeout * 2 ))
- done
-
- if [[ $exitCode != 0 ]]
- then
- echo "error: maximum attempt count exceeded ($@)" 1>&2
- fi
-
- return $exitCode
-}
-
-node_path() {
- local DIR=$PWD
-
- local NODE_BINDIR="$HOME/code/portal/liferay-portal/build/node/bin"
-
- # File to use to find nearest liferay-portal checkout.
- local SENTINEL=release.properties
-
- while [ -n "$DIR" ]; do
- if [ -e "$DIR/$SENTINEL" ]; then
- local EXECUTABLE="$DIR/build/node/bin/node"
-
- if [ -x "$EXECUTABLE" ]; then
- echo "info: using $EXECUTABLE" >&2
-
- NODE_BINDIR="$DIR/build/node/bin"
- fi
-
- break
- else
- DIR=${DIR%/*}
- fi
- done
-
- local NODE_BINARY="$NODE_BINDIR/node"
-
- if [ ! -x "$NODE_BINARY" ]; then
- echo "error: no $NODE_BINARY executable" >&2
- exit 1
- fi
-
- echo $NODE_BINDIR
-}
-
-signal_proc() {
- SIG=$1
- TARGET=$2
-
- PIDS=$(pgrep -f "$TARGET")
-
- if [ -z "$PIDS" ]; then
- echo "error: \`$TARGET\` is not running - nothing to send $SIG to"
- exit 1
- fi
-
- for PID in $PIDS; do
- GROUP=$(ps -p "$PID" -o pgid | sed -e 1d -e 's/ *//')
- if [ -z "$GROUP" ]; then
- echo "error: unable to determine process group of process $PID"
- exit 1
- fi
- echo "Sending $SIG to process group $GROUP of process $PID"
- kill "-$SIG" "-$GROUP"
- done
-}
+++ /dev/null
-#!/bin/bash
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-if [ -n "$PORTAL_FALLBACK" ]; then
- echo "error: \`portool build\` must be run from inside a liferay-portal repo"
- exit 1
-fi
-
-# First setup is to ensure `build.$USER.properties` is in place.
-# Second one is to set-up "osgi/configs" again, in case `ant` cleared them.
-cd "$PORTAL_ROOT" &&
- portool setup &&
- ant setup-profile-dxp &&
- ant all &&
- portool setup
+++ /dev/null
-nuke
\ No newline at end of file
+++ /dev/null
-#!/bin/bash
-
-# Manages config files for liferay-portal
-
-set -e
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-CONFIGS="${BASH_SOURCE%/*}/configs"
-DIR="$PORTAL_CONTEXT/bundles/osgi/configs"
-
-mkdir -p "$DIR"
-
-usage() {
- echo "Usage:"
- echo " portool config add [pattern]"
- echo " portool config help"
- echo " portool config ls"
- echo " portool config remove [pattern]"
-}
-
-if [ $# -eq 0 ]; then
- usage
- exit
-fi
-
-ACTION=$1
-
-shift
-
-GREEN='\033[0;32m'
-PURPLE='\033[0;35m'
-RED='\033[0;31m'
-RESET='\033[0m'
-
-case $ACTION in
- add|ad|a)
- if [ $# -eq 1 -a -f "$CONFIGS"/"$1" ]; then
- # Exact match: no need to show menu.
- ADD="$1"
- else
- ADD=$(ls $CONFIGS | sk -q "$*")
- fi
- echo -e "${PURPLE}[ADD]: $ADD${RESET}"
- cp "$CONFIGS/$ADD" $DIR/
- ;;
- help|hel|he|h)
- usage
- exit
- ;;
- list|lis|li|l|ls)
- if [ $# -gt 0 ]; then
- usage
- exit 1
- fi
- COLS=$(tput cols)
- echo -e "${GREEN}Available configs:${RESET}"
- echo
- ls "$CONFIGS" | sed 's/^/ /' | cut -c 1-$COLS | sort
- echo
- echo -e "${GREEN}Installed configs:${RESET}"
- echo
- ls "$DIR" | sed 's/^/ /' | cut -c 1-$COLS | sort
- ;;
- remove|remov|remo|rem|re|r|rm)
- if [ $# -eq 1 -a -f "$CONFIGS"/"$1" ]; then
- # Exact match: no need to show menu.
- RM="$1"
- else
- RM=$(ls $DIR | sk -q "$*")
- fi
- echo -e "${RED}[REM]: ${RM}${RESET}"
- rm "$DIR/$RM"
- ;;
- *)
- usage
- exit 1
- ;;
-esac
+++ /dev/null
-readsEnabled=B"true"
-trafficSourcesEnabled=B"true"
+++ /dev/null
-auditGraphEnabled=B"true"
\ No newline at end of file
+++ /dev/null
-useDataEngineEditor="true"
+++ /dev/null
-type="react"
+++ /dev/null
-enabled="true"
+++ /dev/null
-enabled="true"
+++ /dev/null
-sidecarHttpPort="AUTO"
+++ /dev/null
-showGlobalMenu=B"true"
+++ /dev/null
-#!/bin/bash
-
-# Perform daily builds of portal codebases.
-if ! ssh-add -l > /dev/null; then
- ssh-add ~/.ssh/id_rsa_2048b_20180102
-fi
-
-if [[ $# -eq 0 || $# -eq 1 && $1 = 'all' ]]; then
- TARGETS=(portal master ee)
-else
- TARGETS=("$@")
-fi
-
-function tildify() {
- local RAW=$1
- local DIR=$(cd $(dirname $RAW) && dirs +0)
- local FILE=$(basename $RAW)
- echo "$DIR/$FILE"
-}
-
-set -o pipefail
-
-for TARGET in "${TARGETS[@]}"; do
- case "$TARGET" in
- ee)
- LOG_FILE=~/code/portal-ee/liferay-portal-ee/ant-portal-ee.out
- LOG_DESC=$(tildify $LOG_FILE)
- (
- echo "ee build started: logging to $LOG_DESC" &&
- echo > $LOG_FILE &&
- exec 1<&- &&
- exec 2<&- &&
- exec 1<>$LOG_FILE &&
- exec 2>&1 &&
- cd ~/code/portal-ee/liferay-portal-ee &&
- git remote update --prune &&
- git checkout master-private &&
- git fetch upstream master-private \
- +master:master \
- +7.0.x:7.0.x \
- +7.0.x-private:7.0.x-private \
- +7.1.x:7.1.x \
- +7.1.x-private:7.1.x-private \
- +7.2.x:7.2.x \
- +7.2.x-private:7.2.x-private \
- +7.3.x:7.3.x \
- +7.3.x-private:7.3.x-private \
- +7.4.x:7.4.x \
- +7.4.x-private:7.4.x-private && \
- git merge --ff-only upstream/master-private &&
- git push origin -f :
- ) || echo "ee build failed: please see $LOG_DESC for details"
- ;;
- master)
- LOG_FILE=~/code/portal-master/liferay-portal/ant-master.out
- LOG_DESC=$(tildify $LOG_FILE)
- (
- echo "master build started: logging to $LOG_DESC" &&
- echo > $LOG_FILE &&
- exec 1<&- &&
- exec 2<&- &&
- exec 1<>$LOG_FILE &&
- exec 2>&1 &&
- cd ~/code/portal-master/liferay-portal &&
- git remote update --prune &&
- git checkout master &&
- git pull --ff-only upstream master &&
- portool build &&
- git tag "daily/portal-master/good/$(date +%Y-%m-%d)" &&
- git tag -f "daily/portal-master/good/latest"
- ) || echo "master build failed: please see $LOG_DESC for details"
- ;;
- portal)
- LOG_FILE=~/code/portal/liferay-portal/ant-portal.out
- LOG_DESC=$(tildify $LOG_FILE)
- (
- echo "portal build started: logging to $LOG_DESC" &&
- echo > $LOG_FILE &&
- exec 1<&- &&
- exec 2<&- &&
- exec 1<>$LOG_FILE &&
- exec 2>&1 &&
- cd ~/code/portal/liferay-portal &&
- git remote update --prune &&
- git checkout master &&
- git pull --ff-only upstream master &&
- git push origin +brianchandotcom/master:master +brianchandotcom/master:temp &&
- portool build &&
- git tag "daily/portal/good/$(date +%Y-%m-%d)" &&
- git tag -f "daily/portal/good/latest"
- ) || echo "portal build failed: please see $LOG_DESC for details"
- ;;
- *)
- echo "Unrecognized target: $TARGET"
- exit 1
- ;;
- esac
-done
+++ /dev/null
-#!/bin/bash
-
-# Helper to deploy a named module without having to navigate to it.
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-DEPLOYED=0
-FAILED=0
-
-trap 'report' EXIT
-
-function report() {
- echo
- if [ $DEPLOYED -gt 0 ]; then
- echo "✅ Modules succeeded: $DEPLOYED"
- fi
- if [ $FAILED -gt 0 ]; then
- echo "💥 Modules failed: $FAILED"
- fi
-}
-
-function deploy() {
- DIR=$1
-
- # Construct command line based on variables:
- #
- # portool deploy -> gradlew deploy -a
- # ALL=1 portool deploy -> gradlew deploy
- # CLEAN=1 portool deploy -> gradlew clean deploy -a
- # ALL=1 CLEAN=1 portool deploy -> gradlew clean deploy
- #
- if [ -n "$ALL" ]; then
- COMMAND="gradlew ${CLEAN:+clean }deploy"
- else
- COMMAND="gradlew ${CLEAN:+clean }deploy -a"
- fi
-
- echo "$COMMAND"
- if eval "(cd \"\$DIR\" && $COMMAND)"; then
- ((DEPLOYED++))
- else
- ((FAILED++))
- fi
-}
-
-if [ $# -eq 0 ]; then
- # No arguments: try to find nearest ancestor directory with a "build.gradle"
- # file.
- DIR=$PWD
-
- while true; do
- if [ -f "$DIR/build.gradle" ]; then
- MODULE=$(basename "$DIR")
- LOCATION=$(realpath $DIR --relative-to="$PORTAL_ROOT")
- echo "✅ Found $MODULE at $LOCATION"
- deploy "$DIR"
- break
- fi
-
- if [ "$DIR" = "/" ]; then
- echo "error: no build.gradle found in $PWD or any of its ancestors"
- exit 1
- fi
- DIR=$(dirname "$DIR")
- done
-else
- # Try to find and build named modules.
- cd "$PORTAL_ROOT"
-
- while (( "$#" )); do
- echo "⏱ Remaining modules to deploy: $#"
-
- MODULE="$1"
- GRADLE="$MODULE/build.gradle"
-
- if [ ! -f "$GRADLE" ]; then
- GRADLE=$(find modules/apps modules/dxp/apps -type f -path "*/${MODULE}/build.gradle" -maxdepth 3 -mindepth 3 | head -1)
- fi
-
- if [ -z "$GRADLE" ]; then
- echo "error: couldn't find module \`$MODULE\`"
- exit 1
- fi
-
- DIR=$(dirname "$GRADLE")
-
- echo "✅ Found $MODULE module at $DIR"
- deploy "$DIR"
-
- shift
- done
-fi
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-SESSION=liferay-portal
-
-if ! tmux has-session -t=$SESSION 2> /dev/null; then
- cd ~/code/portal/liferay-portal
-
- tmux new-session -d -s $SESSION -n vim -x $(tput cols) -y $(tput lines)
-
- # 1. Main editor window
- tmux split-window -t $SESSION:vim -h
- tmux send-keys -t $SESSION:vim.right "portool status" Enter
-
- # 2. General shell use
- tmux new-window -t $SESSION
- tmux split-window -t $SESSION:zsh -h
-
- # 3. Tomcat
- tmux new-window -t $SESSION -n tomcat
- tmux send-keys -t $SESSION:tomcat "portool run"
-
- # 4. Daily
- tmux new-window -t $SESSION -n daily
- tmux send-keys -t $SESSION:daily "portool daily"
-
- # 5. portal-master
- tmux new-window -t $SESSION -n master -c ~/code/portal-master/liferay-portal
- tmux send-keys -t $SESSION:master "git status" Enter
-
- # 6. portal-ee
- tmux new-window -t $SESSION -n ee -c ~/code/portal-ee/liferay-portal-ee
- tmux send-keys -t $SESSION:ee "git status" Enter
-
- # 7. bundle
- if [ -d ~/Downloads/bundles ]; then
- tmux new-window -t $SESSION -n bundle -c ~/Downloads/bundles
- tmux send-keys -t $SESSION:bundle "portool run bundle"
- else
- tmux new-window -t $SESSION -n bundle -c ~/Downloads
- fi
-fi
-
-if [ -n "$TMUX" ]; then
- tmux switch-client -t $SESSION
-else
- tmux attach -t $SESSION:vim.right
-fi
+++ /dev/null
-#!/bin/sh
-
-echo "Usage: portool <subcommand> [...arguments]"
-echo
-echo "Subcommands:"
-echo " build 🏭 run a normal build"
-echo " config [add|ls|rm] ⚙️ manage configuration files"
-echo " daily [ee|master|portal] ☀️ run daily builds"
-echo " deploy 🚀 deploy a module"
-echo " go 💼 connect to development session"
-echo " help 🤷 show this help"
-echo " latest 🏗 report latest successful builds"
-echo " license 💰 deploy license files, if available"
-echo " linkify 🔗 turn git-grep output into Markdown links"
-echo " node 🥝 run portal version of node"
-echo " nuke ☠️ aggressively clean database, state etc"
-echo " pause ⏸ pause the daily build"
-echo " renice 🐤 renice the daily build"
-echo " resume ▶️ resume the daily build"
-echo " restart 🔄 restart the server"
-echo " run [dev|prod] 🚜 run the server"
-echo " setup 💾 installs properties files"
-echo " sf 🖌 format source"
-echo " status 👍 report repo status"
-echo " stop 🛑 stop the server"
-echo " tail 📃 tail the daily build log"
-echo " test 🤓 run tests"
-echo " watch ⌚️ start deployFast watcher"
-echo " yarn 📦 run Yarn with portal version of node"
+++ /dev/null
-#!/bin/zsh
-
-# Report the latest successful builds in each repo.
-
-autoload colors
-colors
-
-for REPO in \
- ~/code/portal/liferay-portal \
- ~/code/portal-master/liferay-portal \
- ~/code/portal-ee/liferay-portal-ee
-do
- echo "${bold_color}Latest successful $(basename $(dirname $REPO)) build:${reset_color}"
- echo
- echo -n " "
- git -C $REPO tag --sort=-creatordate -l 'daily/'$(basename $(dirname $REPO))'/good/2*' -n | head -1
- echo
-done
+++ /dev/null
-#!/bin/bash
-
-# Deploys licenses, if any.
-
-set -e
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-DEPLOY="$PORTAL_CONTEXT/bundles/deploy"
-LICENSES="$PORTOOL_BASE/licenses"
-
-if [ ! -d "$DEPLOY" ]; then
- echo "error: non-existent deploy directory \"$DEPLOY\""
- exit 1
-fi
-
-# Note: if I ever get more licenses, may have to provide a menu to choose here.
-find "$LICENSES" -type f -name '*.xml' -print0 | while IFS= read -r -d '' LICENSE; do
- echo "Copying: $LICENSE -> $DEPLOY"
- cp "$LICENSE" "$DEPLOY"
-done
+++ /dev/null
------BEGIN PGP MESSAGE-----
-
-hQIMA/8IuvaF3PmcARAAvYvn9cfL9vomlwwSdckk7Ntth77Rk2ATR5D5AVa0y6Z9
-yE0iXXYJYW3NzYUsa5S8iLflmuL6vRfufA/P5ta/aVu5zM5XI7VfSZWf/ozv/Tg4
-e7nYwJKNpzc9PhgwKwsizGgXw/z8FEgLblOJexrtTiqhvyKE4DmnVRjG0RkQiWo8
-mZvE5WofFZLPTpjlm6cFMGLmxYBNi+tJH3f9sP5CMQBktDGL1iBL85Z8Jb7Z9CVf
-6NAgr9l5e0r2+rx3W+2CR9xc2LGuOB/6sxs9UWmSkZdCg5ZwpqMjgYGq8jPt5oZ4
-HxIpzRDsi493ZfvlD/n/TlsBZgDmg4HKzoQPPR/8d9JHleMPRh7jPCyqVKoxI+Lg
-unTln9yIUEIdfEsttOdxUK6ZaZqHiRU+sSuphzCm9nvQbB5QuwUhtLW+nt1UD5gz
-5vYtQcIIYwg7I2XTEQyQyzf5mnIuRh7P4RGo2cLBMSC2cA4biYUzQupzlq9gbX/x
-X43IXDSIjK743MbbD2R9qUmSCdfJ8QsPOvDO0Eq3yKnX3TD30bpvLmiSnwdg7To8
-RNPHiav9rNa7CvjyjJ+ckcsD826clVDUjkCM0bKc9IGzUJ5EDfLrEL/PLHfDgXsJ
-FRsx8LZdaOri6io8VIpe0wr/yYyUaxuLIYTE8/mwJHK8Loy/fHwViifZzPn6BiXS
-wTUBMJfjhhF55zTKYUMivzpE5axTkx+h5b7wlFnbCiDqMwU7CSrOjJYgEzWNfc1G
-dw2w4zRgpHNjwnspdyqNLApy6+ZY3O5AR1kUEi0HG/B+bGxGh0Nv1Om+MoArxn05
-qQ3UF2+Nu/FqdV14L+fN/W5XePinTbOPKCYL5GLAgC9JSf9VvFT8jDMCmlp1p1fb
-j8lX2pmgUEcxR25a0eEDnlEyS1+B+UIYS02Y7RCXW72IzC3HJrEDIBP1HIwtr7Pc
-gdHefGw6LZQElw0KC3/vceR+1fykUDipVKKgrM/q8emb8u7VH/hCNBZfqqBI5Nh8
-68TqLYDidz5cRjVPTIjb86jLHh78qeHsvg+pBh0xbfholid5NCqwdqzUfSRqeZzB
-9qj44vZ5QQzV2a5qNndQ07dHpdidXyGK4r5mZ8tEIIWoxSu2YJxM84rXV4wYOluP
-iR7PHfqsnAPx5TQPC6G5Atw80E9V98IqWBbmVRvRNuK58MzhMKHZL+H+IziUIBDV
-PwEQiqMiP0MdzikonnXOofR66IYr4fdWltn1Vr3K1MM+tiQ61PcAAoDuVexiHDKW
-oU7quKYV0lWDrZB+HAPbIlcjSefQ34WQxvHSjgConmnMo8eE7p2P8lnYowbsIvqu
-/V9GRLBBrGHvoRxKlN4jUqoqw7ZoSYk=
-=5EBP
------END PGP MESSAGE-----
+++ /dev/null
-#!/bin/sh
-
-# Takes `git grep` hits and turns them into a Markdown list of GitHub links.
-
-if [ -t 0 ]; then
- echo 'Usage: git grep $PATTERN | portool linkify'
- echo
- echo 'Example:'
- echo
- echo " git grep -i '"'\\b(keyup|keydown|keypress)\\b'"' -- '*.js' '*.jsp' '*.jspf' | "'\\'
- echo " egrep '^modules/"'(apps|dxp)/'"' | "'\\'
- echo ' portool linkify | \\'
- echo ' clip'
-else
- ABBREV=$(git rev-parse --short HEAD)
- # TODO: make this detect remote (eg. could be liferay-portal-ee).
- # TODO: could even work in non liferay-portal repos
- perl -pe 's%^(.+?):(\d+).+$%- [$1:$2](https://github.com/liferay/liferay-portal/blob/'"$ABBREV"'/$1#L$2)%'
-fi
+++ /dev/null
-#!/bin/bash
-
-# Run the liferay-portal version of node.
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-NODE_BINDIR=$(node_path)
-
-env PATH="$NODE_BINDIR:$PATH" node "$@"
+++ /dev/null
-#!/bin/bash
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-NUKE_LEVEL=0
-
-while (( "$#" )); do
- case "$1" in
- -f)
- NUKE_LEVEL=$(($NUKE_LEVEL + 1))
- ;;
- -ff)
- NUKE_LEVEL=$(($NUKE_LEVEL + 2))
- ;;
- -fff)
- NUKE_LEVEL=$(($NUKE_LEVEL + 3))
- ;;
- -fff*)
- NUKE_LEVEL=$(($NUKE_LEVEL + 4))
- ;;
- esac
-
- shift
-done
-
-if [[ $NUKE_LEVEL == 0 ]]; then
- echo "☠️ Run with \"-f\" to indicate desired level of nuking:"
- echo
- echo " -f: truncate database"
- echo " -ff: truncate database, kill caches"
- echo " -fff: truncate database, kill caches, \"git clean\" (most)"
- echo " -ffff: truncate database, kill caches, \"git clean\" (everything)"
- echo
-fi
-
-# TODO: update this so it works in liferay-portal-ee/7.2.x (etc) worktrees
-
-if [[ $NUKE_LEVEL > 0 ]]; then
- if [ -z "$PORTAL_DB" ]; then
- echo "⏩ Skipping db deletion..."
- else
- echo "☠️ Deleting db ($PORTAL_DB)..."
-
- echo "set foreign_key_checks=1;" | (echo "select concat('drop table if exists ', table_name, ';') from information_schema.tables where table_schema='$PORTAL_DB';" | mysql -u root -B | tail -n +2 && cat;) | (echo "set foreign_key_checks=0;" && cat;) | mysql -u root "$PORTAL_DB"
- fi
-fi
-
-TARGET="~${PORTAL_CONTEXT#$HOME}"
-
-if [[ $NUKE_LEVEL > 1 ]]; then
- echo "💥 Cleaning up temporary files in $TARGET..."
-
- rm -rf "$PORTAL_CONTEXT/bundles/osgi/state" \
- "$PORTAL_CONTEXT/bundles/data" \
- "$PORTAL_CONTEXT/bundles/elasticsearch7" \
- "$PORTAL_CONTEXT/bundles/tomcat-*/work"
-fi
-
-if [[ $NUKE_LEVEL > 2 ]]; then
- echo "☢️ \"git clean\"-ing $TARGET..."
-
- (cd "$PORTAL_ROOT" && git clean -fdx -e 'build.*.properties' -e 'app.server.*.properties')
-fi
-
-if [[ $NUKE_LEVEL > 3 ]]; then
- echo "☢️ \"git clean\"-ing $TARGET..."
-
- (cd "$PORTAL_ROOT" && git clean -fdx)
-
- if [ $PORTAL_CONTEXT = $HOME/code/portal ]; then
- echo
- read -p "Do you want to run \`portool setup\` to restore properties files? " -n 1 -r
- echo
- if [[ $REPLY =~ ^[Yy]$ ]]; then
- portool setup
- fi
- fi
-fi
+++ /dev/null
-#!/bin/bash
-
-source "${BASH_SOURCE%/*}/.common.sh"
-signal_proc STOP 'portool daily'
+++ /dev/null
-app.server.tomcat.legacy.cleanup.enabled=false
+++ /dev/null
-#
-# See: https://github.com/liferay/liferay-frontend-guidelines/blob/master/dxp/environment.md
-#
-
-# Comment this out to make use of https://github.com/liferay/liferay-binaries-cache-2020
-#build.binaries.cache.dir=
-
-jsp.precompile=off
-
-nodejs.node.env=development
-
-# We don't want multiple daemons running, each using ~7GB of memory.
-org.gradle.daemon=false
-
-# Via: https://liferay.slack.com/archives/C04D8HMEF/p1585342379023600?thread_ts=1585330554.015400&cid=C04D8HMEF
-gradle.stop.daemon.enabled=true
+++ /dev/null
-jdbc.default.driverClassName=com.mysql.cj.jdbc.Driver
-jdbc.default.url=jdbc:mysql://localhost/__DB__?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
-jdbc.default.username=root
-jdbc.default.password=
-
-# See: https://github.com/liferay/liferay-frontend-guidelines/blob/master/dxp/environment.md
-browser.launcher.url=
-com.liferay.portal.servlet.filters.alloy.CSSFilter=false
-com.liferay.portal.servlet.filters.cache.CacheFilter=false
-com.liferay.portal.servlet.filters.etag.ETagFilter=false
-com.liferay.portal.servlet.filters.header.HeaderFilter=false
-com.liferay.portal.servlet.filters.themepreview.ThemePreviewFilter=true
-combo.check.timestamp=true
-javascript.fast.load=false
-javascript.log.enabled=false
-layout.template.cache.enabled=false
-minifier.enabled=false
-module.framework.properties.osgi.console=localhost:__GOGOSHELL_PORT__
-schema.module.build.auto.upgrade=true
-session.timeout.auto.extend=true
-
-#
-# Session timeout in minutes.
-# Note: will be overridden by whatever is in:
-# - $TOMCAT/conf/web.xml
-# - $TOMCAT/webapps/ROOT/WEB-INF/web.xml
-#
-session.timeout=100000
-
-theme.css.fast.load.check.request.parameter=true
-theme.css.fast.load=false
-theme.images.fast.load.check.request.parameter=true
-theme.images.fast.load=false
-tunnel.servlet.hosts.allowed=0:0:0:0:0:0:0:1
-
-# Uncomment this to enable the "deployFast" task (works for CSS, JS, JSP only):
-#
-# gradlew deploy # initial deploy
-# gradlew deployFast -at # subsequent changes
-#
-work.dir.override.enabled=true
-
-# Extras:
-module.framework.properties.initial.system.check.enabled=true
-
-# Examples things you might want to comment out:
-#editor.wysiwyg.portal-web.docroot.html.portlet.blogs.edit_entry.jsp=ckeditor
+++ /dev/null
-jdbc.default.driverClassName=com.mysql.cj.jdbc.Driver
-jdbc.default.url=jdbc:mysql://localhost/__DB__?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
-jdbc.default.username=root
-jdbc.default.password=
-
-# See: https://github.com/liferay/liferay-frontend-guidelines/blob/master/dxp/environment.md
-browser.launcher.url=
-com.liferay.portal.servlet.filters.gzip.GZipFilter=true
-gzip.compression.level=1
-
-#
-# Session timeout in minutes.
-# Note: will be overridden by whatever is in:
-# - $TOMCAT/conf/web.xml
-# - $TOMCAT/webapps/ROOT/WEB-INF/web.xml
-#
-session.timeout=100000
-
-session.timeout.auto.extend=true
-tunnel.servlet.hosts.allowed=0:0:0:0:0:0:0:1
-
-# Examples things you might want to comment out:
-#editor.wysiwyg.portal-web.docroot.html.portlet.blogs.edit_entry.jsp=ckeditor
+++ /dev/null
-#!/bin/sh
-
-PIDS=$(pgrep -f '/usr/local/bin/ant all')
-
-if [ -z "$PIDS" ]; then
- echo "error: \`ant all\` is not running - nothing to renice"
- exit 1
-fi
-
-for PID in $PIDS; do
- GROUP=$(ps -p "$PID" -o pgid | sed 1d)
- if [ -z "$GROUP" ]; then
- echo "error: unable to determine process group of process $PID"
- exit 1
- fi
- echo "Renicing process group $GROUP of process $PID"
- renice 20 -g "$GROUP"
-done
+++ /dev/null
-#!/bin/sh
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-BUNDLES="$HOME/code/portal/bundles"
-
-set -e
-
-$BUNDLES/$TOMCAT/bin/catalina.sh stop 30
-$BUNDLES/$TOMCAT/bin/catalina.sh run
+++ /dev/null
-#!/bin/bash
-
-source "${BASH_SOURCE%/*}/.common.sh"
-signal_proc CONT 'portool daily'
+++ /dev/null
-#!/bin/bash
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-PROPERTIES=$PORTAL_BUNDLES/portal-ext.properties
-
-case "$1" in
- b|bu|bun|bund|bundl|bundle)
- if [[ $PWD = $HOME/code/* || $PWD != */bundles ]]; then
- echo "🛑 Refusing to run: we don't seem to be in a bundles/ directory downloaded with ci:bundle"
- exit 1
- fi
-
- DB=lportal_bundle
-
- echo "☠️ Deleting db ($DB)..."
- echo "set foreign_key_checks=1;" | (echo "select concat('drop table if exists ', table_name, ';') from information_schema.tables where table_schema='$DB';" | mysql -u root -B | tail -n +2 && cat;) | (echo "set foreign_key_checks=0;" && cat;) | mysql -u root "$DB"
-
- echo "🔎 Launching tomcat with bundle settings"
- PORTAL_BUNDLES=$PWD
- TOMCAT=$(find tomcat-* -name catalina.sh | head -1 | sed -e "s#/.*##")
- if [ -z "$TOMCAT" ]; then
- echo "error: failed to find catalina.sh"
- exit 1
- fi
- SOURCE=~/code/portal/bundles/portal-ext.properties.bundle
- ln -sf "$SOURCE" portal-ext.properties
- ;;
- dev|deve|devel|develo|develop|developm|developme|developmen|development)
- echo "🐢 Launching tomcat with dev settings"
- ln -sf "$PORTAL_BUNDLES/portal-ext.properties.dev" "$PROPERTIES"
- ;;
- prod|produ|produc|product|producti|productio|production)
- echo "🏎 Launching tomcat with prod settings"
- ln -sf "$PORTAL_BUNDLES/portal-ext.properties.prod" "$PROPERTIES"
- ;;
- *)
- if [ -L "$PROPERTIES" ]; then
- PROPERTIES=$(readlink "$PROPERTIES")
- fi
- echo "No explicit dev|prod argument: launching with $PROPERTIES"
- ;;
-esac
-
-$PORTAL_BUNDLES/$TOMCAT/bin/catalina.sh run
+++ /dev/null
-run
\ No newline at end of file
+++ /dev/null
-#!/bin/bash
-
-# "Installs" a copy of liferay-portal config files.
-
-set -e
-
-TEMPLATES="${BASH_SOURCE%/*}/properties"
-PORTAL="$HOME/code/portal/liferay-portal"
-PORTAL_BUNDLES="$HOME/code/portal/bundles"
-MASTER="$HOME/code/portal-master/liferay-portal"
-MASTER_BUNDLES="$HOME/code/portal-master/bundles"
-
-template() {
- SOURCE=$1; shift
- DEST=$1; shift
-
- FILTER=''
-
- while(($#)) ; do
- PATTERN=$1; shift
- REPLACEMENT=$1; shift
- FILTER+="s/$PATTERN/$REPLACEMENT/;"
- done
-
- cat <(echo "# vim: set nomodifiable : edit $SOURCE instead then run \`portool setup\`, or use \`:set modifiable\` to force."; echo) <(sed -e "$FILTER" "$SOURCE") > "$DEST"
-}
-
-#
-# Universal set-up
-#
-
-mkdir -p "$MASTER" "$MASTER_BUNDLES" "$PORTAL" "$PORTAL_BUNDLES"
-
-portool config add \
- com.liferay.portal.search.elasticsearch7.configuration.ElasticsearchConfiguration.config
-
-#
-# ~/code/portal/liferay-portal
-#
-
-VARS=(
- __DB__ lportal_master
- __GOGOSHELL_PORT__ 11311
-)
-
-template \
- "$TEMPLATES/portal-ext.properties.dev" \
- "$PORTAL_BUNDLES/portal-ext.properties.dev" \
- "${VARS[@]}"
-
-template \
- "$TEMPLATES/portal-ext.properties.prod" \
- "$PORTAL_BUNDLES/portal-ext.properties.prod" \
- "${VARS[@]}"
-
-ln -sf "$PORTAL_BUNDLES/portal-ext.properties.dev" "$PORTAL_BUNDLES/portal-ext.properties"
-
-template "$TEMPLATES/app.server.properties" "$PORTAL/app.server.$USER.properties"
-
-template "$TEMPLATES/build.properties" "$PORTAL/build.$USER.properties"
-
-#
-# ~/code/portal-master/liferay-portal
-#
-
-VARS=(
- __DB__ lportal2_master
- __GOGOSHELL_PORT__ 11312
-)
-
-template \
- "$TEMPLATES/portal-ext.properties.dev" \
- "$MASTER_BUNDLES/portal-ext.properties.dev" \
- "${VARS[@]}"
-
-template \
- "$TEMPLATES/portal-ext.properties.prod" \
- "$MASTER_BUNDLES/portal-ext.properties.prod" \
- "${VARS[@]}"
-
-ln -sf "$MASTER_BUNDLES/portal-ext.properties.dev" "$MASTER_BUNDLES/portal-ext.properties"
-
-template "$TEMPLATES/app.server.properties" "$MASTER/app.server.$USER.properties"
-
-template "$TEMPLATES/build.properties" "$MASTER/build.$USER.properties"
-
-#
-# ci:test:bundle artifacts
-#
-
-VARS=(
- __DB__ lportal_bundle
- __GOGOSHELL_PORT__ 11313
-)
-
-template \
- "$TEMPLATES/portal-ext.properties.prod" \
- "$PORTAL_BUNDLES/portal-ext.properties.bundle" \
- "${VARS[@]}"
+++ /dev/null
-#!/bin/bash
-
-echo "🖌 Running \"gradlew formatSource -a\""
-
-gradlew formatSource -a
+++ /dev/null
-#!/bin/zsh
-
-# Report what's going on in each repo.
-
-autoload colors
-colors
-
-if [ "$1" = 'verbose' ]; then
- VERBOSE=1
-else
- echo "Run as \`portool status verbose\` to see more detailed output"
- echo
- VERBOSE=0
-fi
-
-for REPO in \
- ~/code/portal/liferay-portal \
- ~/code/portal-master/liferay-portal \
- ~/code/portal-ee/liferay-portal-ee
-do
- echo "${bold_color}Repo status for $(basename $(dirname $REPO)):${reset_color}"
- echo
-
- echo -n " ${fg_bold[cyan]}HEAD${reset_color}: "
- git -C $REPO describe --tags --always
- echo
-
- if [ $VERBOSE -eq 1 ]; then
- SHOW_UNTRACKED="-unormal"
- else
- # This is significantly faster, which is why it is the default.
- SHOW_UNTRACKED="-uno"
- fi
-
- git -C $REPO --no-pager -c color.ui=always status "$SHOW_UNTRACKED" -s -b | sed 's/^/ /'
-
- echo
-
- echo " Tomcat PID: $(pgrep -o -f "Dcatalina.base=$(dirname $REPO)/bundles/tomcat" || echo Not running)"
- echo
-done
+++ /dev/null
-#!/bin/sh
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-BUNDLES="$HOME/code/portal/bundles"
-
-$BUNDLES/$TOMCAT/bin/catalina.sh stop 30
+++ /dev/null
-#!/bin/sh
-
-# Tail the daily build log, specifically the portal-ee build log, because you
-# already see the non-ee build output whenever you run `portool daily`.
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-# "Never" give up (> 2 ** 100).
-ATTEMPTS=100
-
-EE=$HOME/code/portal-ee/liferay-portal-ee/ant-portal-ee.out
-MASTER=$HOME/code/portal-master/liferay-portal/ant-master.out
-PORTAL=$HOME/code/portal/liferay-portal/ant-portal.out
-
-if [ $# -eq 0 ]; then
- if [[ $PWD = $HOME/code/portal-ee* ]]; then
- LOG=$EE
- elif [[ $PWD = $HOME/code/portal-master* ]]; then
- LOG=$MASTER
- else
- LOG=$PORTAL
- fi
-elif [ $# -eq 1 ]; then
- case "$1" in
- ee)
- LOG=$EE
- ;;
- master)
- LOG=$MASTER
- ;;
- portal)
- LOG=$PORTAL
- ;;
- *)
- echo "Unrecognized target \"$1\" not in: portal | master | ee"
- exit 1
- ;;
- esac
-else
- echo "Expected 0 or 1 arguments: portal | master | ee"
- exit 1
-fi
-
-backoff tail -F "$LOG"
+++ /dev/null
-tail
\ No newline at end of file
+++ /dev/null
-#!/bin/sh
-
-# Run all tests.
-
-# Get the last parameter (the directory, from xargs) with "${!#}":
-# https://stackoverflow.com/questions/1215538/extract-parameters-before-last-parameter-in
-#
-# Get the other parameters with "$0 ${@:1:$#-1}":
-# https://stackoverflow.com/questions/37624085/delete-final-positional-argument-from-command-in-bash
-#
-# Use `xargs -o` to allow interaction (eg. for `portool test --watch`):
-# https://unix.stackexchange.com/questions/44426/xargs-and-vi-input-is-not-from-a-terminal
-git grep -l '"test": ".*liferay-npm-scripts test.*"' -- '*/package.json' package.json | \
- xargs -n 1 dirname | \
- xargs -n 1 -o bash -c 'cd ${!#} && yarn test $0 "${@:1:$#-1}"' "$@"
+++ /dev/null
-run
\ No newline at end of file
+++ /dev/null
-#!/bin/sh
-
-# TODO: error if not in a module directory
-# TODO: error if work.dir.override.enabled=true isn't in effect
-gradlew deploy && gradlew deployFast -at
+++ /dev/null
-#!/bin/bash
-
-# Run `yarn` using the liferay-portal version of node.
-
-source "${BASH_SOURCE%/*}/.common.sh"
-
-NODE_BINDIR=$(node_path)
-YARN_DIR=$(realpath "$NODE_BINDIR/../lib/node_modules/yarn")
-
-if [ -d "$YARN_DIR" ]; then
- YARN_EXE=$(find "$YARN_DIR" -name 'yarn-*.js' | head -1)
- if [ -f "$YARN_EXE" ]; then
- echo "info: using $YARN_EXE" >&2
- else
- YARN_EXE=$(command -v yarn)
- echo "warning: could not find yarn executable; falling back to global $YARN_EXE" >&2
- fi
-else
- YARN_EXE=$(command -v yarn)
- echo "warning: could not find yarn executable; falling back to global $YARN_EXE" >&2
-fi
-
-env PATH="$NODE_BINDIR:$PATH" node "$YARN_EXE" "$@"
+++ /dev/null
-append_path $HOME/.zsh/liferay/bin
-
-if [ -d ~/Library/PackageManager/bin ]; then
- append_path $HOME/Library/PackageManager/bin
-fi
-
-export PATH
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git hg
zstyle ':vcs_info:*' check-for-changes true
-zstyle ':vcs_info:*' disable-patterns "${(b)HOME}/code/(portal|portal-ee|portal-master)(|/*)"
zstyle ':vcs_info:*' stagedstr "%F{green}●%f" # default 'S'
zstyle ':vcs_info:*' unstagedstr "%F{red}●%f" # default 'U'
zstyle ':vcs_info:*' use-simple true
+++ /dev/null
-# <%= variables.figManaged %>
-# Base settings (from ~/.zsh/exports):
-#
-# export ANT_OPTS="-Xmx4096m -Xms4096m -XX:MaxPermSize=1024m -XX:-UseGCOverheadLimit -Dorg.gradle.workers.max=4"
-# export GRADLE_OPTS="-Dorg.gradle.workers.max=4"
-# export JAVA_OPTS="-Xmx4096m -Xms1024m -XX:MaxPermSize=512m"
-#
-# Apply overrides to make builds work better.
-#
-# On the role of `GRADLE_OPTS`:
-#
-# > Specifies JVM arguments to use when starting the Gradle client
-# > VM. The client VM only handles command line input/output, so it is rare
-# > that one would need to change its VM options. The actual build is run by
-# > the Gradle daemon, which is not affected by this environment variable.
-# >
-# > There is one case where the client VM can also serve as the build
-# > VM: If you deactivate the Gradle Daemon and the client VM has the same
-# > settings as required for the build VM, the client VM will run the build
-# > directly. Otherwise the client VM will fork a new VM to run the actual
-# > build in order to honor the different settings.
-#
-# @see https://docs.gradle.org/current/userguide/build_environment.html
-# @see https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory
-#
-# In short, `GRADLE_OPTS` shouldn't affect `ant all` performance, but
-# there's a chance it could still be relevant when running Gradle
-# directly, so I'm overwriting and `JAVA_OPTS` as well.
-#
-# Gotcha in all this: the default `org.gradle.jvmargs` value set in:
-#
-# https://github.com/liferay/liferay-portal/blob/master/build.properties
-#
-# Can get cached into `gradle/gradle.properties`, and if that happens, variables
-# set in the environment won't have any effect.
-#
-export ANT_OPTS="-Xmx<%= variables.antXmx %> -Xms<%= variables.antXms %> -XX:MaxPermSize=<%= variables.antMaxPermSize %> -XX:-UseGCOverheadLimit -Dorg.gradle.jvmargs='-Xmx<%= variables.gradleXmx %> -Xms<%= variables.gradleXms %>' -Dorg.gradle.workers.max=<%= variables.gradleWorkersMax %>"
-export GRADLE_OPTS="-Xmx<%= variables.gradleXmx %> -Xms<%= variables.gradleXms %> -XX:MaxPermSize=<%= variables.gradleMaxPermSize %> -XX:-UseGCOverheadLimit -Dorg.gradle.jvmargs='-Xmx<%= variables.gradleXmx %> -Xms<%= variables.gradleXms %>' -Dorg.gradle.workers.max=<%= variables.gradleWorkersMax %>"
-export JAVA_OPTS="-Xmx<%= variables.javaXmx %> -Xms<%= variables.javaXms %> -XX:MaxPermSize=<%= variables.javaMaxPermSize %> -XX:-UseGCOverheadLimit -Dorg.gradle.jvmargs='-Xmx<%= variables.gradleXmx %> -Xms<%= variables.gradleXms %>' -Dorg.gradle.workers.max=<%= variables.gradleWorkersMax %>"
-
-# Recommend settings from https://github.com/julien/notes/blob/master/portal.md
-#
-# CATALINA_OPTS=
-# $CATALINA_OPTS
-# -Dfile.encoding=UTF8
-# -Djava.net.preferIPv4Stack=true
-# -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
-# -Duser.timezone=GMT
-# -Xms4096m
-# -Xmx4096m
-# -XX:MaxNewSize=2048m
-# -XX:MaxMetaspaceSize=768m
-# -XX:MetaspaceSize=768m
-# -XX:NewSize=2560m
-# -XX:SurvivorRatio=7
-#
-# Out-of-thebox 9.0.10 opts:
-#
-# CATALINA_OPTS=
-# $CATALINA_OPTS
-# -Dfile.encoding=UTF8
-# -Djava.net.preferIPv4Stack=true
-# -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
-# -Duser.timezone=GMT
-# -Xms2560m
-# -Xmx2560m
-# -XX:MaxNewSize=1536m
-# -XX:MaxMetaspaceSize=512m
-# -XX:MetaspaceSize=512m
-# -XX:NewSize=1536m
-# -XX:SurvivorRatio=7
-#
-# Out-of-the-box 9.0.17 opts:
-#
-# CATALINA_OPTS=
-# $CATALINA_OPTS
-# -Dfile.encoding=UTF8
-# -Djava.net.preferIPv4Stack=true
-# -Duser.timezone=GMT
-# -Xms2560m
-# -Xmx2560m
-# -XX:MaxNewSize=1536m
-# -XX:MaxMetaspaceSize=512m
-# -XX:MetaspaceSize=512m
-# -XX:NewSize=1536m
-# -XX:SurvivorRatio=7
-#
-# Opts we're actually using:
-#
-# -XX:MaxNewSize=2048m -> 2560m to avoid:
-#
-# NewSize (2621440k) is greater than the MaxNewSize (2097152k). A new
-# max generation size of 2621440k will be used.
-#
-# -Djava.net.preferIPv4Stack=true -> false, to listen on IPv6 (http://[::1]:8080)
-#
-CATALINA_OPTS="-Dfile.encoding=UTF8"
-CATALINA_OPTS="${CATALINA_OPTS} -Djava.net.preferIPv4Stack=false"
-CATALINA_OPTS="${CATALINA_OPTS} -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false"
-CATALINA_OPTS="${CATALINA_OPTS} -Duser.timezone=GMT"
-CATALINA_OPTS="${CATALINA_OPTS} -Xms4096m"
-CATALINA_OPTS="${CATALINA_OPTS} -Xmx4096m"
-CATALINA_OPTS="${CATALINA_OPTS} -XX:MaxNewSize=2560m"
-CATALINA_OPTS="${CATALINA_OPTS} -XX:MaxMetaspaceSize=768m"
-CATALINA_OPTS="${CATALINA_OPTS} -XX:MetaspaceSize=768m"
-CATALINA_OPTS="${CATALINA_OPTS} -XX:NewSize=2560m"
-CATALINA_OPTS="${CATALINA_OPTS} -XX:SurvivorRatio=7"
-
-export CATALINA_OPTS
# <%= variables.figManaged %>
root = true
-
-[<%= variables.home %>/code/{portal,portal-ee,portal-master}/**]
-insert_final_newline = false
-indent_size = 4
-indent_style = tab
-
-[<%= variables.home %>/code/{portal,portal-ee,portal-master}/**.{js,scss,ts,tsx}]
-insert_final_newline = true
-indent_size = 4
-indent_style = tab
-
-[<%= variables.home %>/code/{portal,portal-ee,portal-master}/**/package.json]
-insert_final_newline = true
-indent_size = 4
-indent_style = tab
-
-[<%= variables.home %>/code/{alloy-editor,*-liferay,liferay-*}/**.{js,json,scss,ts,tsx}]
-indent_size = 4
-indent_style = tab
// TODO: `sudo npm install -g n`
// TODO: `export N_PREFIX=~`
-// TODO: run `n 10.15.1`
-// TODO: sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql --auth-root-authentication-method=normal
-// systemctl enable mariadb
-// systemctl start mariadb
-// mkdir -p code/portal
-// cd !$
-// git clone https://github.com/liferay/liferay-portal.git
-// git clone https://github.com/liferay/liferay-binaries-cache-2020.git
-// cd liferay-portal
-// portool setup
-// portool build
+// TODO: run `n ??.??.??`
task('create suspend hook', async () => {
await file({
+++ /dev/null
-// ==UserScript==
-// @name Stop accidental liferay/liferay-portal PRs
-// @namespace https://wincent.com/
-// @version 0.9
-// @description Stop accidental liferay/liferay-portal PRs
-// @author Greg Hurrell <greg@hurrell.net>
-// @match https://github.com/liferay/liferay-portal/compare/*
-// @grant none
-// @downloadURL http://localhost/~<%= variables.username %>/UserScripts/github/stopAccidentalPRs.user.js
-// @updateURL http://localhost/~<%= variables.username %>/UserScripts/github/stopAccidentalPRs.user.js
-// ==/UserScript==
-
-(function () {
- 'use strict';
-
- const observer = new MutationObserver((_mutationList) => {
- const button = document.querySelector('.js-pull-request-button');
- if (button && !button.disabled) {
- button.title =
- 'Disabled to prevent accident pull requests to this user';
- button.disabled = true;
- }
- });
-
- observer.observe(document.body, {
- attributes: true,
- childList: true,
- subtree: true,
- });
-})();
-
-// <%= variables.figManaged %>
if (type(s:package_data) == v:t_dict)
if has_key(s:package_data, 'scripts')
let s:scripts=s:package_data['scripts']
- if has_key(s:scripts, 'checkFormat') &&
- \ stridx(s:scripts['checkFormat'], 'liferay-npm-scripts') == 0
- let s:lint='yarn\ run\ liferay-npm-scripts\ lint\ --format\ stylish'
- elseif has_key(s:scripts, 'lint')
+ if has_key(s:scripts, 'lint')
let s:lint='yarn\ lint\ --format\ stylish'
endif
endif
\ 'type': 'test'
\ }])
endfor
-
-" Provide config for repos where I:
-"
-" - want special config
-" - don't want to (or can't) commit a custom ".projections.json" file
-" - can't set useful heuristics based on what's in the root directory
-"
-function! s:UpdateProjections()
- let l:cwd=getcwd()
- if l:cwd == expand('~/code/liferay-npm-tools')
- for l:pkg in glob('packages/*', 0, 1)
- call s:project(
- \ [l:pkg . '/src/*.js', {
- \ 'alternate': l:pkg . '/test/{}.js',
- \ 'type': 'source'
- \ }],
- \ [l:pkg . '/test/*.js', {
- \ 'alternate': l:pkg . '/src/{}.js',
- \ 'type': 'test'
- \ }])
- endfor
- endif
-endfunction
-
-call s:UpdateProjections()
-
-if has('autocmd') && exists('#DirChanged')
- augroup WincentProjectionist
- autocmd!
- autocmd DirChanged * call <SID>UpdateProjections()
- augroup END
-endif
+++ /dev/null
-function! wincent#liferay#deploy() abort
- let l:dir=expand('%:h:S')
- if l:dir == ''
- let l:dir=getcwd()
- end
- if exists(':terminal')
- autocmd TermOpen * ++once setlocal nobuflisted | execute "normal! G \<c-w>p"
- execute 'split +terminal\ cd\ ' . substitute(l:dir, ' ', '\\ ', 'g') . '\ &&\ portool\ deploy'
- else
- execute '!cd ' . l:dir . ' && portool deploy'
- endif
-endfunction
+++ /dev/null
-nnoremap <LocalLeader>d :call wincent#liferay#deploy()<CR>
"license": "Unlicense",
"scripts": {
"ci": "yarn format:check",
- "format:check": "npx prettier --check \"**/*.{js,json,md,ts}\" \"*.{md,ts}\" aspects/dotfiles/files/.zsh/liferay/bin/portool",
- "format": "npx prettier --write \"**/*.{js,json,md,ts}\" \"*.{md,ts}\" aspects/dotfiles/files/.zsh/liferay/bin/portool"
+ "format:check": "npx prettier --check \"**/*.{js,json,md,ts}\" \"*.{md,ts}\"",
+ "format": "npx prettier --write \"**/*.{js,json,md,ts}\" \"*.{md,ts}\""
},
"type": "module",
"dependencies": {