forked from ManageIQ/ui-components
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Dockerfile for building the ui-components package
- Loading branch information
Showing
5 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules/ | ||
/pkg/*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,4 @@ vendor.css | |
coverage | ||
yarn.lock | ||
package-lock.json | ||
pkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:2.7-buster | ||
|
||
SHELL ["/bin/bash", "--login", "-c"] | ||
|
||
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash | ||
RUN nvm install 14 | ||
RUN npm install --global yarn | ||
|
||
WORKDIR /ui-components | ||
COPY . /ui-components | ||
RUN git clean -fdx | ||
RUN yarn install | ||
RUN yarn pack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
image="docker.io/manageiq/ui-components:latest" | ||
|
||
# Build the image, which will build the package | ||
docker build . -t $image --no-cache | ||
|
||
# Extract the package from the image | ||
container_id=$(docker create $image) | ||
package=$(docker run --rm -it --entrypoint /bin/bash $image -c "ls -1 manageiq-ui-components-*.tgz" | tr -d '\r') | ||
docker cp "$container_id:/ui-components/$package" pkg | ||
docker rm "$container_id" | ||
|
||
echo | ||
echo "Package 'pkg/$package' has been built." | ||
echo | ||
|
||
# Optionally publish the image | ||
read -r -p "Publish the package now? (y/N) " -n 1 | ||
echo | ||
echo | ||
if [[ "$REPLY" =~ ^[Yy]$ ]]; then | ||
pushd pkg >/dev/null | ||
npm login | ||
npm publish --access public $package | ||
popd >/dev/null | ||
else | ||
echo "You can manually publish the package with:" | ||
echo " cd pkg" | ||
echo " npm login" | ||
echo " npm publish --access public $package" | ||
fi |
Empty file.