Add --pure to nix-shell calls
This commit is contained in:
parent
0fb9cabcfc
commit
a7f8252d50
|
@ -39,7 +39,7 @@ pipeline {
|
||||||
steps {
|
steps {
|
||||||
sh """
|
sh """
|
||||||
nix build -v --no-link &&
|
nix build -v --no-link &&
|
||||||
nix-shell --run echo
|
nix-shell --pure --run echo
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ pipeline {
|
||||||
sh """
|
sh """
|
||||||
. ~/.nix-profile/etc/profile.d/nix.sh && \
|
. ~/.nix-profile/etc/profile.d/nix.sh && \
|
||||||
nix build -v --no-link && \
|
nix build -v --no-link && \
|
||||||
nix-shell --run echo
|
nix-shell --pure --run echo
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ RUN export USER=jenkins \
|
||||||
&& /tmp/nix-install.sh \
|
&& /tmp/nix-install.sh \
|
||||||
&& . ~/.nix-profile/etc/profile.d/nix.sh \
|
&& . ~/.nix-profile/etc/profile.d/nix.sh \
|
||||||
&& nix-build --no-out-link https://github.com/status-im/status-react/tarball/${GIT_COMMIT} \
|
&& nix-build --no-out-link https://github.com/status-im/status-react/tarball/${GIT_COMMIT} \
|
||||||
&& nix-shell --run 'echo' https://github.com/status-im/status-react/tarball/${GIT_COMMIT}
|
&& nix-shell --pure --run 'echo' https://github.com/status-im/status-react/tarball/${GIT_COMMIT}
|
||||||
|
|
||||||
# hack to avoid calling login
|
# hack to avoid calling login
|
||||||
ENV USER=jenkins
|
ENV USER=jenkins
|
||||||
|
|
|
@ -16,12 +16,15 @@ def getToolVersion(name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
def nix_sh(cmd) {
|
def nix_sh(cmd) {
|
||||||
|
def isPure = env.TARGET_PLATFORM == 'linux'
|
||||||
|
def pureFlag = isPure ? '--pure' : ''
|
||||||
|
|
||||||
sh """
|
sh """
|
||||||
set +x
|
set +x
|
||||||
. ~/.nix-profile/etc/profile.d/nix.sh
|
. ~/.nix-profile/etc/profile.d/nix.sh
|
||||||
set -x
|
set -x
|
||||||
nix-shell --argstr target-os \'${env.TARGET_PLATFORM}\' \\
|
nix-shell --argstr target-os \'${env.TARGET_PLATFORM}\' \\
|
||||||
--run \'${cmd}\' \\
|
${pureFlag} --run \'${cmd}\' \\
|
||||||
\'${env.WORKSPACE}/shell.nix\'
|
\'${env.WORKSPACE}/shell.nix\'
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,12 @@ if ! command -v "nix" >/dev/null 2>&1; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v "nix" >/dev/null 2>&1; then
|
if command -v "nix" >/dev/null 2>&1; then
|
||||||
echo -e "${GREEN}Configuring Nix shell for target '${TARGET_OS:=all}'...${NC}";
|
echo -e "${GREEN}Configuring Nix shell for target '${TARGET_OS:=all}'...${NC}"
|
||||||
if [[ $@ == "ENTER_NIX_SHELL" ]]; then
|
if [[ $@ == "ENTER_NIX_SHELL" ]]; then
|
||||||
exec nix-shell --show-trace --argstr target-os ${TARGET_OS}
|
exec nix-shell --show-trace --argstr target-os ${TARGET_OS}
|
||||||
else
|
else
|
||||||
exec nix-shell --show-trace --argstr target-os ${TARGET_OS} --run "$@"
|
is_pure=''
|
||||||
|
[ "${TARGET_OS}" == 'linux' ] && is_pure='--pure'
|
||||||
|
exec nix-shell ${is_pure} --show-trace --argstr target-os ${TARGET_OS} --run "$@"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue