Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
crypto
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
xx network
crypto
Commits
4aa0e350
Unverified
Commit
4aa0e350
authored
4 years ago
by
Sydney Anne Erickson
Browse files
Options
Downloads
Patches
Plain Diff
Add .gitignore and .gitlab-ci.yml
parent
d5ebd1fc
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+13
-0
13 additions, 0 deletions
.gitignore
.gitlab-ci.yml
+63
-0
63 additions, 0 deletions
.gitlab-ci.yml
with
76 additions
and
0 deletions
.gitignore
0 → 100644
+
13
−
0
View file @
4aa0e350
*~
# Ignore glide files/folders
glide.lock
vendor/
# Ignore Jetbrains IDE folder
.idea/*
# Ignore vim .swp buffers for open files
.*.swp
.*.swo
# Ignore local development scripts
localdev_*
# Ignore logs
*.log
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
0 → 100644
+
63
−
0
View file @
4aa0e350
# From: https://about.gitlab.com/2017/09/21/how-to-create-ci-cd-pipeline-with-autodeploy-to-kubernetes-using-gitlab-and-helm/
variables
:
REPO_DIR
:
gitlab.com/elixxir
REPO_NAME
:
crypto
DOCKER_IMAGE
:
elixxirlabs/cuda-go:latest
MIN_CODE_COVERAGE
:
"
95.5"
before_script
:
-
go version || echo "Go executable not found."
-
echo $CI_BUILD_REF
-
echo $CI_PROJECT_DIR
-
echo $PWD
-
eval $(ssh-agent -s)
-
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
ssh-keyscan -t rsa gitlab.com > ~/.ssh/known_hosts
-
git config --global url."git@gitlab.com:".insteadOf "https://gitlab.com/"
-
export PATH=$HOME/go/bin:$PATH
-
export GOPRIVATE=gitlab.com/elixxir/*
stages
:
-
build
-
trigger_integration
build
:
stage
:
build
image
:
$DOCKER_IMAGE
script
:
-
git clean -ffdx
-
go mod vendor -v
-
go build ./...
-
go mod tidy
-
mkdir -p testdata
-
go-acc --covermode atomic --output testdata/coverage.out ./... -- -v
-
go tool cover -func=testdata/coverage.out
-
go tool cover -html=testdata/coverage.out -o testdata/coverage.html
# Test Coverage Check
-
go tool cover -func=testdata/coverage.out | grep "total:" | awk '{print $3}' | sed 's/\%//g' > testdata/coverage-percentage.txt
-
export CODE_CHECK=$(echo "$(cat testdata/coverage-percentage.txt) >= $MIN_CODE_COVERAGE" | bc -l)
-
(if [ "$CODE_CHECK" == "1" ]; then echo "Minimum coverage of $MIN_CODE_COVERAGE succeeded"; else echo "Minimum coverage of $MIN_CODE_COVERAGE failed"; exit 1; fi);
-
mkdir -p release
-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' ./...
-
cd release
artifacts
:
paths
:
-
vendor/
-
testdata/
-
release/
trigger_integration
:
stage
:
trigger_integration
script
:
# Server
-
"
curl
-X
POST
-F
token=$SERVER_TRIGGER_KEY
-F
ref=master
https://gitlab.com/api/v4/projects/5014439/trigger/pipeline"
# Client
-
"
curl
-X
POST
-F
token=$CLIENT_TRIGGER_KEY
-F
ref=master
https://gitlab.com/api/v4/projects/5454785/trigger/pipeline"
only
:
-
master
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