mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
build: remove jenkins scripts (#295)
* update github workflow * update github workflow * update github workflow
This commit is contained in:
parent
32aacc3fd6
commit
60ced6cf4d
3 changed files with 41 additions and 134 deletions
49
.github/workflows/l2geth_ci.yml
vendored
49
.github/workflows/l2geth_ci.yml
vendored
|
|
@ -1,6 +1,30 @@
|
||||||
on: [pull_request]
|
on:
|
||||||
name: Continuous Integration
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- staging
|
||||||
|
- develop
|
||||||
|
- alpha
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- staging
|
||||||
|
- develop
|
||||||
|
- alpha
|
||||||
|
name: CI
|
||||||
jobs:
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.18.x
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
make geth
|
||||||
check:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -14,12 +38,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
rm -rf $HOME/.cache/golangci-lint
|
rm -rf $HOME/.cache/golangci-lint
|
||||||
make lint
|
make lint
|
||||||
- name: Test
|
|
||||||
run: |
|
|
||||||
go get ./...
|
|
||||||
make test
|
|
||||||
- name: Upload coverage report
|
|
||||||
run: bash <(curl -s https://codecov.io/bash)
|
|
||||||
goimports-lint:
|
goimports-lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -39,3 +57,18 @@ jobs:
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.18.x
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
go get ./...
|
||||||
|
make test
|
||||||
|
- name: Upload coverage report
|
||||||
|
run: bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
|
||||||
65
build/jenkins/Jenkinsfile
vendored
65
build/jenkins/Jenkinsfile
vendored
|
|
@ -1,65 +0,0 @@
|
||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
tools {
|
|
||||||
go 'go-1.18'
|
|
||||||
}
|
|
||||||
environment {
|
|
||||||
GO111MODULE = 'on'
|
|
||||||
}
|
|
||||||
stages {
|
|
||||||
stage('Build') {
|
|
||||||
steps {
|
|
||||||
// Get some code from a GitHub repository
|
|
||||||
|
|
||||||
// git branch: 'zkrollup',
|
|
||||||
// credentialsId: 'testgitchuhan1',
|
|
||||||
// url: 'git@github.com:scroll-tech/go-ethereum.git'
|
|
||||||
|
|
||||||
// Build the app.
|
|
||||||
sh 'go build'
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
stage('Test') {
|
|
||||||
// Use golang.
|
|
||||||
steps {
|
|
||||||
// Remove cached test results.
|
|
||||||
sh 'go clean -cache'
|
|
||||||
// Run Unit Tests.
|
|
||||||
sh 'make test'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Docker') {
|
|
||||||
environment {
|
|
||||||
// Extract the username and password of our credentials into "DOCKER_CREDENTIALS_USR" and "DOCKER_CREDENTIALS_PSW".
|
|
||||||
// (NOTE 1: DOCKER_CREDENTIALS will be set to "your_username:your_password".)
|
|
||||||
// The new variables will always be YOUR_VARIABLE_NAME + _USR and _PSW.
|
|
||||||
// (NOTE 2: You can't print credentials in the pipeline for security reasons.)
|
|
||||||
DOCKER_CREDENTIALS = credentials('dockerhub')
|
|
||||||
}
|
|
||||||
|
|
||||||
steps {
|
|
||||||
// Use a scripted pipeline.
|
|
||||||
script {
|
|
||||||
def app
|
|
||||||
// stage('Initialize') {
|
|
||||||
// def dockerHome = tool 'myDocker'
|
|
||||||
// env.PATH = "${dockerHome}/bin:${env.PATH}"
|
|
||||||
// }
|
|
||||||
|
|
||||||
stage('Build image') {
|
|
||||||
app = docker.build("${env.DOCKER_CREDENTIALS_USR}/l2geth-img")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
cleanWs()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
credentialDocker = 'dockerhub'
|
|
||||||
|
|
||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
options {
|
|
||||||
timeout (20)
|
|
||||||
}
|
|
||||||
tools {
|
|
||||||
go 'go-1.18'
|
|
||||||
nodejs "nodejs"
|
|
||||||
}
|
|
||||||
environment {
|
|
||||||
GO111MODULE = 'on'
|
|
||||||
PATH="/home/ubuntu/.cargo/bin:$PATH"
|
|
||||||
// LOG_DOCKER = 'true'
|
|
||||||
}
|
|
||||||
stages {
|
|
||||||
stage('Tag') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
TAGNAME = sh(returnStdout: true, script: 'git tag -l --points-at HEAD')
|
|
||||||
sh "echo ${TAGNAME}"
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Build') {
|
|
||||||
environment {
|
|
||||||
DOCKER_CREDENTIALS = credentials('dockerhub')
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
withCredentials([usernamePassword(credentialsId: "${credentialDocker}", passwordVariable: 'dockerPassword', usernameVariable: 'dockerUser')]) {
|
|
||||||
// Use a scripted pipeline.
|
|
||||||
script {
|
|
||||||
stage('Push image') {
|
|
||||||
if (TAGNAME == ""){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
sh "docker login --username=${dockerUser} --password=${dockerPassword}"
|
|
||||||
sh "docker build -t scrolltech/l2geth:latest ."
|
|
||||||
sh "docker tag scrolltech/l2geth:latest scrolltech/l2geth:${TAGNAME}"
|
|
||||||
sh "docker push scrolltech/l2geth:${TAGNAME}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
success {
|
|
||||||
slackSend(message: "l2geth tag ${TAGNAME} build dockersSuccessed")
|
|
||||||
}
|
|
||||||
// triggered when red sign
|
|
||||||
failure {
|
|
||||||
slackSend(message: "l2geth tag ${TAGNAME} build docker failed")
|
|
||||||
}
|
|
||||||
always {
|
|
||||||
cleanWs()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue