Skip to content

Commit dbe6f61

Browse files
Merge pull request #212 from hcorson-dosch-usgs/fix_jenkins_setup
update jenkins file to match vue3-template repo setup
2 parents 0009803 + 8cd40e9 commit dbe6f61

File tree

2 files changed

+19
-114
lines changed

2 files changed

+19
-114
lines changed

jenkins/Jenkinsfile.build

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ pipeline {
44
label 'team:makerspace-small'
55
}
66
}
7-
7+
triggers { pollSCM('*/5 * * * *') }
88
parameters {
9-
choice(choices: ['test', 'qa', 'beta', 'prod'], description: 's3 bucket that the build will target', name: 'BUILD_DEST')
10-
choice(choices: ['test', 'qa', 'beta', 'prod'], description: 'The mode selected will tell Vue which environment variables to use. Various feature flags will be disabled/enabled depending on mode. More importantly, the source of the tiles will change, with the development build loading tiles from the test S3 bucket and the production build loading tiles from the prod S3 bucket.', name: 'VUE_BUILD_MODE')
9+
choice(choices: ['test', 'beta', 'prod'], description: 's3 bucket that the build will target', name: 'BUILD_DEST')
10+
choice(choices: ['test', 'beta', 'prod'], description: 'The mode selected will tell Vue which environment variables to use. Various feature flags will be disabled/enabled depending on mode. More importantly, the source of the tiles will change, with the development build loading tiles from the test S3 bucket and the production build loading tiles from the prod S3 bucket.', name: 'VUE_BUILD_MODE')
11+
choice(choices: ['gages-through-the-ages'], description: 'project name, url extension, and GitLab repository name, matching VITE_APP_TITLE set in .env', name: 'VITE_APP_TITLE')
1112
gitParameter(name: 'BRANCH_TAG',
1213
type: 'PT_BRANCH_TAG',
13-
defaultValue: 'master')
14+
selectedValue: 'DEFAULT',
15+
defaultValue: 'origin/main')
1416
}
1517

1618
stages {
@@ -27,7 +29,7 @@ pipeline {
2729
extensions: [],
2830
gitTool: 'Default',
2931
submoduleCfg: [],
30-
userRemoteConfigs: [[url: 'https://github.com/usgs-makerspace/gages-through-the-ages']]
32+
userRemoteConfigs: [[url: "https://github.com/DOI-USGS/${params.VITE_APP_TITLE}.git", credentialsId: "vizlab_jenkins_${params.VITE_APP_TITLE}"]]
3133
])
3234
}
3335
}
@@ -36,9 +38,9 @@ pipeline {
3638
steps {
3739

3840
sh """
39-
docker build . --tag="gages-through-the-ages-docker" --build-arg BUILDTARGET=${params.BUILD_DEST} --build-arg VUE_BUILD_MODE=${params.VUE_BUILD_MODE}
40-
docker run gages-through-the-ages-docker
41-
pathtemplate=":tmp/gages-through-the-ages/dist"
41+
docker build . --tag="${params.VITE_APP_TITLE}-docker" --build-arg BUILD_DEST=${params.BUILD_DEST} --build-arg VUE_BUILD_MODE=${params.VUE_BUILD_MODE} --build-arg VITE_APP_TITLE=${params.VITE_APP_TITLE}
42+
docker run ${params.VITE_APP_TITLE}-docker
43+
pathtemplate=":tmp/${params.VITE_APP_TITLE}/dist"
4244
dockerinstanceid=\$( docker ps -l -q )
4345
docker cp "\${dockerinstanceid}\${pathtemplate}" "$WORKSPACE"
4446
docker rm "\${dockerinstanceid}"
@@ -51,44 +53,41 @@ pipeline {
5153
steps {
5254
script {
5355
if ("${params.BUILD_DEST}" == "prod") {
54-
targetDomain = "s3://gages-through-the-ages-prod-website"
55-
}
56-
else if ("${params.BUILD_DEST}" == "qa") {
57-
targetDomain = "s3://gages-through-the-ages-qa-website"
56+
targetDomain = "s3://water-visualizations-prod-website/visualizations/${params.VITE_APP_TITLE}"
5857
}
5958
else if ("${params.BUILD_DEST}" == "beta") {
60-
targetDomain = "s3://gages-through-the-ages-beta-website"
59+
targetDomain = "s3://water-visualizations-beta-website/visualizations/${params.VITE_APP_TITLE}"
6160
}
6261
else {
63-
targetDomain = "s3://gages-through-the-ages-test-website"
62+
targetDomain = "s3://water-visualizations-test-website/visualizations/${params.VITE_APP_TITLE}"
6463
}
6564
}
6665
sh """
67-
aws s3 rm "${targetDomain}"
68-
aws s3 cp "$WORKSPACE/dist" "${targetDomain}"/gages-through-the-ages --recursive
66+
aws s3 rm "${targetDomain}" --recursive
67+
aws s3 cp "$WORKSPACE/dist" "${targetDomain}" --recursive
6968
"""
7069
}
7170
}
7271
}
7372

7473
post {
7574
success {
76-
mail to: '[email protected], mwernimont@contractor.usgs.gov',
75+
mail to: 'cnell@usgs.gov',
7776
subject: "Success: ${currentBuild.fullDisplayName}",
7877
body: "Pipeline finished successfully ${env.BUILD_URL}"
7978
}
8079
unstable {
81-
mail to: '[email protected], mwernimont@contractor.usgs.gov',
80+
mail to: 'cnell@usgs.gov',
8281
subject: "Unstable: ${currentBuild.fullDisplayName}",
8382
body: "Pipeline is unstable ${env.BUILD_URL}"
8483
}
8584
failure {
86-
mail to: '[email protected], mwernimont@contractor.usgs.gov',
85+
mail to: 'cnell@usgs.gov',
8786
subject: "Failure: ${currentBuild.fullDisplayName}",
8887
body: "Pipeline failed ${env.BUILD_URL}"
8988
}
9089
changed {
91-
mail to: '[email protected], mwernimont@contractor.usgs.gov',
90+
mail to: 'cnell@usgs.gov',
9291
subject: "Changes: ${currentBuild.fullDisplayName}",
9392
body: "Pipeline detected changes ${env.BUILD_URL}"
9493
}

jenkins/JenkinsfileUnified.build

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)