Skip to content

Commit d411fcd

Browse files
authored
Restore packer pkg (#2031)
* fix: restore packer build in our package set * chore: bump to release * fix: use packer in this pkg set
1 parent 8558ae8 commit d411fcd

File tree

5 files changed

+55
-11
lines changed

5 files changed

+55
-11
lines changed

.github/workflows/ami-release-nix.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,18 @@ jobs:
8787
POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }}
8888
run: |
8989
GIT_SHA=${{github.sha}}
90-
nix run nixpkgs#packer -- init amazon-arm64-nix.pkr.hcl
90+
nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl
9191
# why is postgresql_major defined here instead of where the _three_ other postgresql_* variables are defined?
92-
nix run nixpkgs#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl
92+
nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl
9393
9494
- name: Build AMI stage 2
9595
env:
9696
POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }}
9797
run: |
9898
GIT_SHA=${{github.sha}}
99-
nix run nixpkgs#packer -- init stage2-nix-psql.pkr.hcl
99+
nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl
100100
POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }}
101-
nix run nixpkgs#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl
101+
nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${EXECUTION_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl
102102
103103
- name: Grab release version
104104
id: process_release_version

.github/workflows/base-image-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ jobs:
5353
AWS_RETRY_MODE: adaptive
5454
run: |
5555
GIT_SHA=${{ github.sha }}
56-
nix run nixpkgs#packer -- init amazon-arm64-nix.pkr.hcl
57-
nix run nixpkgs#packer -- build \
56+
nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl
57+
nix run github:supabase/postgres/${GIT_SHA}#packer -- build \
5858
-var "git-head-version=${GIT_SHA}" \
5959
-var "packer-execution-id=${EXECUTION_ID}" \
6060
-var-file="development-arm.vars.pkr.hcl" \

ansible/vars.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ postgres_major:
1010

1111
# Full version strings for each major version
1212
postgres_release:
13-
postgresorioledb-17: "17.6.0.034-orioledb"
14-
postgres17: "17.6.1.077"
15-
postgres15: "15.14.1.077"
13+
postgresorioledb-17: "17.6.0.035-orioledb"
14+
postgres17: "17.6.1.078"
15+
postgres15: "15.14.1.078"
1616

1717
# Non Postgres Extensions
1818
pgbouncer_release: 1.25.1

nix/packages/default.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
{
3434
packages = (
3535
{
36-
build-ami = pkgs.callPackage ./build-ami.nix { };
37-
build-test-ami = pkgs.callPackage ./build-test-ami.nix { };
36+
build-ami = pkgs.callPackage ./build-ami.nix { packer = self'.packages.packer; };
37+
build-test-ami = pkgs.callPackage ./build-test-ami.nix { packer = self'.packages.packer; };
3838
cleanup-ami = pkgs.callPackage ./cleanup-ami.nix { };
3939
dbmate-tool = pkgs.callPackage ./dbmate-tool.nix { inherit (self.supabase) defaults; };
4040
docs = pkgs.callPackage ./docs.nix { };
@@ -49,6 +49,7 @@
4949
mecab-naist-jdic = pkgs.callPackage ./mecab-naist-jdic.nix { };
5050
migrate-tool = pkgs.callPackage ./migrate-tool.nix { psql_15 = self'.packages."psql_15/bin"; };
5151
overlayfs-on-package = pkgs.callPackage ./overlayfs-on-package.nix { };
52+
packer = pkgs.callPackage ./packer.nix { inherit inputs; };
5253
pg-backrest = inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.pgbackrest;
5354
pg-restore = pkgs.callPackage ./pg-restore.nix { psql_15 = self'.packages."psql_15/bin"; };
5455
pg_prove = pkgs.perlPackages.TAPParserSourceHandlerpgTAP;

nix/packages/packer.nix

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
pkgs,
3+
lib,
4+
fetchFromGitHub,
5+
installShellFiles,
6+
...
7+
}:
8+
let
9+
buildGoModule = pkgs.buildGoModule;
10+
in
11+
buildGoModule rec {
12+
pname = "packer";
13+
version = "1.14.1";
14+
15+
src = fetchFromGitHub {
16+
owner = "hashicorp";
17+
repo = "packer";
18+
rev = "v${version}";
19+
hash = "sha256-3g9hsmrfLzGhjcGvUza/L9PMGUFw+KLbg2pIK0CxlQI=";
20+
};
21+
22+
vendorHash = "sha256-F6hn+pXPyPe70UTK8EF24lk7ArYz7ygUyVVsatW6+hI=";
23+
24+
subPackages = [ "." ];
25+
26+
ldflags = [
27+
"-s"
28+
"-w"
29+
];
30+
31+
nativeBuildInputs = [ installShellFiles ];
32+
33+
postInstall = ''
34+
installShellCompletion --zsh contrib/zsh-completion/_packer
35+
'';
36+
37+
meta = {
38+
description = "Tool for creating identical machine images for multiple platforms from a single source configuration";
39+
homepage = "https://www.packer.io";
40+
license = lib.licenses.bsl11;
41+
changelog = "https://github.com/hashicorp/packer/blob/v${version}/CHANGELOG.md";
42+
};
43+
}

0 commit comments

Comments
 (0)