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
e2f7a2cb
Commit
e2f7a2cb
authored
1 year ago
by
Michal Petrovič
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml file
parent
f92f3b3b
1 merge request
!4
Resolve "Vyuzitie cachce miesto artifacts pomocou tags pre runnery"
Pipeline
#166573
failed with stages
in 2 minutes
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+25
-33
25 additions, 33 deletions
.gitlab-ci.yml
with
25 additions
and
33 deletions
.gitlab-ci.yml
+
25
−
33
View file @
e2f7a2cb
...
@@ -17,17 +17,22 @@ stages:
...
@@ -17,17 +17,22 @@ stages:
gradlew-bootJar
:
gradlew-bootJar
:
stage
:
build
stage
:
build
tags
:
-
worker
image
:
eclipse-temurin:11-jdk-alpine
image
:
eclipse-temurin:11-jdk-alpine
script
:
script
:
-
./gradlew bootJar
# - ./gradlew bootJar
-
echo "bootJar"
docker-build-latest
:
docker-build-latest
:
stage
:
build
stage
:
build
image
:
docker:git
image
:
docker:git
only
:
tags
:
refs
:
-
cache
-
main
# only:
# refs:
# - main
except
:
except
:
variables
:
variables
:
-
$CI_COMMIT_TAG
-
$CI_COMMIT_TAG
...
@@ -35,16 +40,14 @@ docker-build-latest:
...
@@ -35,16 +40,14 @@ docker-build-latest:
-
mkdir -p build
-
mkdir -p build
script
:
script
:
-
docker build -t $DOCKER_NAMESPACE/$PROJECT_NAME:latest .
-
docker build -t $DOCKER_NAMESPACE/$PROJECT_NAME:latest .
-
docker save $DOCKER_NAMESPACE/$PROJECT_NAME:latest | bzip2 > build/image.tar.bz2
-
docker save -o build/image.tar $DOCKER_NAMESPACE/$PROJECT_NAME:latest
artifacts
:
paths
:
-
build/image.tar.bz2
expire_in
:
10 mins
# Optional: Set an expiration time for the artifact
docker-build-tag
:
docker-build-tag
:
stage
:
build
stage
:
build
image
:
docker:git
image
:
docker:git
tags
:
-
cache
only
:
only
:
variables
:
variables
:
-
$CI_COMMIT_TAG
-
$CI_COMMIT_TAG
...
@@ -52,11 +55,7 @@ docker-build-tag:
...
@@ -52,11 +55,7 @@ docker-build-tag:
-
mkdir -p build
-
mkdir -p build
script
:
script
:
-
docker build -t $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG .
-
docker build -t $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG .
-
docker save $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG | bzip2 > build/image.tar.bz2
-
docker save -o build/image.tar $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG
artifacts
:
paths
:
-
build/image.tar
expire_in
:
10 mins
# Optional: Set an expiration time for the artifact
...
@@ -64,17 +63,7 @@ docker-build-tag:
...
@@ -64,17 +63,7 @@ docker-build-tag:
# Stage: test
# Stage: test
# ===========================================================================
# ===========================================================================
verification-unit
:
stage
:
verification
image
:
eclipse-temurin:11-jdk-alpine
allow_failure
:
true
script
:
-
./gradlew test
artifacts
:
when
:
always
reports
:
junit
:
build/test-results/test/**/TEST-*.xml
expire_in
:
10 mins
# ===========================================================================
# ===========================================================================
# Stage: publish
# Stage: publish
...
@@ -83,25 +72,27 @@ verification-unit:
...
@@ -83,25 +72,27 @@ verification-unit:
docker-push-latest
:
docker-push-latest
:
stage
:
publish
stage
:
publish
image
:
docker
image
:
docker
only
:
tags
:
-
main
-
cache
# only:
# - main
before_script
:
before_script
:
-
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN $DOCKER_REGISTRY
-
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN $DOCKER_REGISTRY
script
:
script
:
-
bzip2 -d -c build/image.tar.bz2 > build/image.tar
-
docker load -i build/image.tar
-
docker load -i build/image.tar
-
docker push $DOCKER_NAMESPACE/$PROJECT_NAME:latest
#
- docker push $DOCKER_NAMESPACE/$PROJECT_NAME:latest
docker-push-tag
:
docker-push-tag
:
stage
:
publish
stage
:
publish
image
:
docker
image
:
docker
tags
:
-
cache
only
:
only
:
variables
:
variables
:
-
$CI_COMMIT_TAG
-
$CI_COMMIT_TAG
before_script
:
before_script
:
-
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN $DOCKER_REGISTRY
-
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN $DOCKER_REGISTRY
script
:
script
:
-
bzip2 -d -c build/image.tar.bz2 > build/image.tar
-
docker load -i build/image.tar
-
docker load -i build/image.tar
-
docker push $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG
-
docker push $DOCKER_NAMESPACE/$PROJECT_NAME:$CI_COMMIT_TAG
...
@@ -111,6 +102,8 @@ docker-push-tag:
...
@@ -111,6 +102,8 @@ docker-push-tag:
deploy-bioinformatika.pef.mendelu.cz
:
deploy-bioinformatika.pef.mendelu.cz
:
stage
:
deploy
stage
:
deploy
tags
:
-
master
only
:
only
:
-
main
-
main
script
:
script
:
...
@@ -123,6 +116,8 @@ deploy-bioinformatika.pef.mendelu.cz:
...
@@ -123,6 +116,8 @@ deploy-bioinformatika.pef.mendelu.cz:
deploy-bioinformatics.ibp.cz
:
deploy-bioinformatics.ibp.cz
:
stage
:
deploy
stage
:
deploy
tags
:
-
master
only
:
only
:
variables
:
variables
:
-
$CI_COMMIT_TAG
-
$CI_COMMIT_TAG
...
@@ -130,6 +125,3 @@ deploy-bioinformatics.ibp.cz:
...
@@ -130,6 +125,3 @@ deploy-bioinformatics.ibp.cz:
-
scp .env root@bioinformatics.ibp.cz:/opt/
-
scp .env root@bioinformatics.ibp.cz:/opt/
-
scp docker-compose.yml root@bioinformatics.ibp.cz:/opt/
-
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"
-
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.
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