build-packages-fips.sh 854 B

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