From 886cdcc21f08d8a453a568c443537bea037d1704 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 12 May 2020 13:51:05 -0500 Subject: [PATCH] Combine javascript deployment and deployment-tarball jobs There's no reason to not just build the tarball when we build the content. Set the default value for node_version in the base job. Change-Id: Ifb3e5138e9ae19ec3de9250f1828fc07230ef739 --- doc/source/js-jobs.rst | 1 - .../tasks/main.yaml | 7 ++++ zuul.d/js-jobs.yaml | 39 ++----------------- 3 files changed, 11 insertions(+), 36 deletions(-) diff --git a/doc/source/js-jobs.rst b/doc/source/js-jobs.rst index a0e345011..a57b7e7aa 100644 --- a/doc/source/js-jobs.rst +++ b/doc/source/js-jobs.rst @@ -3,7 +3,6 @@ Javascript Jobs .. zuul:autojob:: build-javascript-source-tarball .. zuul:autojob:: build-javascript-deployment -.. zuul:autojob:: build-javascript-deployment-tarball .. zuul:autojob:: js-build .. zuul:autojob:: nodejs-run-test .. zuul:autojob:: nodejs-run-test-browser diff --git a/roles/fetch-javascript-content-tarball/tasks/main.yaml b/roles/fetch-javascript-content-tarball/tasks/main.yaml index 1fd5393cb..8730db754 100644 --- a/roles/fetch-javascript-content-tarball/tasks/main.yaml +++ b/roles/fetch-javascript-content-tarball/tasks/main.yaml @@ -1,3 +1,10 @@ +- name: Set create_tarball_directory from javascript_content_directory + set_fact: + create_tarball_directory: '{{ javascript_content_dir }}' + when: + - create_tarball_directory is not defined + - javascript_content_dir is defined + - name: Create tarball shell: "tar czf {{ ansible_user_dir }}/{{ zuul_work_dir }}/build.tgz *" args: diff --git a/zuul.d/js-jobs.yaml b/zuul.d/js-jobs.yaml index c98827195..d3e378d14 100644 --- a/zuul.d/js-jobs.yaml +++ b/zuul.d/js-jobs.yaml @@ -68,7 +68,9 @@ name: build-javascript-deployment parent: js-build description: | - Build javascript web content as it should be deployed. + Build javascript web content as it should be deployed. Publishes + a preview site to build logs as well as a tar archive of + that web content. Responds to these variables: @@ -92,39 +94,6 @@ Directory, relative to zuul_work_dir, holding build content. success-url: npm/html/ - -- job: - name: build-javascript-deployment-tarball - parent: js-build - description: | - Build an archive of javascript web content as it should be deployed. - - Responds to these variables: - - .. zuul:jobvar:: js_build_command - :default: build - - Command to pass to npm. - - .. zuul:jobvar:: node_version - :default: 14 - - The version of Node to use. - - .. zuul:jobvar:: zuul_work_dir - :default: {{ zuul.project.src_dir }} - - Path to operate in. - - .. zuul:jobvar:: javascript_content_dir - :default: dist - - Directory, relative to zuul_work_dir, holding build content. - - .. zuul:jobvar:: create_tarball_directory - - Create a tarball with the contents of - create_tarball_directory (relative to zuul_work_dir). post-run: playbooks/javascript/tarball.yaml - job: @@ -324,7 +293,7 @@ description: | Build an archive of javascript web content as it should be deployed. - ** DEPRECATED: Please use build-javascript-deployment-tarball ** + ** DEPRECATED: Please use build-javascript-deployment ** Responds to these variables: