Skip to content

Commit

Permalink
Hide the Cachix key from the build (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
neongreen authored Oct 4, 2019
1 parent bac1a87 commit 76e986c
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@ stages:
compile:
stage: build
image: nixos/nix
environment:
# GitLab provides the Cachix signing key to all jobs tagged with
# 'compile' (i.e. only this job)
name: compile
script:
- nix-env -iA cachix -f https://cachix.org/api/v1/install
- cachix use fencer
- imagepath=$(nix-build docker.nix)
- nix-store -qR --include-outputs $(nix-instantiate docker.nix)
| cachix push fencer
- cp $imagepath fencer.tar.gz
# Build the Docker image and create a list of paths to push to Cachix.
# The secret signing key should not be available to the build process.
- ( unset CACHIX_SIGNING_KEY;
nix-env -iA cachix -f https://cachix.org/api/v1/install;
cachix use fencer;
imagepath=$(nix-build docker.nix);
cp $imagepath fencer.tar.gz;
nix-store -qR --include-outputs $(nix-instantiate docker.nix) > paths
)
# Push built paths to Cachix
- cachix push fencer < paths
artifacts:
paths:
- fencer.tar.gz
Expand Down

0 comments on commit 76e986c

Please sign in to comment.