Skip to content
Snippets Groups Projects
update-nixpkgs 941 B
Newer Older
  • Learn to ignore specific revisions
  • #!/usr/bin/env nix-shell
    #!nix-shell -i sh -p nixUnstable git curl
    
    set -eux -o pipefail
    
    TARGET_BRANCH="nixpkgs-upgrade-$(date +%Y-%m-%d)"
    
    
    echo '{}' > morph/grid/local/public-keys/users.nix
    
    nix-build -A morph -o result-before
    
    
    git checkout "${TARGET_BRANCH}" || git checkout -b "${TARGET_BRANCH}"
    
    
    Jean-Paul Calderone's avatar
    Jean-Paul Calderone committed
    ./update-nixpkgs
    
    nix-build -A morph -o result-after
    diff=$(nix --extra-experimental-features nix-command store diff-closures ./result-before/ ./result-after/)
    
    git commit -am "bump nixpkgs version"
    git push origin
    
    BODY="{
        \"id\": ${CI_PROJECT_ID},
        \"source_branch\": \"${CI_COMMIT_REF_NAME}\",
        \"target_branch\": \"${TARGET_BRANCH}\",
        \"remove_source_branch\": true,
        \"title\": \"WIP: ${CI_COMMIT_REF_NAME}\",
        \"assignee_id\":\"jcalderone"
    }";
    
    curl -X POST --data "${BODY}" --header "Content-Type: application/json" --header "PRIVATE-TOKEN: ${UPDATE_NIXPKGS_PRIVATE_TOKEN}" "${HOST}/api/v4/projects/merge_requests"