Browse Source

Updated substitution of BUILD_NUMBER

master
jfederico 4 years ago
parent
commit
af52c8cdbe
2 changed files with 4 additions and 4 deletions
  1. 1
    1
      docker-compose.yml
  2. 3
    3
      scripts/build.sh

+ 1
- 1
docker-compose.yml View File

14
       - ./nginx/sites.template:/etc/nginx/sites-available/sites.template
14
       - ./nginx/sites.template:/etc/nginx/sites-available/sites.template
15
       - ./nginx/default/html:/var/www/html
15
       - ./nginx/default/html:/var/www/html
16
       - ./nginx/log/nginx:/var/log/nginx
16
       - ./nginx/log/nginx:/var/log/nginx
17
-      - ./data/certbot/conf:/etc/letsencrypt
17
+      - ./data/certbot/conf/live:/etc/letsencrypt/live
18
       - ./data/certbot/www:/var/www/certbot
18
       - ./data/certbot/www:/var/www/certbot
19
     ports:
19
     ports:
20
       - "80:80"
20
       - "80:80"

+ 3
- 3
scripts/build.sh View File

27
   echo "This script should be used as part of a CI strategy."
27
   echo "This script should be used as part of a CI strategy."
28
   echo -e "Usage:\n  build_image.sh [ARGUMENTS]"
28
   echo -e "Usage:\n  build_image.sh [ARGUMENTS]"
29
   echo -e "\nMandatory arguments \n"
29
   echo -e "\nMandatory arguments \n"
30
-  echo -e "  repo_slug     The git repository  (e.g. bigbluebutton/greenlight)"
30
+  echo -e "  repo_slug     The git repository  (e.g. blindsidenetworks/scalelite)"
31
   echo -e "\nOptional arguments \n"
31
   echo -e "\nOptional arguments \n"
32
   echo -e "  branch | tag  The branch (e.g. master | release-2.0.5)"
32
   echo -e "  branch | tag  The branch (e.g. master | release-2.0.5)"
33
 }
33
 }
66
 if [[ "$CD_REF_NAME" == *"v"* ]]; then
66
 if [[ "$CD_REF_NAME" == *"v"* ]]; then
67
   export CD_BUILD_NUMBER=${CD_REF_NAME:1}
67
   export CD_BUILD_NUMBER=${CD_REF_NAME:1}
68
 else
68
 else
69
-  export CD_BUILD_NUMBER="$CD_REF_NAME ($(expr substr $(git rev-parse HEAD) 1 7))"
69
+  export CD_BUILD_NUMBER="$CD_REF_NAME ($(eval git rev-parse --short=7 HEAD))"
70
 fi
70
 fi
71
 
71
 
72
 # Build the image
72
 # Build the image
74
   export CD_DOCKER_REPO=$CD_REF_SLUG
74
   export CD_DOCKER_REPO=$CD_REF_SLUG
75
 fi
75
 fi
76
 echo "#### Docker image $CD_DOCKER_REPO:$CD_REF_NAME is being built"
76
 echo "#### Docker image $CD_DOCKER_REPO:$CD_REF_NAME is being built"
77
-docker build --build-arg build_number="${CD_BUILD_NUMBER}" -t $CD_DOCKER_REPO:$CD_REF_NAME .
77
+docker build --build-arg BUILD_NUMBER="${CD_BUILD_NUMBER}" -t $CD_DOCKER_REPO:$CD_REF_NAME .
78
 
78
 
79
 if [ -z "$CD_DOCKER_USERNAME" ] || [ -z "$CD_DOCKER_PASSWORD" ]; then
79
 if [ -z "$CD_DOCKER_USERNAME" ] || [ -z "$CD_DOCKER_PASSWORD" ]; then
80
   echo "#### Docker image for $CD_DOCKER_REPO can't be published because CD_DOCKER_USERNAME or CD_DOCKER_PASSWORD are missing (Ignore this warning if running outside a CD/CI environment)"
80
   echo "#### Docker image for $CD_DOCKER_REPO can't be published because CD_DOCKER_USERNAME or CD_DOCKER_PASSWORD are missing (Ignore this warning if running outside a CD/CI environment)"

Loading…
Cancel
Save