Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dtu-quiz
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-quiz
Commits
7a3bf9d7
Commit
7a3bf9d7
authored
6 years ago
by
iaibrys
Browse files
Options
Downloads
Patches
Plain Diff
fix sed/gsed issue; make the branch name the (released) container version
parent
25461eb3
Branches
Branches containing commit
No related tags found
1 merge request
!1
Feature/remove coffeescript
Pipeline
#110
failed
6 years ago
Stage: build
Stage: test
Stage: release
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+25
-10
25 additions, 10 deletions
.gitlab-ci.yml
scripts/gen-build-info.sh
+5
-1
5 additions, 1 deletion
scripts/gen-build-info.sh
with
30 additions
and
11 deletions
.gitlab-ci.yml
+
25
−
10
View file @
7a3bf9d7
...
...
@@ -11,15 +11,12 @@ stages:
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
CONTAINER_TEST_IMAGE
:
$CI_REGISTRY_IMAGE:CI_COMMIT_
SHORT_SHA
CONTAINER_RELEASE_IMAGE
:
$CI_REGISTRY_IMAGE:
$CI_COMMIT_REF_SLUG
GIT_SUBMODULE_STRATEGY
:
recursive
test
:
image
:
$CONTAINER_TEST_IMAGE
# name: $CONTAINER_TEST_IMAGE
# entrypoint: ["/bin/bash"]
services
:
-
name
:
lab.compute.dtu.dk:5005/enote/dtu-enote-mongodb
alias
:
quiz-db
...
...
@@ -64,21 +61,39 @@ deploy_devel:
-
deploy-devel
stage
:
deploy
script
:
-
echo "Deploy to
development
server"
-
echo "Deploy to
${CI_BUILD_REF_SLUG}
server"
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
-
cd /enote/src/dtu-enote
-
echo docker stop course_website
-
../../gen/docker-stop.sh
-
docker-compose -f ../../gen/docker-compose-enote.yml pull
-
docker images | grep ${CI_PROJECT_PATH}
-
../../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]
-
docker image prune -f
environment
:
name
:
develop
url
:
https://enote-devel3.compute.dtu.dk
only
:
-
develop
deploy_production
:
tags
:
-
deploy-production
stage
:
deploy
script
:
-
echo "Deploy to ${CI_BUILD_REF_SLUG} server"
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
-
cd /enote/src/dtu-enote
-
../../gen/docker-stop.sh
-
docker-compose -f ../../gen/docker-compose-enote.yml pull
-
docker images | grep ${CI_PROJECT_PATH}
-
../../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 '{}'
-
docker image prune -f
environment
:
name
:
production
url
:
https://quiz.compute.dtu.dk
only
:
-
master
This diff is collapsed.
Click to expand it.
scripts/gen-build-info.sh
+
5
−
1
View file @
7a3bf9d7
...
...
@@ -49,7 +49,11 @@ function emit_info() {
done
}
component
=
$(
git config
--local
remote.origin.url | gsed
-r
's/.*[:/]([^/]+)(\.git)?$/\1/'
| gsed
-r
's/\//-/'
)
sed
=
sed
if
type
gsed
>
/dev/null 2>&1
;
then
sed
=
gsed
fi
component
=
$(
git config
--local
remote.origin.url |
${
sed
}
-r
's/.*[:/]([^/]+)(\.git)?$/\1/'
|
${
sed
}
-r
's/\//-/'
)
emit_info
${
component
}
.
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