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() skipDefaultCheckout()
} }
environment { environment {
SRC_DIR = "/opt/shagram/src/shagram" PROJECT_DIR = "/opt/shagram/shagram"
DEPLOY_DIR = "/opt/shagram/deploy/shagram"
IMAGE_NAME = "shagram" IMAGE_NAME = "shagram"
} }
stages{ stages{
stage('Checkout') { stage('Checkout') {
steps { steps {
dir(env.SRC_DIR) { dir(env.PROJECT_DIR) {
deleteDir() deleteDir()
git url: 'https://github.com/emil28092005/shagram.git', branch: 'main' git url: 'https://github.com/emil28092005/shagram.git', branch: 'main'
} }
@@ -19,7 +18,7 @@ pipeline{
} }
stage('Build') { stage('Build') {
steps { steps {
dir(env.SRC_DIR) { dir(env.PROJECT_DIR) {
echo 'Building shagram...' echo 'Building shagram...'
sh 'docker build -t ${IMAGE_NAME}:${GIT_COMMIT} .' sh 'docker build -t ${IMAGE_NAME}:${GIT_COMMIT} .'
@@ -34,7 +33,7 @@ pipeline{
} }
stage('Deploy') { stage('Deploy') {
steps { steps {
dir(env.DEPLOY_DIR) { dir("${PROJECT_DIR}/deploy/shagram") {
echo 'Deploying...' echo 'Deploying...'
sh 'printf "APP_IMAGE=%s\\n" "${IMAGE_NAME}:${GIT_COMMIT}" > .env' sh 'printf "APP_IMAGE=%s\\n" "${IMAGE_NAME}:${GIT_COMMIT}" > .env'
sh 'docker compose up -d' sh 'docker compose up -d'
+1 -1
View File
@@ -2,7 +2,7 @@ services:
shagram: shagram:
image: ${APP_IMAGE:-shagram:local} image: ${APP_IMAGE:-shagram:local}
build: build:
context: ../../src/shagram context: ../..
container_name: shagram-app container_name: shagram-app
environment: environment:
- DATABASE_PATH=/app/data/shagram.db - DATABASE_PATH=/app/data/shagram.db