Unverified Commit 3302bc3d authored by Tomas Kral's avatar Tomas Kral Committed by GitHub
Browse files

crc: 2.6.0 -> 2.11.0 (#205126)



Co-authored-by: default avatarSandro <sandro.jaeckel@gmail.com>
parent 54f1ef62
Loading
Loading
Loading
Loading
+14 −15
Original line number Diff line number Diff line
@@ -10,20 +10,22 @@
}:

let
  openShiftVersion = "4.10.22";
  podmanVersion = "4.1.0";
  openShiftVersion = "4.11.13";
  okdVersion = "4.11.0-0.okd-2022-11-05-030711";
  podmanVersion = "4.2.0";
  writeKey = "cvpHsNcmGCJqVzf6YxrSnVlwFSAZaYtp";
in
buildGoModule rec {
  version = "2.6.0";
  version = "2.11.0";
  pname = "crc";
  gitCommit = "6b954d40ec3280ca63e825805503d4414a3ff55b";
  gitCommit = "a5f90a25abcacd4aa334490f0d204329abeaa691";
  modRoot = "cmd/crc";

  src = fetchFromGitHub {
    owner = "code-ready";
    owner = "crc-org";
    repo = "crc";
    rev = "v${version}";
    sha256 = "sha256-4EaonL+7/zPEbuM12jQFx8wLR62iLYZ3LkHAibdGQZc=";
    sha256 = "sha256-0e62mQ01pt0kClrEx4ss2T8BN1+0aQiCFPyDg5agbTU";
  };

  vendorSha256 = null;
@@ -41,21 +43,18 @@ buildGoModule rec {
  tags = [ "containers_image_openpgp" ];

  ldflags = [
    "-X github.com/code-ready/crc/pkg/crc/version.crcVersion=${version}"
    "-X github.com/code-ready/crc/pkg/crc/version.bundleVersion=${openShiftVersion}"
    "-X github.com/code-ready/crc/pkg/crc/version.podmanVersion=${podmanVersion}"
    "-X github.com/code-ready/crc/pkg/crc/version.commitSha=${gitCommit}"
    "-X github.com/code-ready/crc/pkg/crc/segment.WriteKey=${writeKey}"
    "-X github.com/crc-org/crc/pkg/crc/version.crcVersion=${version}"
    "-X github.com/crc-org/crc/pkg/crc/version.ocpVersion=${openShiftVersion}"
    "-X github.com/crc-org/crc/pkg/crc/version.okdVersion=${okdVersion}"
    "-X github.com/crc-org/crc/pkg/crc/version.podmanVersion=${podmanVersion}"
    "-X github.com/crc-org/crc/pkg/crc/version.commitSha=${builtins.substring 0 8 gitCommit}"
    "-X github.com/crc-org/crc/pkg/crc/segment.WriteKey=${writeKey}"
  ];

  preBuild = ''
    export HOME=$(mktemp -d)
  '';

  # tests are currently broken on aarch64-darwin
  # https://github.com/code-ready/crc/issues/3237
  doCheck = !(stdenv.isDarwin && stdenv.isAarch64);
  checkFlags = [ "-args --crc-binary=$out/bin/crc" ];

  passthru.tests.version = testers.testVersion {
    package = crc;
+9 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ cd ${NIXPKGS_CRC_FOLDER}

LATEST_TAG_RAWFILE=${WORKDIR}/latest_tag.json
curl --silent ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
    https://api.github.com/repos/code-ready/crc/releases >${LATEST_TAG_RAWFILE}
    https://api.github.com/repos/crc-org/crc/releases  >${LATEST_TAG_RAWFILE}

LATEST_TAG_NAME=$(jq 'map(.tag_name)' ${LATEST_TAG_RAWFILE} |
    grep -v -e rc -e engine | tail -n +2 | head -n -1 | sed 's|[", ]||g' | sort -rV | head -n1)
@@ -22,15 +22,18 @@ LATEST_TAG_NAME=$(jq 'map(.tag_name)' ${LATEST_TAG_RAWFILE} |
CRC_VERSION=$(echo ${LATEST_TAG_NAME} | sed 's/^v//')

CRC_COMMIT=$(curl --silent ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
    https://api.github.com/repos/code-ready/crc/tags |
    https://api.github.com/repos/crc-org/crc/tags |
    jq -r "map(select(.name == \"${LATEST_TAG_NAME}\")) | .[0] | .commit.sha")

FILE_MAKEFILE=${WORKDIR}/Makefile
curl --silent https://raw.githubusercontent.com/code-ready/crc/${CRC_COMMIT}/Makefile >$FILE_MAKEFILE
curl --silent https://raw.githubusercontent.com/crc-org/crc/${CRC_COMMIT}/Makefile >$FILE_MAKEFILE

OPENSHIFT_VERSION=$(grep 'OPENSHIFT_VERSION' ${FILE_MAKEFILE} |
    head -n1 | awk '{print $3}')

OKD_VERSION=$(grep 'OKD_VERSION' ${FILE_MAKEFILE} |
    head -n1 | awk '{print $3}')

PODMAN_VERSION=$(grep 'PODMAN_VERSION' ${FILE_MAKEFILE} |
    head -n1 | awk '{print $3}')

@@ -46,6 +49,9 @@ sed -i "s|gitCommit = \".*\"|gitCommit = \"${CRC_COMMIT:-}\"|" \
sed -i "s|openShiftVersion = \".*\"|openShiftVersion = \"${OPENSHIFT_VERSION:-}\"|" \
    ${NIXPKGS_CRC_FOLDER}/default.nix

sed -i "s|okdVersion = \".*\"|okdVersion = \"${OKD_VERSION:-}\"|" \
    ${NIXPKGS_CRC_FOLDER}/default.nix

sed -i "s|podmanVersion = \".*\"|podmanVersion = \"${PODMAN_VERSION:-}\"|" \
    ${NIXPKGS_CRC_FOLDER}/default.nix