use image tags to identify channels
this works better with registries like hub.docker.com that don't allow nested images
This commit is contained in:
parent
b44f7f85f3
commit
5d9a795ac3
3 changed files with 7 additions and 5 deletions
|
@ -11,11 +11,13 @@ nixos-unstable:
|
||||||
extends: .build
|
extends: .build
|
||||||
variables:
|
variables:
|
||||||
NIXPKGS_CHANNEL: nixos-unstable
|
NIXPKGS_CHANNEL: nixos-unstable
|
||||||
|
IMAGE_TAG: latest
|
||||||
|
|
||||||
nixos-18.09:
|
nixos-18.09:
|
||||||
extends: .build
|
extends: .build
|
||||||
variables:
|
variables:
|
||||||
NIXPKGS_CHANNEL: nixos-18.09
|
NIXPKGS_CHANNEL: nixos-18.09
|
||||||
|
IMAGE_TAG: nixos-18.09
|
||||||
|
|
||||||
# ---- templates ---
|
# ---- templates ---
|
||||||
|
|
||||||
|
@ -26,5 +28,5 @@ nixos-18.09:
|
||||||
- nix-shell --run .gitlab/push-master
|
- nix-shell --run .gitlab/push-master
|
||||||
variables:
|
variables:
|
||||||
NIX_PATH: "nixpkgs=channel:${NIXPKGS_CHANNEL}"
|
NIX_PATH: "nixpkgs=channel:${NIXPKGS_CHANNEL}"
|
||||||
REGISTRY_URL: "${CI_REGISTRY_IMAGE}/${NIXPKGS_CHANNEL}"
|
REGISTRY_URL: "${CI_REGISTRY_IMAGE}"
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ image to image.
|
||||||
# the user must have an account at gitlab
|
# the user must have an account at gitlab
|
||||||
$ docker login registry.gitlab.com
|
$ docker login registry.gitlab.com
|
||||||
# run the curl image which has curl as an entry-point
|
# run the curl image which has curl as an entry-point
|
||||||
$ docker run -ti --rm registry.gitlab.com/zimbatm/docker-nixpkgs/nixos-unstable/curl http://ifconfig.co
|
$ docker run -ti --rm registry.gitlab.com/zimbatm/docker-nixpkgs/curl http://ifconfig.co
|
||||||
180.52.248.114
|
180.52.248.114
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
6
push-all
6
push-all
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/sh -eu
|
#!/bin/sh -eu
|
||||||
|
|
||||||
: "${CI_REGISTRY_IMAGE:=registry.gitlab.com/zimbatm/docker-nixpkgs}"
|
: "${REGISTRY_URL:=nixpkgs}"
|
||||||
: "${REGISTRY_URL:=$CI_REGISTRY_IMAGE/undefined}"
|
: "${IMAGE_TAG:=latest}"
|
||||||
|
|
||||||
releases_json=$(nix-instantiate ./release.nix --strict --eval --json)
|
releases_json=$(nix-instantiate ./release.nix --strict --eval --json)
|
||||||
|
|
||||||
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
|
for attr in $(echo "$releases_json" | jq -r "keys[]") ; do
|
||||||
file=$(echo "$releases_json" | jq -r ".\"$attr\"")
|
file=$(echo "$releases_json" | jq -r ".\"$attr\"")
|
||||||
echo "--- $attr -> $file"
|
echo "--- $attr -> $file"
|
||||||
skopeo copy "docker-archive://$file" "docker://$REGISTRY_URL/$attr:latest"
|
skopeo copy "docker-archive://$file" "docker://$REGISTRY_URL/$attr:$IMAGE_TAG"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue