Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
goSDN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
danet
goSDN
Commits
81c8baba
Commit
81c8baba
authored
4 years ago
by
Manuel Kieweg
Browse files
Options
Downloads
Patches
Plain Diff
Dockerfile and adapted CI
parent
9fab0da1
No related branches found
No related tags found
3 merge requests
!90
Develop
,
!63
Resolve "Dockerfile"
,
!53
V.0.1.0 Codename Threadbare
Pipeline
#52958
failed
4 years ago
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+3
-1
3 additions, 1 deletion
.gitlab-ci.yml
Dockerfile
+16
-0
16 additions, 0 deletions
Dockerfile
build/ci/.build-container.yml
+44
-0
44 additions, 0 deletions
build/ci/.build-container.yml
build/ci/.documentation-ci.yml
+2
-2
2 additions, 2 deletions
build/ci/.documentation-ci.yml
with
65 additions
and
3 deletions
.gitlab-ci.yml
+
3
−
1
View file @
81c8baba
...
@@ -3,7 +3,8 @@ variables:
...
@@ -3,7 +3,8 @@ variables:
stages
:
stages
:
-
test
-
test
-
documentation
-
build
-
deploy
before_script
:
before_script
:
-
git config --global url."https://$GO_MODULES_USER:$GO_MODULES_ACCESS_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de"
-
git config --global url."https://$GO_MODULES_USER:$GO_MODULES_ACCESS_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de"
...
@@ -12,3 +13,4 @@ include:
...
@@ -12,3 +13,4 @@ include:
-
local
:
'
/build/ci/.code-quality-ci.yml'
-
local
:
'
/build/ci/.code-quality-ci.yml'
-
local
:
'
/build/ci/.documentation-ci.yml'
-
local
:
'
/build/ci/.documentation-ci.yml'
-
local
:
'
/build/ci/.security-and-compliance-ci.yml'
-
local
:
'
/build/ci/.security-and-compliance-ci.yml'
-
local
:
'
/build/ci/.build-container.yml'
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
16
−
0
View file @
81c8baba
FROM
golang:alpine
AS
builder
ARG
GITLAB_USER
ARG
GITLAB_TOKEN
WORKDIR
/src/gosdn
COPY
. .
RUN
git config
--global
url.
"https://
$GITLAB_USER
:
$GITLAB_TOKEN
@code.fbi.h-da.de"
.insteadOf
"https://code.fbi.h-da.de"
RUN
go mod download
RUN
CGO_ENABLED
=
0
GOOS
=
linux go build ./cmd/gosdn
FROM
alpine:latest
EXPOSE
8443
COPY
--from=builder /src/gosdn/gosdn .
COPY
--from=builder /src/gosdn/config .
ENTRYPOINT
[ "./gosdn" ]
CMD
[""]
This diff is collapsed.
Click to expand it.
build/ci/.build-container.yml
0 → 100644
+
44
−
0
View file @
81c8baba
variables
:
DOCKER_IMAGE_SHA
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
build:docker
:
stage
:
build
tags
:
-
baremetal
script
:
-
>
docker build \
--build-arg <GITLAB_USER>=<$GO_MODULES_USER> \
--build-arg <GITLAB_TOKEN>=<$GO_MODULES_ACCESS_TOKEN> \
-t $DOCKER_IMAGE_SHA .
.deploy
:
&deploy
stage
:
deploy
needs
:
[
"
build:docker"
]
tags
:
-
baremetal
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
-
docker tag $DOCKER_IMAGE_SHA $TAG
-
docker push $TAG
deploy:develop
:
variables
:
TAG
:
$CI_REGISTRY_IMAGE:develop
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
<<
:
*deploy
deploy:tagged
:
variables
:
TAG
:
$CI_REGISTRY_IMAGE:CI_COMMIT_TAG
rules
:
-
if
:
CI_COMMIT_TAG
<<
:
*deploy
deploy:latest
:
variables
:
TAG
:
$CI_REGISTRY_IMAGE:latest
rules
:
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
<<
:
*deploy
\ No newline at end of file
This diff is collapsed.
Click to expand it.
build/ci/.documentation-ci.yml
+
2
−
2
View file @
81c8baba
...
@@ -5,7 +5,7 @@ documentation:pdf:
...
@@ -5,7 +5,7 @@ documentation:pdf:
name
:
pandoc/latex
name
:
pandoc/latex
entrypoint
:
entrypoint
:
-
'
'
-
'
'
stage
:
d
ocumentation
stage
:
d
eploy
rules
:
rules
:
-
changes
:
-
changes
:
-
documentation/design/*.md
-
documentation/design/*.md
...
@@ -22,7 +22,7 @@ documentation:pdf:
...
@@ -22,7 +22,7 @@ documentation:pdf:
-
cargo install mdbook
-
cargo install mdbook
image
:
image
:
name
:
rust:latest
name
:
rust:latest
stage
:
d
ocumentation
stage
:
d
eploy
script
:
script
:
-
mdbook build documentation --dest-dir public
-
mdbook build documentation --dest-dir public
cache
:
cache
:
...
...
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