mirror of
https://github.com/vacp2p/rfc.vac.dev.git
synced 2026-01-07 23:23:51 -05:00
ci: add nix flake and use in CI
Using system tooling can lead to weird behavior of available Node
versions, for example this IPv6 resolution error:
```
[3/5] Fetching packages...
error Error: connect EHOSTUNREACH 2606:4700::6810:1922:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
```
This commit is contained in:
25
Jenkinsfile
vendored
25
Jenkinsfile
vendored
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env groovy
|
#!/usr/bin/env groovy
|
||||||
library 'status-jenkins-lib@v1.8.15'
|
library 'status-jenkins-lib@v1.9.24'
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'linux' }
|
agent { label 'linux' }
|
||||||
@@ -23,32 +23,41 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Install') {
|
stage('Install') {
|
||||||
steps {
|
steps {
|
||||||
sh 'yarn install'
|
script {
|
||||||
|
nix.develop('yarn install')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Scrape') {
|
stage('Scrape') {
|
||||||
steps {
|
steps {
|
||||||
sh 'yarn scrape'
|
script {
|
||||||
|
nix.develop('yarn scrape', keepEnv: ['INCLUDED_DIRS','FETCH_MODE'])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps { script {
|
steps {
|
||||||
sh 'yarn build'
|
script {
|
||||||
|
nix.develop('yarn build')
|
||||||
jenkins.genBuildMetaJSON('build/build.json')
|
jenkins.genBuildMetaJSON('build/build.json')
|
||||||
} }
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Publish') {
|
stage('Publish') {
|
||||||
steps {
|
steps {
|
||||||
sshagent(credentials: ['status-im-auto-ssh']) {
|
sshagent(credentials: ['status-im-auto-ssh']) {
|
||||||
sh """
|
script {
|
||||||
|
nix.develop("""
|
||||||
ghp-import \
|
ghp-import \
|
||||||
-b ${deployBranch()} \
|
-b ${deployBranch()} \
|
||||||
-c ${deployDomain()} \
|
-c ${deployDomain()} \
|
||||||
-p build
|
-p build
|
||||||
"""
|
""", sandbox: false,
|
||||||
|
keepEnv: ['SSH_AUTH_SOCK'])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
26
flake.lock
generated
Normal file
26
flake.lock
generated
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1753749649,
|
||||||
|
"narHash": "sha256-+jkEZxs7bfOKfBIk430K+tK9IvXlwzqQQnppC2ZKFj4=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "1f08a4df998e21f4e8be8fb6fbf61d11a1a5076a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "nixpkgs",
|
||||||
|
"ref": "nixos-25.05",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
35
flake.nix
Normal file
35
flake.nix
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
description = "Nix flake development shell.";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "nixpkgs/nixos-25.05";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{ self, nixpkgs }:
|
||||||
|
let
|
||||||
|
supportedSystems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
forEachSystem = nixpkgs.lib.genAttrs supportedSystems;
|
||||||
|
pkgsFor = forEachSystem (system: import nixpkgs { inherit system; });
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
formatter = forEachSystem (system: pkgsFor.${system}.nixpkgs-fmt);
|
||||||
|
|
||||||
|
devShells = forEachSystem (system: {
|
||||||
|
default = pkgsFor.${system}.mkShellNoCC {
|
||||||
|
packages = with pkgsFor.${system}.buildPackages; [
|
||||||
|
git # 2.44.1
|
||||||
|
openssh # 9.7p1
|
||||||
|
yarn # 1.22.22
|
||||||
|
nodejs_20 # v20.15.1
|
||||||
|
ghp-import # 2.1.0
|
||||||
|
];
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user