Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
needrestart2prom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Schneider
needrestart2prom
Commits
f857359e
Commit
f857359e
authored
3 years ago
by
Thomas Schneider
Browse files
Options
Downloads
Plain Diff
Merge branch 'ci' into 'main'
Merge GitLab CI config See merge request
!1
parents
396657a2
88ec62ca
No related branches found
No related tags found
1 merge request
!1
Merge GitLab CI config
Pipeline
#3247
passed
3 years ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+40
-7
40 additions, 7 deletions
.gitlab-ci.yml
needrestart2prom.go
+0
-1
0 additions, 1 deletion
needrestart2prom.go
with
40 additions
and
8 deletions
.gitlab-ci.yml
+
40
−
7
View file @
f857359e
---
---
image
:
debian:buster
variables
:
variables
:
GOCACHE
:
$CI_PROJECT_DIR/.gocache
GOCACHE
:
$CI_PROJECT_DIR/.gocache
GOPATH
:
$CI_PROJECT_DIR/.go
GOPATH
:
$CI_PROJECT_DIR/.go
PACKAGE_REGISTRY_URL
:
>-
$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/needrestart2prom
cache
:
cache
:
paths
:
paths
:
-
.gocache
-
.gocache
-
.go
-
.go
build
:
image
:
golang:1-buster
stage
:
build
before_script
:
before_script
:
-
echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list
-
apt-get update && apt-get -qq -y -t buster-backports install golang git
-
go version
-
go version
build
:
script
:
script
:
-
go build -o $CI_PROJECT_NAME-$GOOS-$GOARCH
-
go build -o $CI_PROJECT_NAME-$GOOS-$GOARCH
artifacts
:
artifacts
:
...
@@ -29,3 +28,37 @@ build:
...
@@ -29,3 +28,37 @@ build:
GOARCH
:
GOARCH
:
-
amd64
-
amd64
-
arm
-
arm
lint
:
image
:
golangci/golangci-lint:v1.39-alpine
stage
:
test
needs
:
[]
script
:
-
>-
golangci-lint
run
-v
--max-issues-per-linter=0
--max-same-issues=0
--out-format=junit-xml
--timeout=10m
> golangci-output.xml
artifacts
:
paths
:
-
golangci-output.xml
reports
:
junit
:
golangci-output.xml
expire_in
:
7 days
upload
:
stage
:
deploy
image
:
curlimages/curl:latest
needs
:
-
build
rules
:
-
if
:
'
$CI_COMMIT_REF_NAME
==
$CI_DEFAULT_BRANCH'
script
:
-
|
for file in $CI_PROJECT_NAME-linux-amd64 $CI_PROJECT_NAME-linux-arm; do
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ${file} ${PACKAGE_REGISTRY_URL}/${CI_COMMIT_REF}/${file} ;
done
This diff is collapsed.
Click to expand it.
needrestart2prom.go
+
0
−
1
View file @
f857359e
...
@@ -115,7 +115,6 @@ func registerMetrics(needrestart string, registry prometheus.Registerer) (err er
...
@@ -115,7 +115,6 @@ func registerMetrics(needrestart string, registry prometheus.Registerer) (err er
case
"SVC"
:
case
"SVC"
:
// service
// service
services
.
WithLabelValues
(
value
)
.
Set
(
1
)
services
.
WithLabelValues
(
value
)
.
Set
(
1
)
break
case
"CONT"
:
case
"CONT"
:
// container
// container
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment