Skip to content

Commit

Permalink
Restructure files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry-Denny committed Oct 12, 2023
1 parent f640b0e commit 20df275
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 43 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ jobs:
- uses: cachix/install-nix-action@v20

- name: Build
run: nix build -L .#${{ matrix.package }}.package
run: nix build -L .#${{ matrix.package }}

# - name: Build and push container image
# if: ${{ github.ref_name == 'main' || github.ref_type == 'tag' }}
# run: |
# set -x
#
# local_cr="docker-archive://$(nix build .#${{ matrix.package }}.container-image --no-link --print-out-paths)"
# remote_cr="docker://ghcr.io/STFC-ICD-Research-and-Design/${{ matrix.package }}"
#
# skopeo copy --dest-creds="dannixon:${{ github.token }}" "$local_cr" "$remote_cr:${{ github.ref_name }}"
# skopeo copy --dest-creds="dannixon:${{ github.token }}" "$local_cr" "$remote_cr:${{ github.sha }}"
# if [[ "${{ github.ref_type }}" == 'tag' ]]; then
# skopeo copy --dest-creds="dannixon:${{ github.token }}" "$local_cr" "$remote_cr:latest"
# fi
- name: Build and push container image
if: ${{ github.ref_name == 'main' || github.ref_type == 'tag' }}
run: |
set -x
local_cr="docker-archive://$(nix build .#${{ matrix.package }}-container-image --no-link --print-out-paths)"
remote_cr="docker://ghcr.io/STFC-ICD-Research-and-Design/${{ matrix.package }}"
skopeo copy --dest-creds="dannixon:${{ github.token }}" "$local_cr" "$remote_cr:${{ github.ref_name }}"
skopeo copy --dest-creds="dannixon:${{ github.token }}" "$local_cr" "$remote_cr:${{ github.sha }}"
if [[ "${{ github.ref_type }}" == 'tag' ]]; then
skopeo copy --dest-creds="dannixon:${{ github.token }}" "$local_cr" "$remote_cr:latest"
fi
6 changes: 2 additions & 4 deletions events-to-histogram/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
nativeBuildInputs,
buildInputs,
} : {
package = naersk'.buildPackage {
events-to-histogram = naersk'.buildPackage {
name = "events-to-histogram";
version = version;

Expand All @@ -21,8 +21,7 @@
};
};

/*
container-image = pkgs.dockerTools.buildImage {
events-to-histogram-container-image = pkgs.dockerTools.buildImage {
name = "events-to-histogram";
tag = "latest";
created = "now";
Expand All @@ -43,5 +42,4 @@
];
};
};
*/
}
14 changes: 7 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@
};

packages = {
events-to-histogram = import ./events-to-histogram { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };
kafka-daq-report = import ./kafka-daq-report { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };
simulator = import ./simulator { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };
stream-to-file = import ./stream-to-file { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs hdf5-joined; };
trace-archiver = import ./trace-archiver { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs hdf5-joined; };
trace-to-events = import ./trace-to-events { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };

fmt = naersk'.buildPackage {
src = ./.;
Expand All @@ -74,7 +68,13 @@
# Ensure detailed test output appears in nix build log
cargoTestOptions = x: x ++ ["1>&2"];
};
};
} //
import ./events-to-histogram { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; } //
import ./kafka-daq-report { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; } //
import ./simulator { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; } //
import ./stream-to-file { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs hdf5-joined; } //
import ./trace-archiver { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs hdf5-joined; } //
import ./trace-to-events { inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs; };
}
);
}
6 changes: 2 additions & 4 deletions kafka-daq-report/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
nativeBuildInputs,
buildInputs,
} : {
package = naersk'.buildPackage {
kafka-daq-report = naersk'.buildPackage {
name = "kafka-daq-report";
version = version;

Expand All @@ -21,8 +21,7 @@
};
};

/*
container-image = pkgs.dockerTools.buildImage {
kafka-daq-report-container-image = pkgs.dockerTools.buildImage {
name = "kafka-daq-report";
tag = "latest";
created = "now";
Expand All @@ -43,5 +42,4 @@
];
};
};
*/
}
6 changes: 2 additions & 4 deletions simulator/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
nativeBuildInputs,
buildInputs,
} : {
package = naersk'.buildPackage {
simulator = naersk'.buildPackage {
name = "simulator";
version = version;

Expand All @@ -21,8 +21,7 @@
};
};

/*
container-image = pkgs.dockerTools.buildImage {
simulator-container-image = pkgs.dockerTools.buildImage {
name = "simulator";
tag = "latest";
created = "now";
Expand All @@ -43,5 +42,4 @@
];
};
};
*/
}
6 changes: 2 additions & 4 deletions stream-to-file/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
buildInputs,
hdf5-joined,
} : {
package = naersk'.buildPackage {
stream-to-file = naersk'.buildPackage {
name = "stream-to-file";
version = version;

Expand All @@ -24,8 +24,7 @@
HDF5_DIR = "${hdf5-joined}";
};

/*
container-image = pkgs.dockerTools.buildImage {
stream-to-file-container-image = pkgs.dockerTools.buildImage {
name = "stream-to-file";
tag = "latest";
created = "now";
Expand All @@ -46,5 +45,4 @@
];
};
};
*/
}
4 changes: 2 additions & 2 deletions trace-archiver/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
buildInputs,
hdf5-joined,
} : {
package = naersk'.buildPackage {
trace-archiver = naersk'.buildPackage {
name = "trace-archiver";
version = version;

Expand All @@ -24,7 +24,7 @@
HDF5_DIR = "${hdf5-joined}";
};

/* container-image = pkgs.dockerTools.buildImage {
trace-archiver-container-image = pkgs.dockerTools.buildImage {
name = "trace-archiver";
tag = "latest";
created = "now";
Expand Down
6 changes: 2 additions & 4 deletions trace-to-events/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
nativeBuildInputs,
buildInputs,
} : {
package = naersk'.buildPackage {
trace-to-events = naersk'.buildPackage {
name = "trace-to-events";
version = version;

Expand All @@ -21,8 +21,7 @@
};
};

/*
container-image = pkgs.dockerTools.buildImage {
trace-to-events-container-image = pkgs.dockerTools.buildImage {
name = "trace-to-events";
tag = "latest";
created = "now";
Expand All @@ -43,5 +42,4 @@
];
};
};
*/
}

0 comments on commit 20df275

Please sign in to comment.