Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Bioinformatics
backend
Commits
cd359375
Commit
cd359375
authored
1 year ago
by
Michal Petrovič
Committed by
xkoloma1
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "use artifacts in gitlab CI"
parent
91f6fd72
Branches
Branches containing commit
1 merge request
!3
Resolve "use artifacts in gitlab CI"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+19
-32
19 additions, 32 deletions
.gitlab-ci.yml
Dockerfile
+1
-1
1 addition, 1 deletion
Dockerfile
with
20 additions
and
33 deletions
.gitlab-ci.yml
+
19
−
32
View file @
cd359375
variables
:
DOCKER_HOST
:
$DOCKER_HOST_BIO
PROJECT_NAME
:
"
backend"
cache
:
key
:
$CI_COMMIT_REF_NAME
paths
:
-
build/
stages
:
-
analyse
-
build
-
verification
-
publish
-
deploy
# ===========================================================================
# Stage: analyse
# ===========================================================================
include
:
-
template
:
Code-Quality.gitlab-ci.yml
code_quality
:
stage
:
analyse
services
:
[]
# Shut off Docker-in-Docker
variables
:
REPORT_FORMAT
:
html
artifacts
:
paths
:
[
gl-code-quality-report.html
]
# second job has to be run to create both artefacts
code_quality_json
:
extends
:
code_quality
variables
:
REPORT_FORMAT
:
json
artifacts
:
paths
:
[
gl-code-quality-report.json
]
# ===========================================================================
...
...
@@ -49,6 +21,7 @@ gradlew-bootJar:
script
:
-
./gradlew bootJar
docker-build-latest
:
stage
:
build
image
:
docker:git
...
...
@@ -62,7 +35,12 @@ docker-build-latest:
-
mkdir -p build
script
:
-
docker build -t $DOCKER_NAMESPACE/$PROJECT_NAME:latest .
-
docker save -o build/image.tar $DOCKER_NAMESPACE/$PROJECT_NAME:latest
-
docker save $DOCKER_NAMESPACE/$PROJECT_NAME:latest | bzip2 > build/image.tar.bz2
artifacts
:
paths
:
-
build/image.tar.bz2
expire_in
:
10 mins
# Optional: Set an expiration time for the artifact
docker-build-tag
:
stage
:
build
...
...
@@ -74,7 +52,12 @@ docker-build-tag:
-
mkdir -p build
script
:
-
docker build -t $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG .
-
docker save -o build/image.tar $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG
-
docker save $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG | bzip2 > build/image.tar.bz2
artifacts
:
paths
:
-
build/image.tar
expire_in
:
10 mins
# Optional: Set an expiration time for the artifact
# ===========================================================================
...
...
@@ -91,6 +74,7 @@ verification-unit:
when
:
always
reports
:
junit
:
build/test-results/test/**/TEST-*.xml
expire_in
:
10 mins
# ===========================================================================
# Stage: publish
...
...
@@ -104,6 +88,7 @@ docker-push-latest:
before_script
:
-
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN $DOCKER_REGISTRY
script
:
-
bzip2 -d -c build/image.tar.bz2 > build/image.tar
-
docker load -i build/image.tar
-
docker push $DOCKER_NAMESPACE/$PROJECT_NAME:latest
...
...
@@ -116,10 +101,10 @@ docker-push-tag:
before_script
:
-
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN $DOCKER_REGISTRY
script
:
-
bzip2 -d -c build/image.tar.bz2 > build/image.tar
-
docker load -i build/image.tar
-
docker push $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG
# ===========================================================================
# Stage: deploy
# ===========================================================================
...
...
@@ -146,3 +131,5 @@ deploy-bioinformatics.ibp.cz:
-
scp docker-compose.yml root@bioinformatics.ibp.cz:/opt/
-
ssh root@bioinformatics.ibp.cz "cd /opt && export $(xargs < .env) && docker stack deploy dna-analyser -c docker-compose.yml"
This diff is collapsed.
Click to expand it.
Dockerfile
+
1
−
1
View file @
cd359375
...
...
@@ -4,7 +4,7 @@ COPY . /workspace/app
RUN
--mount
=
type
=
cache,target
=
/root/.gradle ./gradlew clean build
RUN
mkdir
-p
build/dependency
&&
(
cd
build/dependency
;
jar
-xf
../libs/
*
-SNAPSHOT
.jar
)
FROM
eclipse-temurin:11-j
dk
-alpine
FROM
eclipse-temurin:11-j
re
-alpine
VOLUME
/tmp
EXPOSE
8080
ARG
DEPENDENCY=/workspace/app/build/dependency
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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