Skip to content

Commit

Permalink
Add Deploy.bat
Browse files Browse the repository at this point in the history
Deployment script that creates release zip files for both editions of
CodeSnip and includes the version number passed on command line in zip
file names.

Fixes #128
  • Loading branch information
delphidabbler committed Apr 3, 2024
1 parent bcaf6cc commit 4e12075
Showing 1 changed file with 99 additions and 0 deletions.
99 changes: 99 additions & 0 deletions Deploy.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
:: This Source Code Form is subject to the terms of the Mozilla Public License,
:: v. 2.0. If a copy of the MPL was not distributed with this file, You can
:: obtain one at https://mozilla.org/MPL/2.0/
::
:: Copyright (C) 2024, Peter Johnson (gravatar.com/delphidabbler).
::
:: Deploy script for CodeSnip.
::
:: This script compiles release versions of the standard and portable editions
:: of CodeSnip and places them into two different zip files ready for release.
::
:: This script uses Embarcadero Make. Various other programs are required to
:: run Make. See Src/Makefile for details.
::
:: To use the script:
:: 1) Set the environment variables required for Make to succeed. See
:: Src/Makefile for details
:: 2) Change directory to that where this script is located.
:: 3) Run the script.
::
:: Usage:
:: Deploy <version>
:: where
:: <version> is the version number of the release, e.g. 0.5.3-beta or 1.2.0.

@echo off

setlocal

:: Check for required parameter
if "%1"=="" goto paramerror

:: Store parameter
set Version=%1

:: Store common make parameters
set CommonParams=-DVERSION=%Version%

:: Store standard edition make parameters
set StandardParams=%CommonParams%

:: Store portable edition make parameters
set PortableParams=-DPORTABLE %CommonParams%

:: Set command line
set MakeCmd=Make
set StandardMakeCmd=%MakeCmd% %StandardParams%
set PortableMakeCmd=%MakeCmd% %PortableParams%

echo ----------------------------------------------
echo Deploying CodeSnip Standard And Portable Builds
echo -----------------------------------------------
echo.
echo Standard edition Make command: %StandardMakeCmd%
echo Portable edition Make command: %PortableMakeCmd%

cd Src

echo.
echo.
echo.
echo =========================
echo Building Standard edition
echo =========================
echo.
echo.
%StandardMakeCmd%

echo.
echo.
echo.
echo =========================
echo Building Portable edition
echo =========================
echo.
echo.
%PortableMakeCmd%

echo.
echo.
echo.
echo ====================
echo Deployment completed
echo ====================

goto end

:: Error messages

:paramerror
echo.
echo ***ERROR: Please specify a version number as a parameter
echo.
goto end

:: End
:end

endlocal

0 comments on commit 4e12075

Please sign in to comment.