Skip to content

Commit

Permalink
support-firecloud -> yplatform
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau committed Feb 2, 2022
1 parent d5c011d commit b0f9250
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
5 changes: 5 additions & 0 deletions .git-hooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -euo pipefail

YP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../yplatform" && pwd)"
${YP_DIR}/bin/git-hook-run-parts "$0" "$@"
5 changes: 5 additions & 0 deletions .git-hooks/pre-push.d/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[00.make-check]
indent_size = 4

[10.git-lfs]
indent_size = 4
5 changes: 5 additions & 0 deletions .git-hooks/pre-push.d/00-make-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

cat - >/dev/null # consume stdin

make check
6 changes: 6 additions & 0 deletions .git-hooks/pre-push.d/10-git-lfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

# handle no git-lfs
command -v git-lfs >/dev/null 2>&1 || exit 0

cat - | git lfs pre-push "$@"
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
name: 'main-node-${{ matrix.node }}'
runs-on: ubuntu-latest
container:
image: 'rokmoln/sf-ubuntu-bionic-minimal:0.2.133'
image: 'rokmoln/sf-ubuntu-bionic-minimal:0.3.27'
options: '--user sf:sf'
env:
GITHUB_JOB_NAME: 'main-node-${{ matrix.node }}'
Expand All @@ -38,7 +38,7 @@ jobs:
SF_PRINTENV_BOOTSTRAP: '${{ secrets.SF_PRINTENV_BOOTSTRAP }}'
V: '${{ secrets.V }}'
steps:
- uses: rokmoln/support-firecloud@v0.2.133
- uses: rokmoln/support-firecloud@v0.3.27
with:
run: |
sudo chown sf:sf ${GITHUB_WORKSPACE} # owned by 1001:116 otherwise
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
set -euo pipefail

GIT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
SUPPORT_FIRECLOUD_DIR="$(cd "${GIT_ROOT}/support-firecloud" && pwd)"
YP_DIR="$(cd "${GIT_ROOT}/yplatform" && pwd)"

SRC_FILE=.github/workflows.src/main.yml

export ENVSUBST_SF_VSN=$(cat ${SUPPORT_FIRECLOUD_DIR}/package.json | jq -r ".version")
export ENVSUBST_SF_VSN=$(cat ${YP_DIR}/package.json | jq -r ".version")

echo "# WARNING: DO NOT EDIT. AUTO-GENERATED CODE (${SRC_FILE})"
cat ${GIT_ROOT}/${SRC_FILE} | \
envsubst "$(printenv | grep "^ENVSUBST_" | sed "s/=.*//g" | sed "s/^/\${/g" | sed "s/\$/}/g")" | \
${SUPPORT_FIRECLOUD_DIR}/bin/yaml-expand
${YP_DIR}/bin/yaml-expand
2 changes: 1 addition & 1 deletion .npmrc
2 changes: 1 addition & 1 deletion .shellcheckrc
2 changes: 1 addition & 1 deletion .vscode/.editorconfig
2 changes: 1 addition & 1 deletion .vscode/extensions.json
2 changes: 1 addition & 1 deletion .vscode/settings.json
2 changes: 1 addition & 1 deletion .vscode/tasks.json
2 changes: 1 addition & 1 deletion Brewfile.lock
41 changes: 23 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
ifeq (,$(wildcard support-firecloud/Makefile))
INSTALL_SUPPORT_FIRECLOUD := $(shell git submodule update --init --recursive support-firecloud)
ifeq (,$(wildcard yplatform/Makefile))
INSTALL_SUPPORT_FIRECLOUD := $(shell git submodule update --init --recursive yplatform)
ifneq (,$(filter undefine,$(.FEATURES)))
undefine INSTALL_SUPPORT_FIRECLOUD
endif
endif

include support-firecloud/build.mk/generic.common.mk
include support-firecloud/build.mk/sh.check.shellcheck.mk
include support-firecloud/build.mk/node.common.mk
include support-firecloud/build.mk/js.check.eslint.mk
include support-firecloud/build.mk/core.misc.release.npg.mk
include yplatform/build.mk/generic.common.mk
include yplatform/build.mk/sh.check.shellcheck.mk
include yplatform/build.mk/node.common.mk
include yplatform/build.mk/js.check.eslint.mk
include yplatform/build.mk/core.misc.release.npg.mk

# ------------------------------------------------------------------------------

Expand All @@ -19,11 +19,12 @@ JS_RULE_FILES := $(shell $(FIND_Q) rules -type f -name "*.js" -print)
JS_RULE_FILES := $(filter-out rules/index.js,$(JS_RULE_FILES))
JS_RULE_TEST_FILES := $(shell $(FIND_Q) test -type f -name "*.test.js" -print)

SF_VENDOR_FILES_IGNORE += \
YP_VENDOR_FILES_IGNORE += \
-e "^\.github/workflows/main\.yml$$" \
-e "^configs/index\.js$$" \
-e "^rules/index\.js$$" \

SF_ECLINT_FILES_IGNORE += \
YP_ECLINT_FILES_IGNORE += \
-e "^rules/.*\.original\.js$$" \
-e "^rules/array-bracket-newline\.js$$" \
-e "^rules/array-element-newline\.js$$" \
Expand All @@ -39,31 +40,35 @@ SF_ECLINT_FILES_IGNORE += \
-e "^test/object-property-newline\.test\.js$$" \
-e "^test/order-imports\.test\.js$$" \

SF_DEPS_TARGETS += \
YP_DEPS_TARGETS += \
.github/workflows/main.yml \
configs/index.js \
rules/index.js \

SF_CHECK_TPL_FILES += \
YP_CHECK_TPL_FILES += \
.github/workflows/main.yml \
configs/index.js \
rules/index.js \

SF_TEST_TARGETS += \
YP_TEST_TARGETS += \
test-rules \

# ------------------------------------------------------------------------------

.github/workflows/main.yml: .github/workflows/main.yml.tpl .github/workflows.src/main.yml support-firecloud/package.json
$(call sf-generate-from-template)
.github/workflows/main.yml: yplatform/package.json
.github/workflows/main.yml: $(wildcard .github/workflows.src/main*)
.github/workflows/main.yml: .github/workflows/main.yml.tpl
$(call yp-generate-from-template)


configs/index.js: configs/tpl.index.js $(JS_CONFIG_FILES)
$(call sf-generate-from-template)
configs/index.js: $(JS_CONFIG_FILES)
configs/index.js: configs/tpl.index.js
$(call yp-generate-from-template)


rules/index.js: rules/tpl.index.js $(JS_RULE_FILES)
$(call sf-generate-from-template)
rules/index.js: $(JS_RULE_FILES)
rules/index.js: rules/tpl.index.js
$(call yp-generate-from-template)


.PHONY: test-rules
Expand Down

0 comments on commit b0f9250

Please sign in to comment.