mirror of
https://github.com/logos-co/logos-web.git
synced 2026-08-27 04:01:12 +00:00
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 <marko@status.im>
This commit is contained in:
Vendored
+53
@@ -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' }
|
||||
Generated
+26
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user