Skip to content

Commit

Permalink
add mxs base repo
Browse files Browse the repository at this point in the history
  • Loading branch information
cnell-usgs committed Jul 30, 2021
1 parent 8eb2d4d commit 8ecdc94
Show file tree
Hide file tree
Showing 52 changed files with 18,004 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 1 version
IE 11
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VUE_APP_TITLE=change the title in env file

VUE_APP_FOOTER_1=''
VUE_APP_FOOTER_2=''
VUE_APP_GITHUB_REPOSITORY_LINK=''
1 change: 1 addition & 0 deletions .env.beta_tier
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VUE_APP_TIER=-beta build-
1 change: 1 addition & 0 deletions .env.prod_tier
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VUE_APP_TIER=''
1 change: 1 addition & 0 deletions .env.test_tier
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VUE_APP_TIER=-test build-
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
'extends': 'plugin:vue/recommended',
'parserOptions': {
'parser': 'babel-eslint'
}
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog
All notable changes to this project will be documented in this file.

## [Unreleased]

### known issues for [Unreleased]
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM 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/delaware-basin-story-CHANGE_THIS_TO_NAME_OF_PROJECT

# Copy source code
WORKDIR /tmp/delaware-basin-story-CHANGE_THIS_TO_NAME_OF_PROJECT
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

46 changes: 46 additions & 0 deletions LICENSE.md
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
19 changes: 19 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Changes made:
-----------
Description


Testing:
----------------------------
Before making this pull request, I:
- [ ] Cleaned the code the way Vue likes it - run 'npm run lint --fix'
- [ ] Made sure all tests run
- [ ] Ran WAVE plugin 508 compliance tool

I can confirm this has been checked on:
- [ ] Chrome
- [ ] Safari
- [ ] Edge
- [ ] Firefox
- [ ] Samsung Internet
- [ ] Internet Explorer 11 (not supported, but still needs at least a working user redirect page)
363 changes: 363 additions & 0 deletions README.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
presets: [
[ "@vue/app",
{
useBuiltIns: "entry"
}]
]
};
7 changes: 7 additions & 0 deletions build.sh
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
94 changes: 94 additions & 0 deletions jenkins/Jenkinsfile.build
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/CHANGE_THIS_TO_NAME_OF_PROJECT.git']]
])
}
}

stage('build') {
steps {

sh """
docker build . --tag="CHANGE_THIS_TO_NAME_OF_PROJECT-docker" --build-arg BUILDTARGET=${params.BUILD_DEST} --build-arg VUE_BUILD_MODE=${params.VUE_BUILD_MODE}
docker run CHANGE_THIS_TO_NAME_OF_PROJECT-docker
pathtemplate=":tmp/CHANGE_THIS_TO_NAME_OF_PROJECT/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/CHANGE_THIS_TO_NAME_OF_PROJECT"
}
else if ("${params.BUILD_DEST}" == "beta") {
targetDomain = "s3://water-visualizations-beta-website/visualizations/CHANGE_THIS_TO_NAME_OF_PROJECT"
}
else {
targetDomain = "s3://water-visualizations-test-website/visualizations/CHANGE_THIS_TO_NAME_OF_PROJECT"
}
}
sh """
aws s3 rm "${targetDomain}" --recursive
aws s3 cp "$WORKSPACE/dist" "${targetDomain}" --recursive
"""
}
}
}

post {
success {
mail to: '[email protected], [email protected], [email protected]',
subject: "Success: ${currentBuild.fullDisplayName}",
body: "Pipeline finished successfully ${env.BUILD_URL}"
}
unstable {
mail to: '[email protected], [email protected], [email protected]',
subject: "Unstable: ${currentBuild.fullDisplayName}",
body: "Pipeline is unstable ${env.BUILD_URL}"
}
failure {
mail to: '[email protected], [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}"
}
}
}
Binary file added markDownImages/Sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added markDownImages/USWDSBanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8ecdc94

Please sign in to comment.