prod ci
This commit is contained in:
parent
a68b7c1110
commit
43f2c9927e
26
.gitea/workflows/deployProd.yml
Normal file
26
.gitea/workflows/deployProd.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
name: Deploy
|
||||||
|
run-name: ${{ gitea.actor }} build image and push to container registry
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
CreateImage:
|
||||||
|
runs-on: [hubstaging]
|
||||||
|
uses: https://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p
|
||||||
|
with:
|
||||||
|
runner: hubstaging
|
||||||
|
secrets:
|
||||||
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||||
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
DeployService:
|
||||||
|
runs-on: [frontprod]
|
||||||
|
needs: CreateImage
|
||||||
|
uses: https://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.1.4-p7
|
||||||
|
with:
|
||||||
|
runner: hubprod
|
||||||
|
actionid: ${{ gitea.run_id }}
|
||||||
|
|
||||||
|
|
26
.gitea/workflows/deployStaging.yml
Normal file
26
.gitea/workflows/deployStaging.yml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
name: Deploy
|
||||||
|
run-name: ${{ gitea.actor }} build image and push to container registry
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'staging'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
CreateImage:
|
||||||
|
runs-on: [hubstaging]
|
||||||
|
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p
|
||||||
|
with:
|
||||||
|
runner: hubstaging
|
||||||
|
secrets:
|
||||||
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||||
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
DeployService:
|
||||||
|
runs-on: [frontstaging]
|
||||||
|
needs: CreateImage
|
||||||
|
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/deploy.yml@v1.1.4-p7
|
||||||
|
with:
|
||||||
|
runner: frontstaging
|
||||||
|
actionid: ${{ gitea.run_id }}
|
||||||
|
|
||||||
|
|
14
.gitea/workflows/lint.yml
Normal file
14
.gitea/workflows/lint.yml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
name: Lint
|
||||||
|
run-name: ${{ gitea.actor }} produce linting
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'dev'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Lint:
|
||||||
|
runs-on: [hubstaging]
|
||||||
|
uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/lint.yml@v1.1.0
|
||||||
|
with:
|
||||||
|
runner: hubstaging
|
@ -1,51 +0,0 @@
|
|||||||
include:
|
|
||||||
- project: "devops/pena-continuous-integration"
|
|
||||||
file: "/templates/docker/build-template.gitlab-ci.yml"
|
|
||||||
- project: "devops/pena-continuous-integration"
|
|
||||||
file: "/templates/docker/clean-template.gitlab-ci.yml"
|
|
||||||
- project: "devops/pena-continuous-integration"
|
|
||||||
file: "/templates/docker/deploy-template.gitlab-ci.yml"
|
|
||||||
stages:
|
|
||||||
- clean
|
|
||||||
- build
|
|
||||||
- deploy
|
|
||||||
clear-old-images:
|
|
||||||
tags:
|
|
||||||
- frontbuild
|
|
||||||
extends: .clean_template
|
|
||||||
variables:
|
|
||||||
STAGING_BRANCH: "staging"
|
|
||||||
PRODUCTION_BRANCH: "main"
|
|
||||||
image:
|
|
||||||
name: docker/compose:1.28.0
|
|
||||||
entrypoint: [""]
|
|
||||||
before_script:
|
|
||||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
||||||
build-app:
|
|
||||||
extends: .build_template
|
|
||||||
tags:
|
|
||||||
- frontbuild
|
|
||||||
before_script:
|
|
||||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
||||||
variables:
|
|
||||||
DOCKER_BUILD_PATH: "./Dockerfile"
|
|
||||||
STAGING_BRANCH: "staging"
|
|
||||||
PRODUCTION_BRANCH: "main"
|
|
||||||
script:
|
|
||||||
- docker build -t $CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID --build-arg GITLAB_TOKEN=$GITLAB_TOKEN $CI_PROJECT_DIR
|
|
||||||
- docker push $CI_REGISTRY_IMAGE/$CI_COMMIT_BRANCH:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
|
||||||
|
|
||||||
deploy-to-prod:
|
|
||||||
tags:
|
|
||||||
- prod
|
|
||||||
- front
|
|
||||||
extends: .deploy_template
|
|
||||||
variables:
|
|
||||||
PRODUCTION_BRANCH: main
|
|
||||||
before_script:
|
|
||||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
||||||
rules:
|
|
||||||
- if: "$CI_COMMIT_BRANCH == $PRODUCTION_BRANCH"
|
|
||||||
script:
|
|
||||||
- docker login -u $REGISTRY_USER -p $REGISTRY_TOKEN $CI_REGISTRY
|
|
||||||
- docker-compose -f deployments/$CI_COMMIT_BRANCH/docker-compose.yaml up -d
|
|
@ -1,4 +1,4 @@
|
|||||||
FROM nginx:latest
|
FROM gitea.pena/penadevops/container-images/node:main as build
|
||||||
|
|
||||||
COPY privkey.pem /etc/nginx/
|
COPY privkey.pem /etc/nginx/
|
||||||
COPY fullchain.pem /etc/nginx/
|
COPY fullchain.pem /etc/nginx/
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
version: "3"
|
|
||||||
services:
|
services:
|
||||||
router:
|
router:
|
||||||
image: $CI_REGISTRY_IMAGE/main:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID
|
image: gitea.pena/penaside/nginx-proxy/main:$GITHUB_RUN_NUMBER
|
||||||
ports:
|
ports:
|
||||||
- 10.6.0.28:80:80
|
- 92.38.153.141:80:80
|
||||||
- 10.6.0.28:443:443
|
- 92.38.153.141:443:443
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx/certs/:/etc/nginx/certs/:ro
|
- ./nginx/certs/:/etc/nginx/certs/:ro
|
||||||
|
Loading…
Reference in New Issue
Block a user