Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rails-base-image-builder
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Public
rails-base-image-builder
Commits
9eb851d1
Commit
9eb851d1
authored
4 years ago
by
Dean Lovett
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit
parents
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+182
-0
182 additions, 0 deletions
.gitlab-ci.yml
README.md
+1
-0
1 addition, 0 deletions
README.md
with
183 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
182
−
0
View file @
9eb851d1
image
:
docker:latest
variables
:
DOCKER_DRIVER
:
overlay2
IMAGE_NAME
:
gitlab.nexdev.uk:5555/web-dev/users
stages
:
-
prebuild
-
build
-
testing
-
release
-
deploy
docker_lint
:
stage
:
prebuild
image
:
hadolint/hadolint:latest-debian
script
:
# Ignoring DL3008 - Pin Versions of apt-get modules
-
hadolint --ignore DL3008 Dockerfile
tags
:
-
nexus_runner
build_image
:
stage
:
build
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN gitlab.nexdev.uk:5555
-
docker build -t $IMAGE_NAME:$CI_COMMIT_SHA .
-
docker push $IMAGE_NAME:$CI_COMMIT_SHA
tags
:
-
nexus_runner
rubocop_lint
:
variables
:
PRONTO_GITLAB_API_ENDPOINT
:
"
https://gitlab.nexdev.uk/api/v4"
stage
:
testing
image
:
$IMAGE_NAME:$CI_COMMIT_SHA
script
:
-
cd /builds/web-dev/users
-
git fetch
# - bundle exec pronto run -c=origin/master --exit-code -f gitlab
tags
:
-
nexus_runner
dependency_scanning
:
stage
:
testing
image
:
ruby:2.6.2
allow_failure
:
true
script
:
-
gem install bundler-audit
-
bundle audit check --update
artifacts
:
paths
:
[
gl-dependency-scanning-report.json
]
tags
:
-
nexus_runner
test:unit
:
stage
:
testing
image
:
$IMAGE_NAME:$CI_COMMIT_SHA
services
:
-
name
:
postgres:12.2
alias
:
user_db
-
name
:
mysql:5.6
alias
:
mysql
variables
:
# Set variables for the MySQL image
FW_DB_TEST_HOST
:
mysql
MYSQL_DATABASE
:
nexus_api_forum_test
MYSQL_USER
:
runner
MYSQL_PASSWORD
:
password
MYSQL_ROOT_PASSWORD
:
password
OTP_ENC_KEY
:
'
avQrhpsxSNtx26xdM6M65Z7KUARctq5z'
TWILIO_NUMBER
:
'
+15005550006'
TWILIO_SID
:
'
ACe28fd8b14f682e46536a3a2910f5ea0e'
TWILIO_TOKEN
:
'
d117d8463ebf05cf8ed5b9584b1a6d66'
POSTGRES_PASSWORD
:
password
script
:
-
bundle exec rake db:create RAILS_ENV=test
-
bundle exec rake db:migrate RAILS_ENV=test
-
bundle exec rake fw_test_db:import_forum RAILS_ENV=test
-
COVERAGE=true bundle exec rspec --format documentation
tags
:
-
nexus_runner
test:integration
:
stage
:
testing
image
:
$IMAGE_NAME:$CI_COMMIT_SHA
allow_failure
:
true
services
:
-
name
:
postgres:12.2
alias
:
user_db
-
name
:
mysql:5.6
alias
:
mysql
variables
:
# Set variables for the MySQL image
FW_DB_TEST_HOST
:
mysql
MYSQL_DATABASE
:
nexus_api_forum_test
MYSQL_USER
:
runner
MYSQL_PASSWORD
:
password
MYSQL_ROOT_PASSWORD
:
password
OTP_ENC_KEY
:
'
avQrhpsxSNtx26xdM6M65Z7KUARctq5z'
TWILIO_NUMBER
:
'
+15005550006'
TWILIO_SID
:
'
ACe28fd8b14f682e46536a3a2910f5ea0e'
TWILIO_TOKEN
:
'
d117d8463ebf05cf8ed5b9584b1a6d66'
POSTGRES_PASSWORD
:
password
script
:
-
bundle exec rake db:create RAILS_ENV=test
-
bundle exec rake db:migrate RAILS_ENV=test
-
bundle exec rake fw_test_db:import_forum RAILS_ENV=test
-
bundle exec rspec --format documentation --tag integration
tags
:
-
nexus_runner
release:version
:
image
:
gitlab.nexdev.uk:5555/pub/nexus-release-image/master
stage
:
release
before_script
:
-
eval $(ssh-agent -s)
-
echo "$CI_DEPLOY_KEY" | tr -d '\r' | ssh-add -
-
ssh-keyscan gitlab.nexdev.uk >> ~/.ssh/known_hosts
script
:
-
/build/release.sh
tags
:
-
nexus_runner
only
:
-
master
release_staging
:
stage
:
release
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN gitlab.nexdev.uk:5555
-
docker tag $IMAGE_NAME:$CI_COMMIT_SHA $IMAGE_NAME:staging
-
docker push $IMAGE_NAME:$CI_COMMIT_SHA
-
docker push $IMAGE_NAME:staging
only
:
-
staging
tags
:
-
nexus_runner
deploy_staging
:
stage
:
deploy
image
:
nexusmods/gitlab-ci-kube-deploy
script
:
-
mkdir /root/.kube
-
echo "$STAGING_KUBE_CONFIG" > /root/.kube/config
-
kubectl apply -f deploy/staging
-
kubectl -n staging-nexus set image deployment/users users=$IMAGE_NAME:$CI_COMMIT_SHA
environment
:
staging
when
:
manual
except
:
-
master
tags
:
-
nexus_runner
release
:
stage
:
release
script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN gitlab.nexdev.uk:5555
-
docker tag $IMAGE_NAME:$CI_COMMIT_SHA $IMAGE_NAME:latest
-
docker push $IMAGE_NAME:$CI_COMMIT_SHA
-
docker push $IMAGE_NAME:latest
only
:
-
release
-
master
tags
:
-
nexus_runner
deploy_production
:
stage
:
deploy
image
:
nexusmods/gitlab-ci-kube-deploy
script
:
-
mkdir /root/.kube
-
echo "$KUBE_CONFIG" > /root/.kube/config
-
kubectl apply -f deploy/production
-
kubectl -n production set image deployment/users users=$IMAGE_NAME:$CI_COMMIT_SHA
environment
:
production
only
:
-
master
tags
:
-
nexus_runner
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
0 → 100644
+
1
−
0
View file @
9eb851d1
rails-base-image-builder
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