Try fixing Jenkins

This commit is contained in:
emil28092005
2026-01-16 23:52:50 +03:00
parent 5b8f9bc1ab
commit c25952bbc1
2 changed files with 5 additions and 6 deletions
Vendored
+4 -5
View File
@@ -4,14 +4,13 @@ pipeline{
skipDefaultCheckout()
}
environment {
SRC_DIR = "/opt/shagram/src/shagram"
DEPLOY_DIR = "/opt/shagram/deploy/shagram"
PROJECT_DIR = "/opt/shagram/shagram"
IMAGE_NAME = "shagram"
}
stages{
stage('Checkout') {
steps {
dir(env.SRC_DIR) {
dir(env.PROJECT_DIR) {
deleteDir()
git url: 'https://github.com/emil28092005/shagram.git', branch: 'main'
}
@@ -19,7 +18,7 @@ pipeline{
}
stage('Build') {
steps {
dir(env.SRC_DIR) {
dir(env.PROJECT_DIR) {
echo 'Building shagram...'
sh 'docker build -t ${IMAGE_NAME}:${GIT_COMMIT} .'
@@ -34,7 +33,7 @@ pipeline{
}
stage('Deploy') {
steps {
dir(env.DEPLOY_DIR) {
dir("${PROJECT_DIR}/deploy/shagram") {
echo 'Deploying...'
sh 'printf "APP_IMAGE=%s\\n" "${IMAGE_NAME}:${GIT_COMMIT}" > .env'
sh 'docker compose up -d'
+1 -1
View File
@@ -2,7 +2,7 @@ services:
shagram:
image: ${APP_IMAGE:-shagram:local}
build:
context: ../../src/shagram
context: ../..
container_name: shagram-app
environment:
- DATABASE_PATH=/app/data/shagram.db