Skip to content
Snippets Groups Projects
Commit 58d4ee7b authored by GAYDAMAKHA MIKHAIL's avatar GAYDAMAKHA MIKHAIL
Browse files

Merge branch 'feature/docker-env' into 'master'

Setup CI Workflow for auto-deployment of master to production environnement

See merge request !23
parents d7160f14 a755f003
1 merge request!23Setup CI Workflow for auto-deployment of master to production environnement
kind: pipeline
type: docker
name: deploy
clone:
disable: true
steps:
- name: notif build start
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: "Drone Princelle (ERP: back)"
avatar_url: https://s3.princelle.org/share/drone-ci.png
message: >
🚀 Starting deployment of **{{ repo.name }}** repo (*ERP*)...
**Commit from {{commit.author}} on {{commit.branch}}:**
{{commit.message}}
{{ build.link }}
- name: pull
image: appleboy/drone-ssh
settings:
host: flash.princelle.org
username: mprincelle
port: 22
key:
from_secret: ci_key
script:
- cd /app/uni/erp/back
- git fetch --all
- git reset --hard origin/master
- git pull
- name: configure
image: appleboy/drone-ssh
settings:
host: flash.princelle.org
username: mprincelle
port: 22
key:
from_secret: ci_key
script:
- cd /app/uni/erp/back
- echo -e "\napi.key=theapikey" >> src/main/resources/application.properties
- echo -e "api.key=theapikey" > src/main/resources/apikey.properties
- echo -e "APP_PORT=2001" > .env
- name: build
image: appleboy/drone-ssh
settings:
host: flash.princelle.org
username: mprincelle
port: 22
key:
from_secret: ci_key
script:
- cd /app/uni/erp/back
- docker-compose up -d
- name: notif deploy done
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: "Drone Princelle (ERP: back)"
avatar_url: https://s3.princelle.org/share/drone-ci.png
message: >
✅ Successfully deployed **{{ repo.name }}** repo (*ERP*) on Princelle Cloud!
**Commit from {{commit.author}} on {{commit.branch}}:**
{{commit.message}}
**App URL:** https://back.erp.uni.princelle.org/
{{ build.link }}
when:
status:
- success
- name: notif deploy failure
image: appleboy/drone-discord
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_token
username: "Drone Princelle (ERP: back)"
avatar_url: https://s3.princelle.org/share/drone-ci.png
message: >
⚠️ Error on deploying **{{ repo.name }}** repo (*ERP*) on Princelle Cloud...
**Commit from {{commit.author}} on {{commit.branch}}:**
{{commit.message}}
{{ build.link }}
when:
status:
- failure
trigger:
branch:
- master
version: '3.3'
services:
app:
container_name: erp-back
restart: unless-stopped
image: maven:3-openjdk-11
working_dir: /app
volumes:
- .:/app
- ~/.m2:/root/.m2
ports:
- "${APP_PORT:-8888}:8080"
command: ./gradlew bootRun
gradlew 100644 → 100755
File mode changed from 100644 to 100755
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment