From 0fa6dd07f6b0b702d71b055ea72252b08980102f Mon Sep 17 00:00:00 2001 From: markoburcul Date: Tue, 2 Jun 2026 09:06:16 +0200 Subject: [PATCH] feat(ci): create it and add flake - flake for development and CI purpose Referenced issue: * https://github.com/status-im/infra-sites/issues/135 Signed-off-by: markoburcul --- Jenkinsfile | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.lock | 26 ++++++++++++++++++++++++++ flake.nix | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 Jenkinsfile create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..5664b17857 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,53 @@ +#!/usr/bin/env groovy +library 'status-jenkins-lib@v1.9.24' +pipeline { + 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 ' + } + } + options { + disableConcurrentBuilds() + buildDiscarder(logRotator( + numToKeepStr: '20', + daysToKeepStr: '30', + )) + } + environment { + GIT_COMMITTER_NAME = 'status-im-auto' + GIT_COMMITTER_EMAIL = 'auto@status.im' + } + stages { + stage('Build the web app') { + steps { + script { + nix.develop('pnpm --filter ./apps/web build') + } + } + } + stage('Publish') { + steps { + sshagent(credentials: ['status-im-auto-ssh']) { + script { + nix.develop(""" + ghp-import \ + -b ${deployBranch()} \ + -c ${deployDomain()} \ + -p apps/web/out + """, sandbox: false, + keepEnv: ['SSH_AUTH_SOCK']) + } + } + } + } + } + post { + cleanup { cleanWs() } + } +} +def isMasterBranch() { GIT_BRANCH ==~ /.*master/ } +def deployBranch() { isMasterBranch() ? 'deploy-master' : 'deploy-develop' } +def deployDomain() { isMasterBranch() ? 'logos.co' : 'dev.logos.co' } \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000..98ee5f8b9d --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1780203844, + "narHash": "sha256-K5sT4jTpGs15ADhviMKNBH38REpPf5Q6mM1+N6cArVE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b51242d7d43689db2f3be91bd05d5b24fbb469c4", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-26.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000..9299b228b1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + description = "Nix flake development shell."; + + inputs = { + nixpkgs.url = "nixpkgs/nixos-26.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.54.0 + openssh # 10.3p1 + pnpm # 11.4.0 + nodejs_24 # 24.15.0 + ghp-import # 2.1.0 + ]; + }; + }); + }; +}