Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
guru
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
guru
Commits
edb363d1
Commit
edb363d1
authored
Mar 01, 2020
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
k8s_deploy
parent
cb4f85bd
Pipeline
#1387
failed
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
6 deletions
+72
-6
.gitlab-ci.yml
.gitlab-ci.yml
+24
-6
app.yml.tpl
Docker/manifests/app.yml.tpl
+48
-0
No files found.
.gitlab-ci.yml
View file @
edb363d1
stages
:
-
build_dev
-
build_test
-
build_dev
:
stage
:
build_dev
variables
:
DOCKER_HOST
:
tcp://docker:2375
DOCKER_DRIVER
:
overlay2
build_test
:
stage
:
build_test
image
:
docker:stable
services
:
-
docker:dind
variables
:
DOCKER_HOST
:
tcp://docker:2375
DOCKER_DRIVER
:
overlay2
script
:
-
docker login -u "gitlab-ci-token" -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
-
docker build -t ${CI_REGISTRY_IMAGE}:${CI_PIPELINE_ID} .
...
...
@@ -20,3 +22,19 @@ build_dev:
-
dev
tags
:
-
buidl1-dind
deploy_to_test
:
stage
:
deploy_to_test
image
:
docker:stable
script
:
-
wget https://storage.googleapis.com/kubernetes-release/release/v1.14.3/bin/linux/amd64/kubectl && chmod +x ./kubectl
-
sed 's|_VERSION_|'"${CI_PIPELINE_ID}"'|g' Docker/manifests/app.yml.tpl > app.yml; cat app.yml
-
wget https://github.com/garethr/kubeval/releases/download/0.7.3/kubeval-linux-amd64.tar.gz && tar xvf kubeval-linux-amd64.tar.gz && ./kubeval app.yml
-
./kubectl apply -f app.yml
environment
:
name
:
${CI_COMMIT_REF_NAME}
url
:
http://guru.test
only
:
-
test
tags
:
-
buidl1-dind
Docker/manifests/app.yml.tpl
0 → 100644
View file @
edb363d1
---
apiVersion: v1
kind: Service
metadata:
name: _PROJECT_
namespace: _NS_
labels:
app: _PROJECT_
spec:
ports:
- name: _PROJECT_
port: 80
targetPort: _PROJECT_
selector:
app: _PROJECT_
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: _PROJECT_
labels:
app: _PROJECT_
namespace: _PROJECT_
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: _PROJECT_
template:
metadata:
labels:
app: _PROJECT_
spec:
containers:
- name: _PROJECT_
image: _REPO_:_VERSION_
ports:
- name: _PROJECT_
containerPort: 80
imagePullSecrets:
- name: registrypullsecret
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment