Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csentry
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
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
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
Anders Harrisson
csentry
Commits
35b8bd24
Commit
35b8bd24
authored
7 years ago
by
Benjamin Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Switch to gitlab
parent
4f47b44f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+57
-0
57 additions, 0 deletions
.gitlab-ci.yml
Jenkinsfile
+0
-61
0 additions, 61 deletions
Jenkinsfile
Makefile
+1
-1
1 addition, 1 deletion
Makefile
docker-compose.yml
+1
-1
1 addition, 1 deletion
docker-compose.yml
with
59 additions
and
63 deletions
.gitlab-ci.yml
0 → 100644
+
57
−
0
View file @
35b8bd24
image
:
docker:latest
.runner_tags
:
&runner_tags
tags
:
-
dind
services
:
-
docker:dind
variables
:
CONTAINER_TEST_IMAGE
:
"
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
CONTAINER_RELEASE_IMAGE
:
"
$CI_REGISTRY_IMAGE:latest"
CONTAINER_TAG_IMAGE
:
"
$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
stages
:
-
build
-
test
-
release
before_script
:
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
build
:
<<
:
*runner_tags
stage
:
build
script
:
-
docker pull "$CONTAINER_TEST_IMAGE"
-
docker build --pull --cache-from "$CONTAINER_TEST_IMAGE" -t "$CONTAINER_TEST_IMAGE" .
-
docker push "$CONTAINER_TEST_IMAGE"
test
:
<<
:
*runner_tags
stage
:
test
before_script
:
-
apk add --update py-pip
-
pip install docker-compose
-
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script
:
-
docker pull "$CONTAINER_TEST_IMAGE"
-
docker-compose -f docker-compose.yml up -d postgres redis
-
sleep
5
-
docker-compose -f docker-compose.yml run --rm web
after_script
:
-
docker rm -f csentry_postgres
-
docker rm -f csentry_redis
release-image
:
<<
:
*runner_tags
stage
:
release
script
:
-
docker pull "$CONTAINER_TEST_IMAGE"
-
docker tag "$CONTAINER_TEST_IMAGE" "$CONTAINER_RELEASE_IMAGE"
-
docker tag "$CONTAINER_TEST_IMAGE" "$CONTAINER_TAG_IMAGE"
-
docker push "$CONTAINER_RELEASE_IMAGE"
-
docker push "$CONTAINER_TAG_IMAGE"
only
:
-
tags
This diff is collapsed.
Click to expand it.
Jenkinsfile
deleted
100644 → 0
+
0
−
61
View file @
4f47b44f
pipeline
{
agent
{
label
'docker-compose'
}
environment
{
GIT_TAG
=
sh
(
returnStdout:
true
,
script:
'git describe --exact-match || true'
).
trim
()
}
stages
{
stage
(
'Refresh'
)
{
steps
{
slackSend
(
color:
'good'
,
message:
"STARTED: <${env.BUILD_URL}|${env.JOB_NAME} [${env.BUILD_NUMBER}]>"
)
sh
'make clean'
sh
'make refresh'
}
}
stage
(
'Build'
)
{
steps
{
ansiColor
(
'xterm'
)
{
sh
'make build'
}
}
}
stage
(
'Test'
)
{
steps
{
sh
'make db_image'
/* let the time to postgres to start */
sh
'sleep 5'
sh
'make test_image'
}
}
stage
(
'Push'
)
{
when
{
not
{
environment
name:
'GIT_TAG'
,
value:
''
}
}
environment
{
DOCKERHUB
=
credentials
(
'dockerhub'
)
}
steps
{
sh
'docker login -u $DOCKERHUB_USR -p $DOCKERHUB_PSW'
sh
'make tag'
sh
'make push'
sh
'docker logout'
}
}
}
post
{
always
{
sh
'make clean'
/* clean up the workspace */
deleteDir
()
}
failure
{
slackSend
(
color:
'danger'
,
message:
"FAILED: <${env.BUILD_URL}|${env.JOB_NAME} [${env.BUILD_NUMBER}]>"
)
}
success
{
slackSend
(
color:
'good'
,
message:
"SUCCESSFUL: <${env.BUILD_URL}|${env.JOB_NAME} [${env.BUILD_NUMBER}]>"
)
}
}
}
This diff is collapsed.
Click to expand it.
Makefile
+
1
−
1
View file @
35b8bd24
.PHONY
:
help build tag push refresh release db initdb test db_image test_image
OWNER
:=
europeanspallationsourc
e
OWNER
:=
registry.esss.lu.se/ics-infrastructur
e
GIT_TAG
:=
$(
shell git describe
--always
)
IMAGE
:=
csentry
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
1
−
1
View file @
35b8bd24
version
:
'
2'
services
:
web
:
image
:
europeanspallationso
ur
c
e/csentry:
latest
image
:
registry.esss.lu.se/ics-infrastruct
ure/csentry:
master
container_name
:
csentry_web
command
:
pytest --cov=app -v
depends_on
:
...
...
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