mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-02 13:53:12 +00:00
ci: move it to a container
Add nix flake and use it in the pipeline for reliability and reproducability. Referenced issue: * https://github.com/status-im/infra-ci/issues/188
This commit is contained in:
parent
0df18b2a75
commit
e2c9364053
@ -23,6 +23,15 @@ npm install
|
||||
npm run doc
|
||||
```
|
||||
|
||||
# Using Nix shell
|
||||
```shell
|
||||
git clone https://github.com/waku-org/js-waku.git
|
||||
cd js-waku
|
||||
nix develop
|
||||
npm install
|
||||
npm run doc
|
||||
```
|
||||
|
||||
## Bugs, Questions & Features
|
||||
|
||||
If you encounter any bug or would like to propose new features, feel free to [open an issue](https://github.com/waku-org/js-waku/issues/new/).
|
||||
|
||||
26
ci/Jenkinsfile
vendored
26
ci/Jenkinsfile
vendored
@ -1,5 +1,13 @@
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
agent {
|
||||
docker {
|
||||
label 'linuxcontainer'
|
||||
image 'harbor.status.im/infra/ci-build-containers:linux-base-1.0.0'
|
||||
args '--volume=/nix:/nix ' +
|
||||
'--volume=/etc/nix:/etc/nix ' +
|
||||
'--user jenkins'
|
||||
}
|
||||
}
|
||||
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
@ -21,19 +29,25 @@ pipeline {
|
||||
stages {
|
||||
stage('Deps') {
|
||||
steps {
|
||||
sh 'npm install'
|
||||
script {
|
||||
nix.develop('npm install', pure: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Packages') {
|
||||
steps {
|
||||
sh 'npm run build'
|
||||
script {
|
||||
nix.develop('npm run build', pure: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'npm run doc'
|
||||
script {
|
||||
nix.develop('npm run doc', pure: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,7 +55,9 @@ pipeline {
|
||||
when { expression { GIT_BRANCH.endsWith('master') } }
|
||||
steps {
|
||||
sshagent(credentials: ['status-im-auto-ssh']) {
|
||||
sh 'npm run deploy'
|
||||
script {
|
||||
nix.develop('npm run deploy', pure: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
26
flake.lock
generated
Normal file
26
flake.lock
generated
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1761016216,
|
||||
"narHash": "sha256-G/iC4t/9j/52i/nm+0/4ybBmAF4hzR8CNHC75qEhjHo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "481cf557888e05d3128a76f14c76397b7d7cc869",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-25.05",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
33
flake.nix
Normal file
33
flake.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
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
|
||||
nodejs_20 # v20.15.1
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user