Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Modjular Ubuntu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
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
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
We are moving to Forgejo!
You are on a read-only GitLab instance.
Show more breadcrumbs
Modjular
Modjular Ubuntu
Commits
56e9f145
Commit
56e9f145
authored
3 years ago
by
Jeffrey Phillips Freeman
Browse files
Options
Downloads
Patches
Plain Diff
Added CI to deploy docker image
parent
d2660811
No related branches found
Tags
v1.1.2
No related merge requests found
Pipeline
#1667
canceled
3 years ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+34
-0
34 additions, 0 deletions
.gitlab-ci.yml
with
34 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
34
−
0
View file @
56e9f145
image
:
docker:stable
services
:
-
docker:stable-dind
variables
:
REPOSITORY
:
"
modjular/modjular-ubuntu"
BUILD_DIR
:
"
."
before_script
:
-
if [ -z "$DOCKER_TOKEN" ]; then
echo "The \$DOCKER_TOKEN variable is not set. This usually means you did not set up the needed variables in the GitLab repository settings. This can also be caused if trying to run Gitlab CI on a non protected tag or branch.";
fi
-
echo "${DOCKER_TOKEN}" | docker login --username "${DOCKER_USER}" --password-stdin
stages
:
-
deploy
docker
:
stage
:
deploy
script
:
-
if [ $CI_COMMIT_REF_NAME == "develop" ]; then
REV="git";
elif [ $CI_COMMIT_REF_NAME == "master" ]; then
REV="latest";
else
REV="$CI_COMMIT_REF_NAME";
fi
-
docker build --network=host --pull -t "${REPOSITORY}:${REV}"
--no-cache
"${BUILD_DIR}"
-
docker push "${REPOSITORY}"
tags
:
-
gitlab-org-docker
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