-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taskfile: Download and set up Meteor.js as part of building the package; Refactor tarball download and extraction into reusable task. #363
Changes from all commits
1a09b0c
6dd6bd2
062fc5c
531c5c7
930ebbe
d3fe1c5
bc7e85f
85409c9
60be034
1a13036
c13f267
5c62bd5
822250d
705b74a
6242a8f
023f7ad
fa2c517
6e0e263
ee73432
aedc2fe
c65e238
f20b158
52883fe
dd2f5b9
8a4b223
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,12 @@ vars: | |
# Paths | ||
G_BUILD_DIR: "{{.ROOT_DIR}}/build" | ||
G_CORE_COMPONENT_BUILD_DIR: "{{.G_BUILD_DIR}}/core" | ||
G_METEOR_BUILD_DIR: "{{.G_BUILD_DIR}}/meteor" | ||
G_PACKAGE_BUILD_DIR: "{{.G_BUILD_DIR}}/clp-package" | ||
G_PACKAGE_VENV_DIR: "{{.G_BUILD_DIR}}/package-venv" | ||
G_WEBUI_BUILD_DIR: "{{.G_BUILD_DIR}}/webui" | ||
G_WEBUI_NODEJS_BUILD_DIR: "{{.G_BUILD_DIR}}/webui-nodejs" | ||
G_WEBUI_NODEJS_BIN_DIR: "{{.G_WEBUI_NODEJS_BUILD_DIR}}/node/bin" | ||
G_WEBUI_NODEJS_BIN_DIR: "{{.G_WEBUI_NODEJS_BUILD_DIR}}/bin" | ||
|
||
# Versions | ||
G_PACKAGE_VERSION: "0.0.3-dev" | ||
|
@@ -170,6 +171,7 @@ tasks: | |
webui: | ||
deps: | ||
- "init" | ||
- "meteor" | ||
- task: "validate-checksum" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
|
@@ -183,20 +185,24 @@ tasks: | |
cmds: | ||
- "rm -rf '{{.OUTPUT_DIR}}'" | ||
- "mkdir -p '{{.OUTPUT_DIR}}'" | ||
- "meteor build --directory '{{.OUTPUT_DIR}}'" | ||
- "PATH='{{.G_METEOR_BUILD_DIR}}':$PATH meteor build --directory '{{.OUTPUT_DIR}}'" | ||
kirkrodrigues marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- >- | ||
rsync -a | ||
"{{.OUTPUT_DIR}}/bundle/" | ||
launcher.js | ||
settings.json | ||
"{{.OUTPUT_DIR}}/" | ||
- "rm -rf '{{.OUTPUT_DIR}}/bundle/'" | ||
# Remove temp files generated by `meteor build` before checksum | ||
- "find node_modules -type f -name '.meteor-portable-2.json' -exec rm {} +" | ||
# This command must be last | ||
- task: "compute-checksum" | ||
vars: | ||
DATA_DIR: "{{.OUTPUT_DIR}}" | ||
OUTPUT_FILE: "{{.CHECKSUM_FILE}}" | ||
sources: | ||
- "{{.G_BUILD_DIR}}/meteor.md5" | ||
- "{{.G_BUILD_DIR}}/webui-node-modules.md5" | ||
- "{{.TASKFILE}}" | ||
- "*" | ||
- ".meteor/*" | ||
|
@@ -207,59 +213,100 @@ tasks: | |
generates: ["{{.CHECKSUM_FILE}}"] | ||
|
||
webui-nodejs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a big deal to leave it since we'll soon clean up the ordering of tasks, but we could move There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's leave it to the future PR then. Earlier I also wanted to move task |
||
internal: true | ||
vars: | ||
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK}}.md5" | ||
OUTPUT_DIR: "{{.G_WEBUI_NODEJS_BUILD_DIR}}" | ||
cmds: | ||
- task: "nodejs" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
NODEJS_VERSION: "v14.21.3" | ||
OUTPUT_DIR: "{{.OUTPUT_DIR}}" | ||
|
||
core-submodules: | ||
internal: true | ||
dir: "components/core" | ||
vars: | ||
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK}}.md5" | ||
OUTPUT_DIR: "submodules" | ||
deps: | ||
- "init" | ||
- task: "validate-checksum" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
DATA_DIR: "{{.OUTPUT_DIR}}" | ||
cmds: | ||
- task: "nodejs" | ||
vars: | ||
NODEJS_VERSION: "v14.21.3" | ||
OUTPUT_DIR: "{{.OUTPUT_DIR}}" | ||
- "tools/scripts/deps-download/download-all.sh" | ||
# This command must be last | ||
- task: "compute-checksum" | ||
vars: | ||
DATA_DIR: "{{.OUTPUT_DIR}}" | ||
OUTPUT_FILE: "{{.CHECKSUM_FILE}}" | ||
sources: | ||
- "{{.TASKFILE}}" | ||
- ".gitmodules" | ||
- "tools/scripts/deps-download/**/*" | ||
generates: ["{{.CHECKSUM_FILE}}"] | ||
|
||
core-submodules: | ||
download-and-extract-tar: | ||
internal: true | ||
dir: "components/core" | ||
requires: | ||
vars: ["CHECKSUM_FILE", "EXTRACTED_DIR_NAME", "TAR_NAME", "OUTPUT_DIR", "URL_PREFIX"] | ||
label: "{{.TASK}}-{{.TAR_NAME}}" | ||
vars: | ||
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK}}.md5" | ||
OUTPUT_DIR: "submodules" | ||
OUTPUT_TMP_DIR: "{{.OUTPUT_DIR}}-tmp" | ||
EXTRACTED_DIR: "{{.OUTPUT_TMP_DIR}}/{{.EXTRACTED_DIR_NAME}}" | ||
TAR_PATH: "{{.OUTPUT_TMP_DIR}}/{{.TAR_NAME}}" | ||
deps: | ||
- "init" | ||
- task: "validate-checksum" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
DATA_DIR: "{{.OUTPUT_DIR}}" | ||
cmds: | ||
- "tools/scripts/deps-download/download-all.sh" | ||
- "rm -rf '{{.OUTPUT_DIR}}' '{{.OUTPUT_TMP_DIR}}'" | ||
- "mkdir -p '{{.OUTPUT_TMP_DIR}}'" | ||
- >- | ||
curl --fail --location --show-error | ||
"{{.URL_PREFIX}}/{{.TAR_NAME}}" | ||
--output "{{.TAR_PATH}}" | ||
- "tar xf '{{.TAR_PATH}}' --directory '{{.OUTPUT_TMP_DIR}}'" | ||
- "mv '{{.EXTRACTED_DIR}}' '{{.OUTPUT_DIR}}'" | ||
- "rm -rf '{{.OUTPUT_TMP_DIR}}'" | ||
# This command must be last | ||
- task: "compute-checksum" | ||
vars: | ||
DATA_DIR: "{{.OUTPUT_DIR}}" | ||
OUTPUT_FILE: "{{.CHECKSUM_FILE}}" | ||
sources: | ||
- "{{.TASKFILE}}" | ||
- ".gitmodules" | ||
- "tools/scripts/deps-download/**/*" | ||
sources: ["{{.TASKFILE}}"] | ||
generates: ["{{.CHECKSUM_FILE}}"] | ||
|
||
meteor: | ||
kirkrodrigues marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: "once" | ||
preconditions: | ||
- sh: >- | ||
(test "$(uname -m)" != "aarch64") || (test "$(uname -s)" != "Linux") | ||
msg: "Meteor 2.x does not support aarch64 on Linux" | ||
vars: | ||
CHECKSUM_FILE: "{{.G_BUILD_DIR}}/{{.TASK}}.md5" | ||
METEOR_ARCH: "{{ if eq ARCH \"arm64\" }}arm64{{ else }}x86_64{{ end }}" | ||
METEOR_PLATFORM: "{{ if eq OS \"darwin\" }}osx{{ else }}linux{{ end }}" | ||
METEOR_RELEASE: "2.15" | ||
cmds: | ||
- task: "download-and-extract-tar" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
EXTRACTED_DIR_NAME: ".meteor" | ||
OUTPUT_DIR: "{{.G_METEOR_BUILD_DIR}}" | ||
TAR_NAME: "meteor-bootstrap-os.{{.METEOR_PLATFORM}}.{{.METEOR_ARCH}}.tar.gz" | ||
URL_PREFIX: "https://static.meteor.com/packages-bootstrap/{{.METEOR_RELEASE}}" | ||
|
||
nodejs: | ||
internal: true | ||
deps: ["init"] | ||
requires: | ||
vars: ["NODEJS_VERSION", "OUTPUT_DIR"] | ||
vars: ["CHECKSUM_FILE", "NODEJS_VERSION", "OUTPUT_DIR"] | ||
vars: | ||
NODEJS_ARCH: "{{ if eq ARCH \"arm64\" }}arm64{{ else }}x64{{ end }}" | ||
NODEJS_VERSION_BASE_URL: "https://nodejs.org/dist/{{.NODEJS_VERSION}}/" | ||
|
@@ -272,19 +319,14 @@ tasks: | |
--max-count 1 | ||
"node-v\\d+\\.\\d+\\.\\d+-linux-{{.NODEJS_ARCH}}" | ||
| head --lines 1 | ||
NODEJS_FILE_TAR_NAME: "{{.NODEJS_FILE_BASE_NAME}}.tar.xz" | ||
cmds: | ||
- "rm -rf '{{.OUTPUT_DIR}}/node'" | ||
- "mkdir -p '{{.OUTPUT_DIR}}'" | ||
- >- | ||
curl -fsSL | ||
"{{.NODEJS_VERSION_BASE_URL}}{{.NODEJS_FILE_TAR_NAME}}" | ||
-o "{{.OUTPUT_DIR}}/{{.NODEJS_FILE_TAR_NAME}}" | ||
- "tar xf '{{.OUTPUT_DIR}}/{{.NODEJS_FILE_TAR_NAME}}' --directory '{{.OUTPUT_DIR}}'" | ||
- >- | ||
mv "{{.OUTPUT_DIR}}/{{.NODEJS_FILE_BASE_NAME}}" | ||
"{{.OUTPUT_DIR}}/node" | ||
- "rm -f '{{.OUTPUT_DIR}}/{{.NODEJS_FILE_TAR_NAME}}'" | ||
- task: "download-and-extract-tar" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
TAR_NAME: "{{.NODEJS_FILE_BASE_NAME}}.tar.xz" | ||
EXTRACTED_DIR_NAME: "{{.NODEJS_FILE_BASE_NAME}}" | ||
URL_PREFIX: "{{.NODEJS_VERSION_BASE_URL}}" | ||
OUTPUT_DIR: "{{.OUTPUT_DIR}}" | ||
|
||
package-venv: | ||
internal: true | ||
|
@@ -355,19 +397,21 @@ tasks: | |
dir: "{{.WEBUI_SRC_DIR}}" | ||
deps: | ||
- "init" | ||
- "meteor" | ||
- task: "validate-checksum" | ||
vars: | ||
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" | ||
DATA_DIR: "{{.OUTPUT_DIR}}" | ||
cmds: | ||
- "rm -rf '{{.OUTPUT_DIR}}'" | ||
- "meteor npm install --production" | ||
- "PATH='{{.G_METEOR_BUILD_DIR}}':$PATH meteor npm install --production" | ||
# This command must be last | ||
- task: "compute-checksum" | ||
vars: | ||
DATA_DIR: "{{.OUTPUT_DIR}}" | ||
OUTPUT_FILE: "{{.CHECKSUM_FILE}}" | ||
sources: | ||
- "{{.G_BUILD_DIR}}/meteor.md5" | ||
- "{{.TASKFILE}}" | ||
- ".meteor/packages" | ||
- "package.json" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@haiqi96 I noticed we have this
platform
attribute for taskwebui
. Does it mean the task only runs on x86 platforms? Now that we also set up the arch-specific meteor and nodejs, do we still need the restriction here? (My insights are limited as I'm not too sure how the webui is built currently for your workflowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
meteor build --architecture
now support ARM platform IDs?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the oversight. It doesn't seem to be the case.
The aarch64 related handling was added into the install script together with the 2.14 -> 2.15 upgrade so I mistakenly thought it was available for download. https://static.meteor.com/packages-bootstrap/2.15/meteor-bootstrap-os.linux.aarch64.tar.gz just doesn't open.
ARM support is expected to be available in meteor 3.0 though.