release.nix -> default.nix
the default should be to build all the images
This commit is contained in:
parent
987c5c9460
commit
f90912f967
9 changed files with 19 additions and 19 deletions
|
@ -88,7 +88,7 @@ All images are automatically built and pushed to Docker Hub.
|
||||||
To add a new image to the project, create a new folder under
|
To add a new image to the project, create a new folder under
|
||||||
`./images/<image-name>` with a default.nix that returns the docker image.
|
`./images/<image-name>` with a default.nix that returns the docker image.
|
||||||
|
|
||||||
Then run `nix-build release.nix -A <image-name>` to test that it builds, and
|
Then run `nix-build -A <image-name>` to test that it builds, and
|
||||||
then use
|
then use
|
||||||
`docker load -i /nix/store/...<image-name>.tar.gz` to load and test the image.
|
`docker load -i /nix/store/...<image-name>.tar.gz` to load and test the image.
|
||||||
|
|
||||||
|
|
2
build
2
build
|
@ -2,7 +2,7 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# build *all* the docker images
|
# build *all* the docker images
|
||||||
exec nix-build release.nix \
|
exec nix-build \
|
||||||
--no-out-link \
|
--no-out-link \
|
||||||
--option sandbox true \
|
--option sandbox true \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
12
default.nix
12
default.nix
|
@ -1,8 +1,4 @@
|
||||||
import <nixpkgs> {
|
let
|
||||||
# docker images run on Linux
|
pkgs = import ./pkgs.nix;
|
||||||
system = "x86_64-linux";
|
in
|
||||||
config = {};
|
pkgs.docker-nixpkgs
|
||||||
overlays = [
|
|
||||||
(import ./overlay.nix)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ microbadge() {
|
||||||
|
|
||||||
## Main ##
|
## Main ##
|
||||||
|
|
||||||
releases_json=$(nix-instantiate ./release.nix --strict --eval --json)
|
releases_json=$(nix-instantiate --strict --eval --json)
|
||||||
|
|
||||||
echo "| Image / Tag | latest | nixos-19.03 | nixos-19.09 |"
|
echo "| Image / Tag | latest | nixos-19.03 | nixos-19.09 |"
|
||||||
echo "| --- | --- | --- | --- |"
|
echo "| --- | --- | --- | --- |"
|
||||||
|
|
|
@ -15,7 +15,7 @@ nix_eval() {
|
||||||
nix-instantiate --strict --eval --json "$@"
|
nix-instantiate --strict --eval --json "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
releases_json=$(nix_eval release.nix)
|
releases_json=$(nix_eval)
|
||||||
|
|
||||||
to_json() {
|
to_json() {
|
||||||
local desc=$1 full_desc=$2
|
local desc=$1 full_desc=$2
|
||||||
|
@ -29,7 +29,7 @@ echo "=== Updating Docker Hub project descriptions"
|
||||||
|
|
||||||
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
|
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
|
||||||
echo "--- $attr"
|
echo "--- $attr"
|
||||||
desc=$(nix_eval ./release.nix -A "$attr.meta.description" | jq -r .)
|
desc=$(nix_eval -A "$attr.meta.description" | jq -r .)
|
||||||
|
|
||||||
if [[ -f "$attr/README.md" ]]; then
|
if [[ -f "$attr/README.md" ]]; then
|
||||||
full_desc=$(< "$attr/README.md")
|
full_desc=$(< "$attr/README.md")
|
||||||
|
|
8
pkgs.nix
Normal file
8
pkgs.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import <nixpkgs> {
|
||||||
|
# docker images run on Linux
|
||||||
|
system = "x86_64-linux";
|
||||||
|
config = {};
|
||||||
|
overlays = [
|
||||||
|
(import ./overlay.nix)
|
||||||
|
];
|
||||||
|
}
|
2
push-all
2
push-all
|
@ -7,7 +7,7 @@ registry=${1:-docker.io}
|
||||||
image_prefix=${2:-nixpkgs}
|
image_prefix=${2:-nixpkgs}
|
||||||
image_tag=${3:-latest}
|
image_tag=${3:-latest}
|
||||||
|
|
||||||
releases_json=$(nix-instantiate ./release.nix --strict --eval --json)
|
releases_json=$(nix-instantiate --strict --eval --json)
|
||||||
|
|
||||||
echo "=== Pushing images to $registry"
|
echo "=== Pushing images to $registry"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
let
|
|
||||||
pkgs = import ./.;
|
|
||||||
in
|
|
||||||
pkgs.docker-nixpkgs
|
|
|
@ -1,4 +1,4 @@
|
||||||
with import ./.;
|
with import ./pkgs.nix;
|
||||||
mkShell {
|
mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
jq
|
jq
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue