diff --git a/.buildkite/pipeline-for-tags.yml b/.buildkite/pipeline-for-tags.yml index 22f22762e..1c4b4546a 100644 --- a/.buildkite/pipeline-for-tags.yml +++ b/.buildkite/pipeline-for-tags.yml @@ -8,169 +8,27 @@ env: steps: - - label: Check for new Octez release - if: build.source == "schedule" && build.branch == "master" - commands: - - nix develop .#autorelease -c ./scripts/update-tezos.sh - - - label: Build ubuntu source packages - key: build-ubuntu-source-packages - if: build.tag =~ /^v.*-1/ - agents: - queue: "docker" - commands: - - eval "$SET_VERSION" - - nix develop .#docker-tezos-packages -c ./docker/build/ubuntu/build.py --type source - artifact_paths: - - ./out/* - - - label: Build fedora source packages - key: build-fedora-source-packages - if: build.tag =~ /^v.*-1/ - agents: - queue: "docker" - commands: - - eval "$SET_VERSION" - - nix develop .#docker-tezos-packages -c ./docker/build/fedora/build.py --type source - artifact_paths: - - ./out/* - - - label: Sign ubuntu source packages - if: build.tag =~ /^v.*-1/ - depends_on: - - "build-ubuntu-source-packages" - key: sign-ubuntu-source-packages - commands: - - eval "$SET_VERSION" - - buildkite-agent artifact download "out/*" . --step build-ubuntu-source-packages - - nix develop .#docker-tezos-packages -c ./docker/build/ubuntu/sign.py -d out -i 'Serokell ' - artifact_paths: - - ./out/* - - - label: Sign fedora source packages - if: build.tag =~ /^v.*-1/ - depends_on: - - "build-fedora-source-packages" - key: sign-fedora-source-packages - commands: - - eval "$SET_VERSION" - - buildkite-agent artifact download "out/*" . --step build-fedora-source-packages - - nix develop .#docker-tezos-packages -c ./docker/build/fedora/sign.py -d out -i 'Serokell ' - artifact_paths: - - ./out/* - - - label: Publish ubuntu native packages - if: build.tag =~ /^v.*-1/ - depends_on: - - "sign-ubuntu-source-packages" - commands: - - eval "$SET_VERSION" - - buildkite-agent artifact download "out/*" . --step sign-ubuntu-source-packages - - nix develop .#buildkite -c ./docker/build/ubuntu/upload.py -d out - - - label: Publish fedora native packages - if: build.tag =~ /^v.*-1/ - depends_on: - - "sign-fedora-source-packages" - commands: - - eval "$SET_VERSION" - - buildkite-agent artifact download "out/*" . --step sign-fedora-source-packages - - nix develop .#buildkite -c ./docker/build/fedora/upload.py -d out - - label: build-via-docker - if: build.tag =~ /^v.*-1/ + if: build.tag == "test-736" key: build-via-docker commands: - eval "$SET_VERSION" - cd docker - ./docker-static-build.sh + - buildkite-agent artifact upload /tmp/binaries.txt artifact_paths: - ./docker/ agents: queue: "docker" - - label: Build source packages from static binaries - key: build-source-packages-from-static-binaries - if: build.tag =~ /^v.*-1/ - agents: - queue: "docker" - depends_on: - - "build-via-docker" - commands: - - eval "$SET_VERSION" - - mkdir binaries - - buildkite-agent artifact download "docker/*" binaries --step build-via-docker - - nix develop .#docker-tezos-packages -c ./docker/build/fedora/build.py --type source --output-dir epel --binaries-dir ./binaries/docker - artifact_paths: - - ./epel/* - - - label: Sign source packages built from static binaries - key: sign-source-packages-built-from-static-binaries - if: build.tag =~ /^v.*-1/ - depends_on: - - "build-source-packages-from-static-binaries" - commands: - - eval "$SET_VERSION" - - buildkite-agent artifact download "epel/*" . --step build-source-packages-from-static-binaries - - nix develop .#docker-tezos-packages -c ./docker/build/fedora/sign.py -d epel -i 'Serokell ' - artifact_paths: - - ./epel/* - - - label: Publish epel packages - if: build.tag =~ /^v.*-1/ - depends_on: - - "sign-source-packages-built-from-static-binaries" - commands: - - eval "$SET_VERSION" - - mkdir -p srcs - - buildkite-agent artifact download "epel/*" srcs --step sign-source-packages-built-from-static-binaries - - nix develop .#buildkite -c ./docker/build/fedora/upload.py -d srcs/epel --upload epel - - - label: Build Big Sur x86_64 bottles - key: build-bottles-big-sur-x86_64 - if: build.tag =~ /^v.*/ - agents: - queue: "x86_64-rosetta-darwin" - commands: - - nix develop .#autorelease-macos -c ./scripts/build-all-bottles.sh "big_sur" - artifact_paths: - - '*.bottle.*' - retry: - automatic: - limit: 1 - - - label: Build Big Sur arm64 bottles - key: build-bottles-big-sur-arm64 - if: build.tag =~ /^v.*/ - agents: - queue: "arm64-darwin" - commands: - - nix develop .#autorelease-macos -c ./scripts/build-all-bottles.sh "arm64_big_sur" - artifact_paths: - - '*.bottle.*' - retry: - automatic: - limit: 1 - - # We use the tag that triggered the pipeline here. - # However, this requires that the tag and the release name are the same, which - # in practice it's always the case in this repo. - - label: Add Big Sur bottle hashes to formulae - key: add-bigsur-hashes - depends_on: - - "build-bottles-big-sur-arm64" - - "build-bottles-big-sur-x86_64" - if: build.tag =~ /^v.*/ - commands: - - mkdir -p "Big Sur" - - nix develop .#buildkite -c gh release download "$BUILDKITE_TAG" -D "Big Sur/" -p "*big_sur.bottle.tar.gz" - - nix develop .#autorelease -c ./scripts/sync-bottle-hashes.sh "$BUILDKITE_TAG" "Big Sur" - label: Update binaries list depends_on: - "build-via-docker" - - "add-bigsur-hashes" - if: build.tag =~ /^v.*-1/ + # - "add-bigsur-hashes" + if: build.tag == "test-736" key: update-binaries commands: - - nix develop .#buildkite /tezos-packiging/.buildkite/update-binaries.sh "$BUILDKITE_TAG" "$(buildkite-agent artifact download /docker/binaries.txt)" + - buildkite-agent artifact download tmp/binaries.txt docker --step "build-via-docker" + - cd docker + - nix develop .#autorelease -c ./update-binaries.sh diff --git a/.buildkite/retag.sh b/.buildkite/retag.sh new file mode 100755 index 000000000..0b65dbb61 --- /dev/null +++ b/.buildkite/retag.sh @@ -0,0 +1,4 @@ +git tag -d test-736 +git push --delete origin test-736 +git tag -a test-736 -m "Test" +git push origin test-736 \ No newline at end of file diff --git a/docker/docker-static-build.sh b/docker/docker-static-build.sh index 6a64f4382..721d88d1e 100755 --- a/docker/docker-static-build.sh +++ b/docker/docker-static-build.sh @@ -16,8 +16,6 @@ if [ -z ${OCTEZ_EXECUTABLES+x} ]; then binaries+=("octez-accuser-$proto" "octez-baker-$proto" "octez-smart-rollup-client-$proto" "octez-smart-rollup-node-$proto") done - printf "%s\n" "${binaries[@]}" > "binaries.txt" - OCTEZ_EXECUTABLES="$( IFS=$' '; echo "${binaries[*]}" )" else IFS=' ' read -r -a binaries <<< "$OCTEZ_EXECUTABLES" @@ -54,4 +52,7 @@ container_id="$("$virtualisation_engine" create alpine-tezos)" for b in "${binaries[@]}"; do "$virtualisation_engine" cp "$container_id:/tezos/$b" "$b" done +printf "%s\n" "${binaries[@]}" > "/tmp/binaries.txt" +echo "${binaries[@]}" +echo "$(ls /tmp | grep binaries.txt)" "$virtualisation_engine" rm -v "$container_id" diff --git a/docker/package/scripts/update-binaries-list.py b/docker/package/scripts/update-binaries-list.py index 99a20cb3f..6b76fe783 100644 --- a/docker/package/scripts/update-binaries-list.py +++ b/docker/package/scripts/update-binaries-list.py @@ -2,9 +2,11 @@ import sys import json -binaries_json_path = "/tezos-packiging/docker/test/binaries.json" +binaries_json_path_suffix = "/tests/binaries.json" +binaries_list_path_suffix = "/tmp/binaries.txt" def update_binaries(binaries, field): + binaries_json_path = os.environ["PWD"] + binaries_json_path_suffix with open(binaries_json_path, 'r') as file: data = json.load(file) @@ -14,15 +16,12 @@ def update_binaries(binaries, field): def main(): - if len(sys.argv) < 3: - print("You need to provide tag and path to list of binaries argument") - return - tag = sys.argv[1] - + tag = os.environ["BUILDKITE_TAG"] binaries = [] - with open(sys.argv[2], 'r') as f: + binaries_list_path = os.environ["PWD"] + binaries_list_path_suffix + with open(binaries_list_path, 'r') as f: binaries = [l.strip() for l in f.readlines()] - + print(binaries) if not binaries: raise Exception('Exception, while reading binaries list: binaries list is empty') diff --git a/.buildkite/update-binaries.sh b/docker/update-binaries.sh old mode 100644 new mode 100755 similarity index 51% rename from .buildkite/update-binaries.sh rename to docker/update-binaries.sh index 9e7ee29bc..00c7d5041 --- a/.buildkite/update-binaries.sh +++ b/docker/update-binaries.sh @@ -10,10 +10,15 @@ git config --local user.name "$bot_name" git remote remove auth-origin 2> /dev/null || : git remote add auth-origin "https://oath2:$GITHUB_PUSH_TOKEN@github.com:serokell/tezos-packaging.git" git fetch -git checkout -B "$1" --track "origin/$1" +git checkout -B "update-binaries-list-$BUILDKITE_TAG" -python3 /tezos-packiging/docker/package/scripts/update-binaries-list.py $1 +python3 package/scripts/update-binaries-list.py -git add --all -git commit --fixup HEAD -m "Updated binaries for $1 release" -git push auth-origin "$our_branch" +# git add /tezos-packiging/docker/binaries.json +# git commit --fixup HEAD -m "Updated binaries for $1 release" +# git push auth-origin "$our_branch" +# gh pr create -B master -t "Update list of binaries for $1" +branch="$(git branch)" +echo $branch +diff="$(git diff)" +echo $diff \ No newline at end of file