Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
disagg-d3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
disagg-d3
Commits
72caa430
Commit
72caa430
authored
3 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Plain Diff
Merge branch 'pipeline-templates' into 'main'
Resolves - Pipeline Templates Closes
#3
See merge request
!12
parents
0fc1d902
4d4c5ddc
No related branches found
No related tags found
1 merge request
!12
Resolves - Pipeline Templates
Pipeline
#100134
passed
3 years ago
Stage: init
Stage: node-image
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+48
-51
48 additions, 51 deletions
.gitlab-ci.yml
package.json
+4
-4
4 additions, 4 deletions
package.json
with
52 additions
and
55 deletions
.gitlab-ci.yml
+
48
−
51
View file @
72caa430
variables
:
GITLAB_TOKEN
:
'
${CI_JOB_TOKEN}'
NODE_IMAGE_NAME
:
${CODE_REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG}
include
:
-
project
:
'
ghsc/hazdev/pipeline-build-template'
ref
:
'
1.1.3'
file
:
'
templates/library.yml'
NODE_IMAGE_NAME
:
${CODE_REGISTRY_IMAGE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_SLUG}--node
stages
:
-
init
-
node-image
-
test
-
build
-
publish
# Do not run for merge requests
workflow
:
rules
:
-
if
:
$CI_COMMIT_TAG
-
if
:
$CI_COMMIT_BRANCH
####
# Template: GitLab runner tags
####
.dev-tags
:
tags
:
-
development
####
#
Template: Run Node
#
Stage: init
####
.node
:
image
:
${NODE_IMAGE_NAME}
extends
:
-
.tags::development
before_script
:
Init
:
artifacts
:
paths
:
-
node_modules
image
:
${DEVOPS_REGISTRY}usgs/node:16
script
:
-
npm ci
stage
:
init
####
# Stage: Node Image
####
Build Node Image
:
extends
:
-
.dind
-
.tags::build
image
:
${DEVOPS_REGISTRY}docker:19.03-git
needs
:
[]
script
:
-
|
docker build \
--build-arg FROM_IMAGE=${DEVOPS_REGISTRY}usgs/node:
latest
\
--build-arg FROM_IMAGE=${DEVOPS_REGISTRY}usgs/node:
16
\
--file "Dockerfile" \
--pull \
--tag ${NODE_IMAGE_NAME} \
.
-
docker push ${NODE_IMAGE_NAME}
services
:
-
alias
:
docker
name
:
${DEVOPS_REGISTRY}docker:19.03-dind
stage
:
node-image
tags
:
-
build
variables
:
DOCKER_DRIVER
:
overlay2
####
# Stage:
test
# Stage:
Build
####
Build Angular
:
.node
:
image
:
${DEVOPS_REGISTRY}usgs/node:16
needs
:
-
Build Node Image
stage
:
test
extends
:
.node
-
Init
stage
:
build
tags
:
-
development
Build Angular
:
extends
:
-
.node
script
:
-
cd example
-
npm i
-
npm run build
Lint
:
needs
:
-
Build Node Image
stage
:
test
extends
:
.node
Lint Project
:
extends
:
-
.node
script
:
-
npm run
ts
lint
-
npm run lint
####
# Stage:
p
ublish
# Stage:
P
ublish
####
Publish npm
:
needs
:
-
Build Node Image
stage
:
publish
image
:
${NODE_IMAGE_NAME}
extends
:
.dev-tags
only
:
-
tags@ghsc/nshmp/disagg-d3
before_script
:
-
echo '//code.usgs.gov/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}' >> .npmrc
-
npm ci
-
tags
script
:
-
git config user.email "${GITLAB_USER_EMAIL}"
-
git config user.name "${GITLAB_USER_NAME}"
script
:
-
npm run build
-
|
cat <<-EO_CONFIG > .npmrc
@${CI_PROJECT_ROOT_NAMESPACE}:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/
//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}
EO_CONFIG
-
npx standard-version --release-as ${CI_COMMIT_TAG} --skip.commit --skip.changelog
-
npm publish --access public
stage
:
publish
tags
:
-
development
This diff is collapsed.
Click to expand it.
package.json
+
4
−
4
View file @
72caa430
...
...
@@ -5,12 +5,12 @@
"main"
:
"src/index.js"
,
"types"
:
"types/index.d.ts"
,
"scripts"
:
{
"start"
:
"cd example && npm i && npm run start"
,
"fix"
:
"npm run tslint -- --fix"
,
"lint"
:
"tslint -c tslint.json 'types/**/*.d.ts' 'src/**/*.d.ts'"
,
"npm-cli-login"
:
"npm-cli-login"
,
"pre-commit"
:
"pretty-quick --staged && npm run
ts
lint"
,
"pre-commit"
:
"pretty-quick --staged && npm run lint"
,
"pre-push"
:
"npm run pre-commit"
,
"tslint"
:
"tslint -c tslint.json 'types/**/*.d.ts' 'src/**/*.d.ts'"
,
"tslint:fix"
:
"npm run tslint -- --fix"
,
"start"
:
"cd example && npm i && npm run start"
,
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"repository"
:
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment