[TASK] Test fully built css in bamboo 88/58788/5
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 30 Oct 2018 08:28:11 +0000 (09:28 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Tue, 30 Oct 2018 12:25:27 +0000 (13:25 +0100)
Extend the "Lint scss ts" bamboo job to also build css
next to js and only after that verify with git status
no file changed. This should prevent outdated css as
recently fixed with #86789.
Additionally switch from npm to direct grunt calls,
to be in sync with runTests.sh and to allow kicking
npm from the docker images entirely.

Change-Id: I5134d43c5f5d524005242eee59aa743b6e49219a
Resolves: #86794
Related: #86789
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/58788
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Build/bamboo/src/main/java/core/AbstractCoreSpec.java

index a90b750..981273c 100644 (file)
@@ -1094,7 +1094,7 @@ abstract public class AbstractCoreSpec {
      */
     protected Job getJobLintScssTs(String requirementIdentifier) {
         return new Job("Lint scss ts", new BambooKey("LSTS"))
-            .description("Run npm lint, run npm run build-js")
+            .description("Lint scss and ts, build css and js, test git is clean")
             .pluginConfigurations(this.getDefaultJobPluginConfiguration())
             .tasks(
                 this.getTaskGitCloneRepository(),
@@ -1119,11 +1119,11 @@ abstract public class AbstractCoreSpec {
                         "yarn install"
                     ),
                 new ScriptTask()
-                    .description("Run npm lint")
+                    .description("Run grunt lint")
                     .interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
                     .inlineBody(
                         this.getScriptTaskBashInlineBody() +
-                        "function npm() {\n" +
+                        "function grunt() {\n" +
                         "    docker run \\\n" +
                         "        -u ${HOST_UID} \\\n" +
                         "        -v /bamboo-data/${BAMBOO_COMPOSE_PROJECT_NAME}/passwd:/etc/passwd \\\n" +
@@ -1132,17 +1132,17 @@ abstract public class AbstractCoreSpec {
                         "        --name ${BAMBOO_COMPOSE_PROJECT_NAME}sib_adhoc \\\n" +
                         "        --rm \\\n" +
                         "        typo3gmbh/" + requirementIdentifier.toLowerCase() + ":latest \\\n" +
-                        "        bin/bash -c \"cd ${PWD}/Build; npm $*\"\n" +
+                        "        bin/bash -c \"cd ${PWD}/Build; ./node_modules/grunt/bin/grunt $*\"\n" +
                         "}\n" +
                         "\n" +
-                        "npm run lint"
+                        "grunt lint"
                     ),
                 new ScriptTask()
-                    .description("Run npm build-js")
+                    .description("Run grunt scripts")
                     .interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
                     .inlineBody(
                         this.getScriptTaskBashInlineBody() +
-                        "function npm() {\n" +
+                        "function grunt() {\n" +
                         "    docker run \\\n" +
                         "        -u ${HOST_UID} \\\n" +
                         "        -v /bamboo-data/${BAMBOO_COMPOSE_PROJECT_NAME}/passwd:/etc/passwd \\\n" +
@@ -1151,10 +1151,29 @@ abstract public class AbstractCoreSpec {
                         "        --name ${BAMBOO_COMPOSE_PROJECT_NAME}sib_adhoc \\\n" +
                         "        --rm \\\n" +
                         "        typo3gmbh/" + requirementIdentifier.toLowerCase() + ":latest \\\n" +
-                        "        bin/bash -c \"cd ${PWD}/Build; npm $*\"\n" +
+                        "        bin/bash -c \"cd ${PWD}/Build; ./node_modules/grunt/bin/grunt $*\"\n" +
                         "}\n" +
                         "\n" +
-                        "npm run build-js"
+                        "grunt scripts"
+                    ),
+                new ScriptTask()
+                    .description("Run grunt css")
+                    .interpreter(ScriptTaskProperties.Interpreter.BINSH_OR_CMDEXE)
+                    .inlineBody(
+                        this.getScriptTaskBashInlineBody() +
+                        "function grunt() {\n" +
+                        "    docker run \\\n" +
+                        "        -u ${HOST_UID} \\\n" +
+                        "        -v /bamboo-data/${BAMBOO_COMPOSE_PROJECT_NAME}/passwd:/etc/passwd \\\n" +
+                        "        -v ${BAMBOO_COMPOSE_PROJECT_NAME}_bamboo-data:/srv/bamboo/xml-data/build-dir/ \\\n" +
+                        "        -e HOME=${HOME} \\\n" +
+                        "        --name ${BAMBOO_COMPOSE_PROJECT_NAME}sib_adhoc \\\n" +
+                        "        --rm \\\n" +
+                        "        typo3gmbh/" + requirementIdentifier.toLowerCase() + ":latest \\\n" +
+                        "        bin/bash -c \"cd ${PWD}/Build; ./node_modules/grunt/bin/grunt $*\"\n" +
+                        "}\n" +
+                        "\n" +
+                        "grunt css"
                     ),
                 new ScriptTask()
                     .description("git status to check for changed files after build-js")