cloudflare/cloudflared
Publicmirrored from https://github.com/cloudflare/cloudflaredAvailable
build-packages-fips.sh
26lines · modecode
| 1 | #!/bin/bash |
| 2 | VERSION=$(git describe --tags --always --match "[0-9][0-9][0-9][0-9].*.*") |
| 3 | echo $VERSION |
| 4 | |
| 5 | # This controls the directory the built artifacts go into |
| 6 | export ARTIFACT_DIR=built_artifacts/ |
| 7 | mkdir -p $ARTIFACT_DIR |
| 8 | |
| 9 | arch=("amd64") |
| 10 | export TARGET_ARCH=$arch |
| 11 | export TARGET_OS=linux |
| 12 | export FIPS=true |
| 13 | # For BoringCrypto to link, we need CGO enabled. Otherwise compilation fails. |
| 14 | export CGO_ENABLED=1 |
| 15 | |
| 16 | make cloudflared-deb |
| 17 | mv cloudflared-fips\_$VERSION\_$arch.deb $ARTIFACT_DIR/cloudflared-fips-linux-$arch.deb |
| 18 | |
| 19 | # rpm packages invert the - and _ and use x86_64 instead of amd64. |
| 20 | RPMVERSION=$(echo $VERSION|sed -r 's/-/_/g') |
| 21 | RPMARCH="x86_64" |
| 22 | make cloudflared-rpm |
| 23 | mv cloudflared-fips-$RPMVERSION-1.$RPMARCH.rpm $ARTIFACT_DIR/cloudflared-fips-linux-$RPMARCH.rpm |
| 24 | |
| 25 | # finally move the linux binary as well. |
| 26 | mv ./cloudflared $ARTIFACT_DIR/cloudflared-fips-linux-$arch |