Skip to content

Commit 16cd655

Browse files
SNOW-2114098 add Jenkins script to build/push a prober image to cloud registries (#2345)
Co-authored-by: Patryk Cyrek <[email protected]>
1 parent 7aadb73 commit 16cd655

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

prober/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
FROM alpine:3.18
22

3+
# boilerplate labels required by validation when pushing to ACR, ECR & GCR
4+
LABEL org.opencontainers.image.source="https://github.com/snowflakedb/snowflake-connector-python"
5+
LABEL com.snowflake.owners.email="[email protected]"
6+
LABEL com.snowflake.owners.slack="triage-snow-drivers-warsaw-dl"
7+
LABEL com.snowflake.owners.team="Snow Drivers"
8+
LABEL com.snowflake.owners.jira_area="Developer Platform"
9+
LABEL com.snowflake.owners.jira_component="Python Driver"
10+
# fake layers label to pass the validation
11+
LABEL com.snowflake.ugcbi.layers="sha256:850959b749c07b254308a4d1a84686fd7c09fcb94aeae33cc5748aa07e5cb232,sha256:b79d3c4628a989cbb8bc6f0bf0940ff33a68da2dca9c1ffbf8cfb2a27ac8d133,sha256:1cbcc0411a84fbce85e7ee2956c8c1e67b8e0edc81746a33d9da48c852037c3e,sha256:07e89b796f91d37255c6eec926b066d6818f3f2edc344a584d1b9566f77e1c27,sha256:84ff92691f909a05b224e1c56abb4864f01b4f8e3c854e4bb4c7baf1d3f6d652,sha256:3ab72684daee4eea64c3ae78a43ea332b86358446b6f2904dca4b634712e1537"
12+
313
RUN apk add --no-cache \
414
bash \
515
git \

prober/Jenkinsfile.groovy

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
pipeline {
2+
agent { label 'regular-memory-node' }
3+
4+
options {
5+
ansiColor('xterm')
6+
timestamps()
7+
}
8+
9+
environment {
10+
VAULT_CREDENTIALS = credentials('vault-jenkins')
11+
COMMIT_SHA_SHORT = sh(script: 'cd PythonConnector/prober && git rev-parse --short HEAD', returnStdout: true).trim()
12+
IMAGE_NAME = 'snowdrivers/python-driver-prober'
13+
TEAM_NAME = 'Snow Drivers'
14+
TEAM_JIRA_DL = 'triage-snow-drivers-warsaw-dl'
15+
TEAM_JIRA_AREA = 'Developer Platform'
16+
TEAM_JIRA_COMPONENT = 'Python Driver'
17+
}
18+
19+
stages {
20+
stage('Build Image') {
21+
steps {
22+
dir('./PythonConnector/prober') {
23+
sh """
24+
ls -l
25+
docker build \
26+
-t ${IMAGE_NAME}:${COMMIT_SHA_SHORT} \
27+
--label "org.opencontainers.image.revision=${COMMIT_SHA_SHORT}" \
28+
-f ./Dockerfile .
29+
"""
30+
}
31+
}
32+
}
33+
34+
stage('Checkout Jenkins Push Scripts') {
35+
steps {
36+
dir('k8sc-jenkins_scripts') {
37+
git branch: 'master',
38+
credentialsId: 'jenkins-snowflake-github-app-3',
39+
url: 'https://github.com/snowflakedb/k8sc-jenkins_scripts.git'
40+
}
41+
}
42+
}
43+
44+
stage('Push Image') {
45+
steps {
46+
sh """
47+
./k8sc-jenkins_scripts/jenkins_push.sh \
48+
-r "${VAULT_CREDENTIALS_USR}" \
49+
-s "${VAULT_CREDENTIALS_PSW}" \
50+
-i "${IMAGE_NAME}" \
51+
-v "${COMMIT_SHA_SHORT}" \
52+
-n "${TEAM_JIRA_DL}" \
53+
-a "${TEAM_JIRA_AREA}" \
54+
-C "${TEAM_JIRA_COMPONENT}"
55+
"""
56+
}
57+
}
58+
}
59+
60+
post {
61+
always {
62+
cleanWs()
63+
}
64+
}
65+
}

0 commit comments

Comments
 (0)