Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
kubetest
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
Show more breadcrumbs
ConduitMiau
kubetest
Commits
dd4d9a97
Commit
dd4d9a97
authored
3 years ago
by
M9713
Browse files
Options
Downloads
Patches
Plain Diff
Delete .gitlab-ci.yml
parent
1791264f
No related branches found
No related tags found
No related merge requests found
Pipeline
#439161
failed
3 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend-express/.gitlab-ci.yml
+0
-103
0 additions, 103 deletions
backend-express/.gitlab-ci.yml
with
0 additions
and
103 deletions
backend-express/.gitlab-ci.yml
deleted
100644 → 0
+
0
−
103
View file @
1791264f
stages
:
-
build
-
test
-
deploy-dev
-
deploy-prod
variables
:
# Save manifest repository URL to a variable for clarity
MANIFEST_REPOSITORY
:
git@gitlab.labranet.jamk.fi:conduit-gitops/gitops.git
build
:
stage
:
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
script
:
# build from dockerfile with Kaniko
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
-
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile ./Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
only
:
-
master
tags
:
#assign shared runner
-
general
test
:
stage
:
test
script
:
echo "insert tests here... "
tags
:
# assign shared runner
-
general
deploy-dev
:
stage
:
deploy-dev
image
:
alpine:latest
before_script
:
# kustomize install
-
apk add --no-cache git curl bash
-
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
-
mv kustomize /usr/local/bin/
-
git config --global user.email "gitlabbu@gitloponer.com"
-
git config --global user.name "GitLab CI"
# add SSH key to runner from CI/CD variables so that it can push to repository
-
apk add --no-cache --update openssh-client
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
-
echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
-
chmod 400 ~/.ssh/known_hosts
-
chmod 400 ~/.ssh/id_rsa
script
:
# clone manifest repository - update image tag with kustomize - push changes to same repository
-
git clone --single-branch --branch dev $MANIFEST_REPOSITORY
-
ls -l
-
cd gitops/dev/backend/
-
kustomize edit set image $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-
cat kustomization.yaml
-
git commit -am '[skip ci] DEV image updated'
-
git push origin dev
only
:
-
master
tags
:
# assign shared runner
-
general
deploy-prod
:
stage
:
deploy-prod
image
:
alpine:latest
before_script
:
# kustomize install
-
apk add --no-cache git curl bash
-
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
-
mv kustomize /usr/local/bin/
-
git config --global user.email "gitlabbu@gitloponer.com"
-
git config --global user.name "GitLab CI"
# add SSH key to runner from CI/CD variables so that it can push to repository
-
apk add --no-cache --update openssh-client
-
mkdir -p ~/.ssh
-
chmod 700 ~/.ssh
-
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
-
echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
-
chmod 400 ~/.ssh/known_hosts
-
chmod 400 ~/.ssh/id_rsa
script
:
# clone manifest repository - update image tag with kustomize - push changes to same repository
-
git clone --single-branch --branch master $MANIFEST_REPOSITORY
-
ls -l
-
cd gitops/prod/backend/
-
kustomize edit set image $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
-
cat kustomization.yaml
-
git commit -am '[skip ci] PROD image updated'
-
git push origin master
only
:
-
master
tags
:
# assign shared runner
-
general
# requires manual approval to deploy to production
when
:
manual
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