grafana-pcp/create_bundles_in_container.sh

22 lines
750 B
Bash
Raw Normal View History

2022-07-04 11:40:02 +00:00
#!/bin/bash -eu
#
# create vendor and webpack bundles inside a container (for reproducibility)
2022-07-04 11:40:02 +00:00
# using a Go cache:
# ./create_bundles_in_container.sh --security-opt label=disable -v $(pwd)/.gocache:/root/go
2022-07-04 11:40:02 +00:00
#
cat <<EOF | podman build -t grafana-pcp-build -f - .
FROM fedora:35
RUN dnf upgrade -y && \
dnf install -y rpmdevtools python3-packaging make golang nodejs yarnpkg golang-github-jsonnet-bundler golang-github-google-jsonnet
WORKDIR /tmp/grafana-pcp-build
COPY grafana-pcp.spec create_bundles.sh build_frontend.sh list_bundled_nodejs_packages.py *.patch .
2022-07-04 11:40:02 +00:00
RUN mkdir bundles
CMD ./create_bundles.sh && mv *.tar.* bundles
2022-07-04 11:40:02 +00:00
EOF
podman run --name grafana-pcp-build --replace "$@" grafana-pcp-build
podman cp grafana-pcp-build:bundles/. .