Skip to content

Commit 228b5e2

Browse files
authored
build(jenkins): update node (#110)
* build(jenkins): update node * add log dir loc
1 parent be8b94b commit 228b5e2

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ APP=blog
22
VERSION?=latest
33
BUILD?=$(shell /bin/date +%Y%m%d%H%M%S)
44
# linux/amd64, linux/arm64
5-
PLATFORM?=linux/arm64
5+
PLATFORM?=linux/arm64,linux/amd64
66
REGISTRY?=loneexile
7+
HARBOR_REGISTRY?=harbor.voidbox.io/loneexile
78

89
ximage:
910
docker buildx create --name imagebuilder --driver=remote tcp://buildkitd:1234 --bootstrap --use;
1011
cat ~/.docker/buildx/instances/imagebuilder;
11-
docker buildx build --cache-from=type=local,src=/var/lib/buildkit --cache-to=type=local,dest=/var/lib/buildkit,mode=max -o type=registry --build-arg VERSION=$(VERSION) --build-arg BUILD=$(BUILD) --platform=$(PLATFORM) . -t $(REGISTRY)/$(APP):$(BUILD) -t $(REGISTRY)/$(APP):latest
12+
docker buildx build --cache-from=type=local,src=/var/lib/buildkit --cache-to=type=local,dest=/var/lib/buildkit,mode=max \
13+
-o type=registry --build-arg VERSION=$(VERSION) --build-arg BUILD=$(BUILD) \
14+
--platform=$(PLATFORM) . -t $(REGISTRY)/$(APP):$(BUILD) -t $(REGISTRY)/$(APP):latest \
15+
-t $(HARBOR_REGISTRY)/$(APP):$(BUILD) -t $(HARBOR_REGISTRY)/$(APP):latest

deploy/config/Jenkinsfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pipeline {
22
environment {
33
CONTAINER_REGISTRY_CREDENTIALS = credentials('docker')
4+
CONTAINER_REGISTRY_CREDENTIALS_HARBOR = credentials('harbor')
45
SONARQUBE_SCANNER_HOME = tool 'sonar-scanner' // NOTE: need to match the name of the SonarQube installer in Tools
56
}
67

@@ -10,6 +11,13 @@ pipeline {
1011
apiVersion: v1
1112
kind: Pod
1213
spec:
14+
nodeSelector:
15+
chip: intel
16+
tolerations:
17+
- key: "chip"
18+
operator: "Equal"
19+
value: "intel"
20+
effect: "NoSchedule"
1321
containers:
1422
- name: docker
1523
image: loneexile/docker-cli:latest
@@ -24,7 +32,7 @@ pipeline {
2432
mountPath: /var/lib/buildkit
2533
subPath: buildkit
2634
- name: jnlp
27-
image: loneexile/jenkins-inbound-node:arm64
35+
image: loneexile/jenkins-inbound-node:latest
2836
command:
2937
- /usr/local/bin/jenkins-agent
3038
tty: true
@@ -62,7 +70,9 @@ pipeline {
6270
steps {
6371
container('docker') {
6472
sh 'ls'
73+
sh 'pwd'
6574
sh 'echo $CONTAINER_REGISTRY_CREDENTIALS_PSW | docker login --username $CONTAINER_REGISTRY_CREDENTIALS_USR --password-stdin'
75+
sh 'echo $CONTAINER_REGISTRY_CREDENTIALS_HARBOR_PSW | docker login https://harbor.voidbox.io --username $CONTAINER_REGISTRY_CREDENTIALS_HARBOR_USR --password-stdin'
6676
// sh 'make ximage VERSION=v1.0.0'
6777
sh 'make ximage'
6878
}

0 commit comments

Comments
 (0)