-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vue skeleton to host map #26
Merged
Merged
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8869bf8
shell app structure
cnell-usgs 54fbd17
build js env
cnell-usgs 77d49f8
reduce clutter
cnell-usgs 718a213
generate list of svg files for selection
cnell-usgs 9cc7d9f
add peaks svg to vue assets
cnell-usgs 893cb2f
add path data to vue to help d3 animation
cnell-usgs f9c9f43
feed vue list of svg files from R
cnell-usgs 7ba5621
define peaks with defs
cnell-usgs f24df08
remove test transitions
cnell-usgs 844ca84
delete extra components
cnell-usgs b4070b7
drop carousel
cnell-usgs 4e16ad3
adding back vuecarousel for mystery dependency
cnell-usgs 106952e
capital C
cnell-usgs b76493c
separate file copy to new target
cnell-usgs 58b014e
drop dynamic file naming but keeping dummy svg for now
cnell-usgs 9f1cdf5
remove list of svg files
cnell-usgs 164cf97
use file copy as command
cnell-usgs 2cfc9b5
add to yml
cnell-usgs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
> 1% | ||
last 1 version | ||
IE 11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
VUE_APP_TITLE='gw-conditions' | ||
|
||
VUE_APP_FOOTER_1='https://labs.waterdata.usgs.gov/visualizations/temperature-prediction/index.html#/' | ||
VUE_APP_FOOTER_2='https://labs.waterdata.usgs.gov/visualizations/snow-to-flow/index.html#/' | ||
VUE_APP_GITHUB_REPOSITORY_LINK='https://github.com/USGS-VIZLAB/gw-conditions' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VUE_APP_TIER=-beta build- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VUE_APP_TIER='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VUE_APP_TIER=-test build- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
'extends': 'plugin:vue/recommended', | ||
'parserOptions': { | ||
'parser': 'babel-eslint' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM artifactory.wma.chs.usgs.gov/docker-official-mirror/debian:stretch | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
# Run updates and install curl | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install curl -y && \ | ||
apt-get purge -y --auto-remove && \ | ||
apt-get clean | ||
|
||
# Enable the NodeSource repository and install the latest nodejs | ||
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ | ||
apt-get install nodejs -y | ||
|
||
# Create temp directory for building viz app | ||
RUN mkdir -p /tmp/gw-conditions | ||
|
||
# Copy source code | ||
WORKDIR /tmp/gw-conditions | ||
COPY . . | ||
# Set environment variables for build target and tile source and then run config.sh | ||
# to insert the correct S3 tile source URLs in the Mapbox configuration file. | ||
ARG BUILDTARGET="test" | ||
ARG VUE_BUILD_MODE="development" | ||
ENV E_BUILDTARGET=$BUILDTARGET | ||
ENV E_VUE_BUILD_MODE=$VUE_BUILD_MODE | ||
|
||
# Build the Vue app. | ||
RUN npm install | ||
RUN chmod +x ./build.sh && ./build.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
License | ||
======= | ||
|
||
Unless otherwise noted, This project is in the public domain in the United | ||
States because it contains materials that originally came from the United | ||
States Geological Survey, an agency of the United States Department of | ||
Interior. For more information, see the official USGS copyright policy at | ||
https://www2.usgs.gov/visual-id/credit_usgs.html#copyright | ||
|
||
Additionally, we waive copyright and related rights in the work | ||
worldwide through the CC0 1.0 Universal public domain dedication. | ||
|
||
|
||
CC0 1.0 Universal Summary | ||
------------------------- | ||
|
||
This is a human-readable summary of the | ||
[Legal Code (read the full text)][1]. | ||
|
||
|
||
### No Copyright | ||
|
||
The person who associated a work with this deed has dedicated the work to | ||
the public domain by waiving all of his or her rights to the work worldwide | ||
under copyright law, including all related and neighboring rights, to the | ||
extent allowed by law. | ||
|
||
You can copy, modify, distribute and perform the work, even for commercial | ||
purposes, all without asking permission. | ||
|
||
|
||
### Other Information | ||
|
||
In no way are the patent or trademark rights of any person affected by CC0, | ||
nor are the rights that other persons may have in the work or in how the | ||
work is used, such as publicity or privacy rights. | ||
|
||
Unless expressly stated otherwise, the person who associated a work with | ||
this deed makes no warranties about the work, and disclaims liability for | ||
all uses of the work, to the fullest extent permitted by applicable law. | ||
When using or citing the work, you should not imply endorsement by the | ||
author or the affirmer. | ||
|
||
|
||
|
||
[1]: https://creativecommons.org/publicdomain/zero/1.0/legalcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
presets: [ | ||
[ "@vue/app", | ||
{ | ||
useBuiltIns: "entry" | ||
}] | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
echo "this is the var $E_VUE_BUILD_MODE" | ||
if [ "$E_VUE_BUILD_MODE" = "test" ] | ||
then npm run build-test | ||
elif [ "$E_VUE_BUILD_MODE" = "beta" ] | ||
then npm run build-beta | ||
else npm run build | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
pipeline { | ||
agent { | ||
node { | ||
label 'team:makerspace-small' | ||
} | ||
} | ||
triggers { pollSCM('*/5 * * * *') } | ||
parameters { | ||
choice(choices: ['test', 'beta', 'prod'], description: 's3 bucket that the build will target', name: 'BUILD_DEST') | ||
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') | ||
gitParameter(name: 'BRANCH_TAG', | ||
type: 'PT_BRANCH_TAG', | ||
selectedValue: 'DEFAULT', | ||
defaultValue: 'origin/main') | ||
} | ||
|
||
stages { | ||
stage('clean workspace'){ | ||
steps{ | ||
cleanWs() | ||
} | ||
} | ||
stage('checkout'){ | ||
steps{ | ||
checkout([$class: 'GitSCM', | ||
branches: [[name: "${params.BRANCH_TAG}"]], | ||
doGenerateSubmoduleConfigurations: false, | ||
extensions: [], | ||
gitTool: 'Default', | ||
submoduleCfg: [], | ||
userRemoteConfigs: [[url: 'https://github.com/usgs-vizlab/gw-conditions.git']] | ||
]) | ||
} | ||
} | ||
|
||
stage('build') { | ||
steps { | ||
|
||
sh """ | ||
docker build . --tag="gw-conditions-docker" --build-arg BUILDTARGET=${params.BUILD_DEST} --build-arg VUE_BUILD_MODE=${params.VUE_BUILD_MODE} | ||
docker run gw-conditions-docker | ||
pathtemplate=":tmp/gw-conditions/dist" | ||
dockerinstanceid=\$( docker ps -l -q ) | ||
docker cp "\${dockerinstanceid}\${pathtemplate}" "$WORKSPACE" | ||
docker rm "\${dockerinstanceid}" | ||
""" | ||
|
||
} | ||
} | ||
|
||
stage('send to S3') { | ||
steps { | ||
script { | ||
if ("${params.BUILD_DEST}" == "prod") { | ||
targetDomain = "s3://water-visualizations-prod-website/visualizations/gw-conditions" | ||
} | ||
else if ("${params.BUILD_DEST}" == "beta") { | ||
targetDomain = "s3://water-visualizations-beta-website/visualizations/gw-conditions" | ||
} | ||
else { | ||
targetDomain = "s3://water-visualizations-test-website/visualizations/gw-conditions" | ||
} | ||
} | ||
sh """ | ||
aws s3 rm "${targetDomain}" --recursive | ||
aws s3 cp "$WORKSPACE/dist" "${targetDomain}" --recursive | ||
""" | ||
} | ||
} | ||
} | ||
|
||
post { | ||
success { | ||
mail to: '[email protected], [email protected]', | ||
subject: "Success: ${currentBuild.fullDisplayName}", | ||
body: "Pipeline finished successfully ${env.BUILD_URL}" | ||
} | ||
unstable { | ||
mail to: '[email protected], [email protected]', | ||
subject: "Unstable: ${currentBuild.fullDisplayName}", | ||
body: "Pipeline is unstable ${env.BUILD_URL}" | ||
} | ||
failure { | ||
mail to: '[email protected], [email protected]', | ||
subject: "Failure: ${currentBuild.fullDisplayName}", | ||
body: "Pipeline failed ${env.BUILD_URL}" | ||
} | ||
changed { | ||
mail to: '[email protected], [email protected], [email protected]', | ||
subject: "Changes: ${currentBuild.fullDisplayName}", | ||
body: "Pipeline detected changes ${env.BUILD_URL}" | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary but one final thing is that you don't need a separate function here. You can simply make
file.copy()
the function for the target.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol totally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just need to use
to =
andfrom =
becausetarget_name
has to be passed in as the first argThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need
overwrite = TRUE
in the file.copy function so this works as expected, otherwise it silently doesn't replace theto
target even when thefrom
file has changed. Remember this issue @lindsayplatt ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently I still haven't learned my lesson! Thanks @jread-usgs. They had that in the custom function below but I neglected to carry it over to this suggestion :)