Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-haz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
nshmp-haz
Commits
73094fc0
Commit
73094fc0
authored
4 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Plain Diff
Merge branch 'http' into 'master'
Dependencies with HTTPS See merge request ghsc/nshmp/nshmp-haz-v2!489
parents
cfa1dfe1
ccb6eb7b
No related branches found
No related tags found
1 merge request
!489
Dependencies with HTTPS
Pipeline
#14177
passed
4 years ago
Stage: test
Stage: publish
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitlab-ci.yml
+4
-21
4 additions, 21 deletions
.gitlab-ci.yml
Dockerfile
+11
-12
11 additions, 12 deletions
Dockerfile
build.gradle
+1
-1
1 addition, 1 deletion
build.gradle
settings.gradle
+4
-0
4 additions, 0 deletions
settings.gradle
ws.Dockerfile
+12
-11
12 additions, 11 deletions
ws.Dockerfile
with
32 additions
and
45 deletions
.gitlab-ci.yml
+
4
−
21
View file @
73094fc0
...
...
@@ -3,6 +3,8 @@ variables:
CI_REGISTRY_IMAGE
:
${CODE_REGISTRY_IMAGE}
DOCKER_DIR
:
docker-images
DOCKER_TAR
:
${DOCKER_DIR}/app.tar
GIT_NSHMP_PASSWORD
:
${GITLAB_API_TOKEN}
GIT_NSHMP_USERNAME
:
${GITLAB_USER_EMAIL}
IMAGE_NAME_HAZ
:
nshmp-haz:${CI_COMMIT_REF_SLUG}
IMAGE_NAME_WS
:
nshmp-haz-ws:${CI_COMMIT_REF_SLUG}
JACOCO_HTML_DIR
:
build/reports/jacoco/test/html
...
...
@@ -30,15 +32,6 @@ stages:
DOCKERFILE="ws.Dockerfile";
IMAGE_NAME=${IMAGE_NAME_WS/:master/:latest};
INTERNAL_IMAGE_NAME=${CI_REGISTRY_IMAGE}/${IMAGE_NAME_WS};
ssh-key
:
&ssh-key
|-
eval $(ssh-agent -s);
mkdir -p ~/.ssh;
chmod 700 ~/.ssh;
echo "${SSH_PRIVATE_KEY}" >> ~/.ssh/id_ed25519;
chmod 0600 ~/.ssh/id_ed25519;
echo "${SSH_PRIVATE_KEY}" >> ~/.ssh/id_rsa;
chmod 0600 ~/.ssh/id_rsa;
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config;
.docker-build
:
stage
:
test
...
...
@@ -50,11 +43,11 @@ stages:
-
tags@ghsc/nshmp/nshmp-haz-v2
script
:
-
apk add git;
-
*ssh-key
-
mkdir ${DOCKER_DIR}
-
|
docker build \
--build-arg ssh_private_key="${SSH_PRIVATE_KEY}" \
--build-arg git_username="${GIT_NSHMP_USERNAME}" \
--build-arg git_password="${GIT_NSHMP_PASSWORD}" \
-f ${DOCKERFILE} \
-t local/${IMAGE_NAME} .
-
docker save local/${IMAGE_NAME} > ${DOCKER_TAR}
...
...
@@ -129,8 +122,6 @@ Build Project:
-
branches
-
master@ghsc/nshmp/nshmp-haz-v2
-
tags@ghsc/nshmp/nshmp-haz-v2
before_script
:
-
*ssh-key
script
:
-
./gradlew assemble
...
...
@@ -141,8 +132,6 @@ Spotless Check:
only
:
-
branches
-
master@ghsc/nshmp/nshmp-haz-v2
before_script
:
-
*ssh-key
script
:
-
./gradlew spotlessCheck;
...
...
@@ -153,8 +142,6 @@ Spotbugs Main:
only
:
-
branches
-
master@ghsc/nshmp/nshmp-haz-v2
before_script
:
-
*ssh-key
script
:
-
./gradlew spotbugsMain;
...
...
@@ -165,8 +152,6 @@ Spotbugs Test:
only
:
-
branches
-
master@ghsc/nshmp/nshmp-haz-v2
before_script
:
-
*ssh-key
script
:
-
./gradlew spotbugsTest;
...
...
@@ -179,8 +164,6 @@ Unit Tests:
-
master@ghsc/nshmp/nshmp-haz-v2
-
tags@ghsc/nshmp/nshmp-haz-v2
coverage
:
'
/Total.*?([0-9]{1,3})%/'
before_script
:
-
*ssh-key
script
:
-
./gradlew check
-
cat ${JACOCO_HTML_DIR}/index.html
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
11
−
12
View file @
73094fc0
...
...
@@ -12,7 +12,10 @@
# code.chs.usgs.gov:5001/ghsc/nshmp/images/nshmp-haz-v2;
#
# Build locally:
# docker build --build-arg ssh_private_key="$(cat ~/.ssh/id_rsa)" -t nshmp-haz .
# docker build
# --build-arg git_username=<user@name.com>
# --build-arg git_password=<git-api-token>
# -t nshmp-haz .
####
ARG
project=nshmp-haz-v2
...
...
@@ -26,23 +29,19 @@ FROM usgs/centos:8 as builder
ARG
builder_workdir
ARG
libs_dir
ARG
ssh_private_key
ARG
git_username
ARG
git_password
ENV
LANG="en_US.UTF-8"
ENV
LANG "en_US.UTF-8"
ENV
GIT_NSHMP_USERNAME ${git_username}
ENV
GIT_NSHMP_PASSWORD ${git_password}
WORKDIR
${builder_workdir}
COPY
. .
RUN
yum
install
-y
java-11-openjdk-devel which git
\
&&
eval
$(
ssh-agent
-s
)
\
&&
mkdir
-p
~/.ssh
\
&&
chmod
700 ~/.ssh
\
&&
echo
"
${
ssh_private_key
}
"
>>
~/.ssh/id_rsa
\
&&
chmod
0600 ~/.ssh/id_rsa
\
&&
echo
-e
"Host *
\n\t
StrictHostKeyChecking no
\n\n
"
>
~/.ssh/config
RUN
./gradlew
--no-daemon
assemble
&&
./gradlew
--no-daemon
assemble
####
# Application image: Run jar or war file.
...
...
@@ -60,7 +59,7 @@ ENV CONFIG_FILE ""
ENV
DEBUG false
ENV
IML ""
ENV
JAVA_XMX "8g"
ENV
LANG
=
"en_US.UTF-8"
ENV
LANG
"en_US.UTF-8"
ENV
MODEL ""
ENV
MOUNT_MODEL false
ENV
NSHM_VERSION master
...
...
This diff is collapsed.
Click to expand it.
build.gradle
+
1
−
1
View file @
73094fc0
...
...
@@ -57,7 +57,7 @@ repositories {
}
git
{
implementation
(
"
git@
code.usgs.gov
:
ghsc/nshmp/nshmp-lib.git"
,
{
implementation
(
"
https://
code.usgs.gov
/
ghsc/nshmp/nshmp-lib.git"
,
{
name
"nshmp-haz-dep--nshmp-lib"
tag
"v0.0.5"
})
...
...
This diff is collapsed.
Click to expand it.
settings.gradle
+
4
−
0
View file @
73094fc0
...
...
@@ -3,3 +3,7 @@ plugins {
}
rootProject
.
name
=
"nshmp-haz-v2"
git
{
defaultAuthGroup
"nshmp"
}
This diff is collapsed.
Click to expand it.
ws.Dockerfile
+
12
−
11
View file @
73094fc0
...
...
@@ -2,7 +2,12 @@
# Run hazard web services.
#
# Build locally:
# docker build --build-arg ssh_private_key="$(cat ~/.ssh/id_rsa)" -t nshmp-haz-ws .
# docker build
# -f ws.Dockerfile
# --build-arg git_username=<user@name.com>
# --build-arg git_password=<git-api-token>
# -t nshmp-haz-ws .
####
ARG
project=nshmp-haz-v2
...
...
@@ -16,25 +21,21 @@ ARG ws_file=${libs_dir}/${project}-ws.jar
FROM
usgs/centos:8
as
builder
ARG
builder_workdir
ARG
git_username
ARG
git_password
ARG
libs_dir
ARG
ssh_private_key
ARG
ws_file
ENV
LANG="en_US.UTF-8"
WORKDIR
${builder_workdir}
ENV
GIT_NSHMP_USERNAME ${git_username}
ENV
GIT_NSHMP_PASSWORD ${git_password}
COPY
. .
RUN
env
RUN
yum
install
-y
java-11-openjdk-devel which git
\
&&
eval
$(
ssh-agent
-s
)
\
&&
mkdir
-p
~/.ssh
\
&&
chmod
700 ~/.ssh
\
&&
echo
"
${
ssh_private_key
}
"
>>
~/.ssh/id_rsa
\
&&
chmod
0600 ~/.ssh/id_rsa
\
&&
echo
-e
"Host *
\n\t
StrictHostKeyChecking no
\n\n
"
>
~/.ssh/config
RUN
./gradlew
--no-daemon
assemble
\
&&
./gradlew
--no-daemon
assemble
\
&&
mv
${
libs_dir
}
/
*
-all
.jar
${
ws_file
}
####
...
...
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