Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Common CI Configuration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
Common CI Configuration
Commits
3851ad3f
Commit
3851ad3f
authored
10 months ago
by
Bartek Wrona
Browse files
Options
Downloads
Patches
Plain Diff
Defined helper script to build npm package.
parent
6891b78c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!49
Implemented common version of bump_npm_version.sh script ( based on work being...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/bash/npm-helpers/npm_build_package.sh
+21
-0
21 additions, 0 deletions
scripts/bash/npm-helpers/npm_build_package.sh
with
21 additions
and
0 deletions
scripts/bash/npm-helpers/npm_build_package.sh
0 → 100755
+
21
−
0
View file @
3851ad3f
#!/usr/bin/env bash
set
-e
SCRIPTPATH
=
"
$(
cd
--
"
$(
dirname
"
$0
"
)
"
>
/dev/null 2>&1
;
pwd
-P
)
"
SOURCE_DIR
=
"
${
1
:?Missing
arg #1 specifying a project source directory
}
"
REGISTRY_URL
=
"
${
2
:?Missing
arg #2 pointing an NPM registry URL
}
"
SCOPE
=
"
${
3
:?Missing
arg #3 pointing a package scope
}
"
PROJECT_NAME
=
"
${
4
:?Missing
arg #4 pointing a project name
}
"
OUTPUT_DIR
=
"
${
5
:?Missing
arg #5 pointing an output directory
}
"
pushd
"
${
SOURCE_DIR
}
"
# move to the project directory (where package.json file is located)
"
${
SCRIPTPATH
}
/npm_generate_version.sh"
"
${
SOURCE_DIR
}
"
"
${
REGISTRY_URL
}
"
"
${
SCOPE
}
"
"
${
PROJECT_NAME
}
"
npm run build
npm pack
--pack-destination
"
${
OUTPUT_DIR
}
"
--json
>
"
${
OUTPUT_DIR
}
/built_package_info.json"
BUILT_PACKAGE_NAME
=
$(
jq
-r
.[].filename
"
${
OUTPUT_DIR
}
/built_package_info.json"
)
echo
BUILT_PACKAGE_PATH
=
"
${
OUTPUT_DIR
}
/
${
BUILT_PACKAGE_NAME
}
"
>
built_package_info.env
popd
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment