build: minor updates, finishing up..
This commit is contained in:
parent
8b0c5d1494
commit
4c4920b272
2 changed files with 17 additions and 13 deletions
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
|
|
@ -4,32 +4,36 @@ pipeline {
|
||||||
PROJECT_OWNER = "devaine"
|
PROJECT_OWNER = "devaine"
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage("Build") {
|
stage("build-desec") {
|
||||||
|
environment {
|
||||||
|
SCRIPT_NAME = "desec"
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
// Reference: https://www.jenkins.io/doc/pipeline/steps/credentials-binding/
|
// Reference: https://www.jenkins.io/doc/pipeline/steps/credentials-binding/
|
||||||
withCredentials([
|
withCredentials([
|
||||||
string(
|
string(
|
||||||
credentialsId: "FORGEJO_REGISTRY",
|
credentialsId: "FORGEJO_REGISTRY",
|
||||||
variable: "FORGEJO_REGISTRY"
|
variable: "REGISTRY"
|
||||||
),
|
),
|
||||||
usernamePassword(
|
usernamePassword(
|
||||||
credentialsId: "FORGEJO_REGISTRY_LOGIN",
|
credentialsId: "FORGEJO_REGISTRY_LOGIN",
|
||||||
usernameVariable: "FORGEJO_USERNAME",
|
usernameVariable: "FORGEJO_USERNAME",
|
||||||
passwordVariable: "FORGEJO_PAT"
|
passwordVariable: "FORGEJO_PAT"
|
||||||
)
|
)
|
||||||
])
|
]) {
|
||||||
|
|
||||||
// Login to the Forgejo Registry
|
// Login to the Forgejo Registry
|
||||||
sh '''
|
sh '''
|
||||||
printf "$FORGEJO_PAT" | docker login "$FORGEJO_REGISTRY" -u "$FOREGJO_PAT_USER" --password-stdin
|
printf "$FORGEJO_PAT" | docker login "$REGISTRY" -u "$FORGEJO_USERNAME" --password-stdin
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
// Get into the desec-ip-sync directory
|
||||||
dir('./server/desec-ip-sync/') {
|
dir('./server/desec-ip-sync/') {
|
||||||
sh '''
|
sh '''
|
||||||
docker buildx build -t "$FOREGJO_REGISTRY"/${env.PROJECT_OWNER}/${env.JOB_NAME}
|
docker buildx build -t "$REGISTRY"/"$PROJECT_OWNER"/"$SCRIPT_NAME" .
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Clean workspace after build
|
// Clean workspace after build
|
||||||
cleanWs()
|
cleanWs()
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ WORKDIR /desec/server/desec-ip-sync/
|
||||||
|
|
||||||
SHELL ["bash", "-c"]
|
SHELL ["bash", "-c"]
|
||||||
|
|
||||||
RUN apt update && apt install python3.11-venv -y
|
RUN apt update && apt install python3-all-venv -y
|
||||||
|
|
||||||
RUN bash run.bash
|
RUN bash run.bash
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue