grafana/SOURCES/create_bundles_in_container.sh

25 lines
783 B
Bash
Raw Permalink Normal View History

2022-11-15 06:34:36 +00:00
#!/bin/bash -eu
#
2023-05-09 05:17:53 +00:00
# create vendor and webpack bundles inside a container (for reproducibility)
# using a Go cache:
# ./create_bundles_in_container.sh --security-opt label=disable -v $(pwd)/.gocache:/root/go
2022-11-15 06:34:36 +00:00
#
cat <<EOF | podman build -t grafana-build -f - .
2023-11-07 09:07:04 +00:00
FROM fedora:36
2022-11-15 06:34:36 +00:00
RUN dnf upgrade -y && \
2023-05-09 05:17:53 +00:00
dnf install -y rpmdevtools python3-packaging python3-pyyaml make golang nodejs yarnpkg
# https://groups.google.com/g/golang-nuts/c/MVtHZUtZru4
ENV GOPROXY=https://proxy.golang.org,direct
2022-11-15 06:34:36 +00:00
WORKDIR /tmp/grafana-build
2023-05-09 05:17:53 +00:00
COPY grafana.spec create_bundles.sh build_frontend.sh list_bundled_nodejs_packages.py *.patch .
2022-11-15 06:34:36 +00:00
RUN mkdir bundles
2023-05-09 05:17:53 +00:00
CMD ./create_bundles.sh && mv *.tar.* bundles
2022-11-15 06:34:36 +00:00
EOF
podman run --name grafana-build --replace "$@" grafana-build
podman cp grafana-build:bundles/. .