Skip to content

Commit

Permalink
add version to container (#4)
Browse files Browse the repository at this point in the history
* add version to container
* remove hook dir
* add instanse name to gc function logs
  • Loading branch information
Shareed2k authored Jun 1, 2022
1 parent 52914df commit 7ebc2af
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: docker/build-push-action@v3
with:
push: true
build-args: VERSION=${{ github.ref_name }}
tags: |
bringg/jenkins-autoscaler:${{ github.ref_name }}
bringg/jenkins-autoscaler:latest
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:1.18-alpine as builder

ARG SOURCE_BRANCH=development
ENV VERSION=$SOURCE_BRANCH
ARG VERSION=development
ENV VERSION=$VERSION

WORKDIR /opt/jenkins-autoscaler/
COPY . .
Expand Down
3 changes: 0 additions & 3 deletions hooks/build

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/scaler/scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,12 @@ func (s *Scaler) gc(ctx context.Context) error {
// TODO: let user specify time
// not taking down nodes that are running less than 20 minutes
if instanceLunchTime := time.Since(*instance.LaunchTime()); instanceLunchTime < 20*time.Minute {
logger.Infof("not taking node down since it is running only %v", instanceLunchTime)
logger.Infof("not taking instance %q down since it is running only %v", name, instanceLunchTime)

continue
}

logger.Infof("found running instance %v which is not registered in Jenkins. will try to remove it", name)
logger.Infof("found running instance %q which is not registered in Jenkins. will try to remove it", name)

ins.Add(instance)
}
Expand Down

0 comments on commit 7ebc2af

Please sign in to comment.