Skip to content

Commit

Permalink
use prod registry for main
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaser committed Feb 5, 2024
1 parent 8d27399 commit aac7b65
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ pipeline {
// TODO: periodic multi-node jobs

environment {
TEST_REGISTRY = "registry.atmosphere.dev:5000/${env.BRANCH_NAME.toLowerCase()}"
PROD_REGISTRY = "ghcr.io/vexxhost/atmosphere"
REGISTRY = "${env.BRANCH_NAME == 'main' ? PROD_REGISTRY : TEST_REGISTRY}"

EARTHLY_CI = 'true'
EARTHLY_BUILD_ARGS = "REGISTRY=registry.atmosphere.dev:5000/${env.BRANCH_NAME.toLowerCase()}"
EARTHLY_BUILD_ARGS = "REGISTRY=${REGISTRY}"
}

stages {
Expand Down Expand Up @@ -98,8 +102,15 @@ pipeline {
}

steps {
checkout scm
sh 'earthly --push +images'
script {
if (env.BRANCH_NAME == 'main') {
docker.withRegistry('https://ghcr.io', 'github-packages-token') {
sh 'earthly --push +images'
}
} else {
sh 'earthly --push +images'
}
}

script {
env.EARTHLY_OUTPUT = 'true'
Expand All @@ -117,7 +128,6 @@ pipeline {
}

steps {
checkout scm
sh 'earthly +mkdocs-build'
}
}
Expand Down

0 comments on commit aac7b65

Please sign in to comment.