add universal pipeline
This commit is contained in:
@@ -1,27 +1,8 @@
|
|||||||
image: docker:20.10.16
|
image: docker:20.10.16
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
# When using dind service, you must instruct Docker to talk with
|
|
||||||
# the daemon started inside of the service. The daemon is available
|
|
||||||
# with a network connection instead of the default
|
|
||||||
# /var/run/docker.sock socket.
|
|
||||||
DOCKER_HOST: tcp://docker:2376
|
DOCKER_HOST: tcp://docker:2376
|
||||||
#
|
|
||||||
# The 'docker' hostname is the alias of the service container as described at
|
|
||||||
# https://docs.gitlab.com/ee/ci/services/#accessing-the-services.
|
|
||||||
# If you're using GitLab Runner 12.7 or earlier with the Kubernetes executor and Kubernetes 1.6 or earlier,
|
|
||||||
# the variable must be set to tcp://localhost:2376 because of how the
|
|
||||||
# Kubernetes executor connects services to the job container
|
|
||||||
# DOCKER_HOST: tcp://localhost:2376
|
|
||||||
#
|
|
||||||
# Specify to Docker where to create the certificates. Docker
|
|
||||||
# creates them automatically on boot, and creates
|
|
||||||
# `/certs/client` to share between the service and job
|
|
||||||
# container, thanks to volume mount from config.toml
|
|
||||||
DOCKER_TLS_CERTDIR: "/certs"
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
# These are usually specified by the entrypoint, however the
|
|
||||||
# Kubernetes executor doesn't run entrypoints
|
|
||||||
# https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4125
|
|
||||||
DOCKER_TLS_VERIFY: 1
|
DOCKER_TLS_VERIFY: 1
|
||||||
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
|
DOCKER_CERT_PATH: "$DOCKER_TLS_CERTDIR/client"
|
||||||
|
|
||||||
@@ -40,9 +21,9 @@ build-job:
|
|||||||
- master
|
- master
|
||||||
script:
|
script:
|
||||||
- docker info
|
- docker info
|
||||||
- docker build -t docker-registry.dopcore.com/andrusyakka/astra-users .
|
- docker build -t docker-registry.dopcore.com/$CI_PROJECT_PATH .
|
||||||
- echo "$DOCKER_PASSWORD" | docker login docker-registry.dopcore.com -u "$DOCKER_USER" --password-stdin
|
- echo "$CI_REGISTRY_PASSWORD" | docker login docker-registry.dopcore.com -u "$CI_REGISTRY_USER" --password-stdin
|
||||||
- docker push docker-registry.dopcore.com/andrusyakka/astra-users
|
- docker push docker-registry.dopcore.com/$CI_PROJECT_PATH
|
||||||
|
|
||||||
deploy-job:
|
deploy-job:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
@@ -52,6 +33,8 @@ deploy-job:
|
|||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
script:
|
script:
|
||||||
|
- export $(xargs < deploy/.env)
|
||||||
|
- envsubst < deploy/values.template.yaml > deploy/values.yaml
|
||||||
- kubectl version
|
- kubectl version
|
||||||
- helm upgrade --install astra-users deploy
|
- helm upgrade --install astra-api-gateway deploy
|
||||||
- kubectl rollout restart deploy/astra-users
|
- kubectl rollout restart deploy/astra-api-gateway
|
||||||
|
|||||||
2
deploy/.env
Normal file
2
deploy/.env
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
SERVICE_REPLICAS=3
|
||||||
|
SERVICE_PORT=8080
|
||||||
16
deploy/values.template.yaml
Normal file
16
deploy/values.template.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
app:
|
||||||
|
fullName: ${CI_PROJECT_TITLE}
|
||||||
|
image: docker-registry.dopcore.com/${CI_PROJECT_PATH}
|
||||||
|
server:
|
||||||
|
port: ${SERVICE_PORT}
|
||||||
|
|
||||||
|
replicas: ${SERVICE_REPLICAS}
|
||||||
|
|
||||||
|
images:
|
||||||
|
pullSecret: regcred
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
autoscaling:
|
||||||
|
enabled: false
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
# Default values for astra-frontend.
|
|
||||||
# This is a YAML-formatted file.
|
|
||||||
# Declare variables to be passed into your templates.
|
|
||||||
|
|
||||||
|
|
||||||
app:
|
|
||||||
fullName: astra-users
|
|
||||||
image: docker-registry.dopcore.com/andrusyakka/astra-users
|
|
||||||
server:
|
|
||||||
port: 8080
|
|
||||||
|
|
||||||
replicas: 3
|
|
||||||
|
|
||||||
images:
|
|
||||||
pullSecret: regcred
|
|
||||||
|
|
||||||
ingress:
|
|
||||||
enabled: false
|
|
||||||
className: ""
|
|
||||||
annotations: {}
|
|
||||||
# kubernetes.io/ingress.class: nginx
|
|
||||||
# kubernetes.io/tls-acme: "true"
|
|
||||||
hosts:
|
|
||||||
- host: chart-example.local
|
|
||||||
paths:
|
|
||||||
- path: /
|
|
||||||
pathType: ImplementationSpecific
|
|
||||||
tls: []
|
|
||||||
# - secretName: chart-example-tls
|
|
||||||
# hosts:
|
|
||||||
# - chart-example.local
|
|
||||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
|
||||||
# choice for the user. This also increases chances charts run on environments with little
|
|
||||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
|
||||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
|
||||||
# limits:
|
|
||||||
# cpu: 100m
|
|
||||||
# memory: 128Mi
|
|
||||||
# requests:
|
|
||||||
# cpu: 100m
|
|
||||||
# memory: 128Mi
|
|
||||||
|
|
||||||
autoscaling:
|
|
||||||
enabled: false
|
|
||||||
minReplicas: 1
|
|
||||||
maxReplicas: 10
|
|
||||||
targetCPUUtilizationPercentage: 80
|
|
||||||
# targetMemoryUtilizationPercentage: 80
|
|
||||||
Reference in New Issue
Block a user