Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SpiceQL
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
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
SpiceQL
Commits
81d22c8a
Commit
81d22c8a
authored
Sep 20, 2023
by
Christine Kim
Browse files
Options
Downloads
Patches
Plain Diff
Update pipeline to run tests
parent
c1f0b0de
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+112
-30
112 additions, 30 deletions
.gitlab-ci.yml
with
112 additions
and
30 deletions
.gitlab-ci.yml
+
112
−
30
View file @
81d22c8a
image
:
ubuntu:18.04
image
:
continuumio/miniconda3:latest
stages
:
# List of stages for jobs, and their order of execution
-
build
-
test
variables
:
SSPICE_DEBUG
:
y
clone_github
:
stage
:
deploy
before_script
:
before_script
:
-
apt-get update -y && apt-get install openssh-client -y
-
conda init bash
-
apt install git -y
-
source ~/.bashrc
-
eval $(ssh-agent -s)
-
echo "$GIT_SSH_PRIVATE_KEY" | openssl base64 -A -d | ssh-add -
build-and-ctest
:
# This job runs in the build stage, which runs first.
-
mkdir -p ~/.ssh
variables
:
-
chmod 700 ~/.ssh
SSPICE_DEBUG
:
y
-
ssh-keyscan $GIT_LAB_HOST >> ~/.ssh/known_hosts
BUILD_TYPE
:
Release
-
chmod 644 ~/.ssh/known_hosts
stage
:
build
-
git config --global user.name "krodriguez"
tags
:
-
git config --global user.email "krodriguez@usgs.gov"
-
dind
-
ssh "git@$GIT_LAB_HOST"
script
:
-
ls $CI_PROJECT_DIR
-
git config http.sslVerify "false"
-
git config --global url."https://github.com/".insteadOf "git@github.com:"
-
git config --global url."https://".insteadOf git://
-
GIT_SSL_NO_VERIFY=true git submodule update --init --recursive
-
touch /etc/pip.conf
-
echo -e "[global]\n
trusted-host = pypi.python.org\n
\tpypi.org\n
\tfiles.pythonhosted.org" >> /etc/pip.conf
-
cat /etc/pip.conf
-
SSL_NO_VERIFY=1 conda env create -f environment.yml --prefix $CI_PROJECT_DIR/env
-
conda init bash
-
source ~/.bashrc
-
conda activate $CI_PROJECT_DIR/env
-
SSL_NO_VERIFY=1 conda install make gcc_linux-64 gxx_linux-64 pthread-stubs
-
conda info
-
conda list
-
cmake -E make_directory $CI_PROJECT_DIR/build
-
cmake -E make_directory $CI_PROJECT_DIR/install
-
cd $CI_PROJECT_DIR/build/
-
cmake $CI_PROJECT_DIR -DCSpice_DIR=$CONDA_PREFIX/lib/cmake/cspice/ -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSPICEQL_BUILD_DOCS=OFF -DCMAKE_INSTALL_PREFIX=$CI_PROJECT_DIR/install
-
cmake --build .
-
cmake --install .
-
echo "Running unit tests... This will take about 60 seconds."
-
cd $CI_PROJECT_DIR/build/
-
ctest -VV -C $BUILD_TYPE
artifacts
:
paths
:
-
$CI_PROJECT_DIR/build
-
$CI_PROJECT_DIR/install
check-install-binaries
:
# This job also runs in the test stage.
stage
:
test
# It can run at the same time as unit-test-job (in parallel).
tags
:
-
dind
dependencies
:
-
build-and-ctest
script
:
-
cd $CI_PROJECT_DIR/install/
-
test -e lib/libSpiceQL.so
-
test -e include/SpiceQL/spiceql.h
check-installed-json-files
:
stage
:
test
tags
:
-
dind
dependencies
:
-
build-and-ctest
script
:
script
:
-
echo $SOURCE_REPOSITORY
-
cd $CI_PROJECT_DIR/install
-
git config --global http.sslVerify
false
-
pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org jsonschema
-
rm -rf spiceql
# Needed to allow multiple CI runs
-
cd $CI_PROJECT_DIR/SpiceQL/db
-
git config --global user.name "krodriguez"
-
|
-
git config --global user.email "krodriguez@usgs.gov"
for file in *.json;
-
git clone --mirror https://github.com/DOI-USGS/SpiceQL.git spiceql
do
-
cd spiceql
pwd
-
git remote remove origin
jsonschema --instance "$file" schema/spiceMissionSchmea.schema.json
-
git remote add origin $DESTINATION_REPOSITORY
done;
-
git push -f --prune --all
-
git push -f --prune --tags
only
:
# clone_github:
-
branches
# stage: deploy
# image: ubuntu:18.04
# before_script:
# - apt-get update -y && apt-get install openssh-client -y
# - apt install git -y
# - eval $(ssh-agent -s)
# - echo "$GIT_SSH_PRIVATE_KEY" | openssl base64 -A -d | ssh-add -
# - mkdir -p ~/.ssh
# - chmod 700 ~/.ssh
# - ssh-keyscan $GIT_LAB_HOST >> ~/.ssh/known_hosts
# - chmod 644 ~/.ssh/known_hosts
# - git config --global user.name "krodriguez"
# - git config --global user.email "krodriguez@usgs.gov"
# - ssh "git@$GIT_LAB_HOST"
# script:
# - echo $SOURCE_REPOSITORY
# - git config --global http.sslVerify false
# - rm -rf spiceql # Needed to allow multiple CI runs
# - git config --global user.name "krodriguez"
# - git config --global user.email "krodriguez@usgs.gov"
# - git clone --mirror https://github.com/DOI-USGS/SpiceQL.git spiceql
# - cd spiceql
# - git remote remove origin
# - git remote add origin $DESTINATION_REPOSITORY
# - git push -f --prune --all
# - git push -f --prune --tags
# only:
# - branches
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