Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dtu-enote-mongodb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
enote
dtu-enote-mongodb
Commits
f48405b6
Commit
f48405b6
authored
6 years ago
by
iaibrys
Browse files
Options
Downloads
Patches
Plain Diff
add gitlab CI
parent
1d354cbf
No related branches found
No related tags found
No related merge requests found
Pipeline
#74
failed
6 years ago
Stage: build
Stage: release
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+65
-0
65 additions, 0 deletions
.gitlab-ci.yml
with
65 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
65
−
0
View file @
f48405b6
image
:
docker:stable
services
:
-
docker:dind
stages
:
-
build
-
test
-
release
-
deploy
variables
:
DOCKER_DRIVER
:
overlay2
CONTAINER_IMAGE
:
lab.compute.dtu.dk:5005/$CI_PROJECT_PATH
CONTAINER_TEST_IMAGE
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
CONTAINER_RELEASE_IMAGE
:
$CI_REGISTRY_IMAGE:latest
GIT_SUBMODULE_STRATEGY
:
recursive
before_script
:
-
echo docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build
:
tags
:
-
enote-shell
stage
:
build
script
:
-
echo "Building the app"
-
echo docker build --tag $CONTAINER_TEST_IMAGE .
-
docker build --tag $CONTAINER_TEST_IMAGE .
-
docker push $CONTAINER_TEST_IMAGE
release-image
:
tags
:
-
enote-shell
stage
:
release
script
:
-
echo "Releasing image ${CONTAINER_TEST_IMAGE} as ${CONTAINER_RELEASE_IMAGE}"
-
docker pull $CONTAINER_TEST_IMAGE
-
docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
-
docker images | grep ${CI_PROJECT_PATH}
-
docker push $CONTAINER_RELEASE_IMAGE
deploy_devel
:
tags
:
-
deploy-devel
stage
:
deploy
script
:
-
echo "Deploy to development server"
-
cd /enote/src/dtu-enote
-
echo docker stop course_website
-
../../gen/docker-stop.sh
-
docker-compose -f ../../gen/docker-compose-enote.yml pull
-
../../gen/docker-start.sh
-
docker ps -q -f status=exited | xargs -I '{}' docker rm -f '{}'
-
docker ps -q -f status=dead | xargs -I '{}' docker rm -f '{}'
-
echo docker pull $CONTAINER_RELEASE_IMAGE
-
docker images | grep ${CI_PROJECT_PATH}
-
echo bundle exec rake deploy:redeploy[dtu-quiz-db]
-
docker image prune -f
environment
:
name
:
develop
url
:
https://enote-devel3.compute.dtu.dk
only
:
-
develop
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