diff --git a/Jenkinsfile b/Jenkinsfile index 462a466..1176bb8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,15 +20,17 @@ pipeline { stages { stage('Install') { - steps { - sh 'yarn install' + steps { + script { + nix.develop('yarn install') + } } } stage('Build') { steps { script { - sh 'yarn build' + nix.develop('yarn build') jenkins.genBuildMetaJSON('build/build.json') } } @@ -37,13 +39,16 @@ pipeline { stage('Publish') { steps { sshagent(credentials: ['status-im-auto-ssh']) { - sh """ - ghp-import \ - -b ${deployBranch()} \ - -c ${deployDomain()} \ - -p build - """ - } + script { + nix.develop(""" + ghp-import \ + -b ${deployBranch()} \ + -c ${deployDomain()} \ + -p build + """ + ) + } + } } } } diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..96b010f --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1722869614, + "narHash": "sha256-7ojM1KSk3mzutD7SkrdSflHXEujPvW1u7QuqWoTLXQU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "883180e6550c1723395a3a342f830bfc5c371f6b", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-24.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} \ No newline at end of file diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3b259bb --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-24.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; [ + yarn # 1.22.22 + nodejs_20 # v20.15.1 + ghp-import # 2.1.0 + ]; + }; + }); + }; +}