Skip to content

Commit

Permalink
v1.3.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
lmajano committed Mar 31, 2022
2 parents bc99807 + 6a970a5 commit 5c2060b
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 46 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Publish Github Release
name: Github Release

on:
push:
tags:
- v[0-9]+.*

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: taiki-e/[email protected]
with:
# Produced by the build/Build.cfc
changelog: changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Build Artifacts
.tmp/**
.artifacts/**
changelog-latest.md
changelog-latest.md
4 changes: 2 additions & 2 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"ContentBox CLI",
"version":"1.2.0",
"version":"1.3.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/commandbox-modules/contentbox-cli/@build.version@/[email protected]@.zip",
"slug":"contentbox-cli",
"author":"Ortus Solutions, Corp",
Expand Down Expand Up @@ -34,4 +34,4 @@
"format:watch":"cfformat watch commands,build,ModuleConfig.cfc",
"format:check":"cfformat check commands,build,ModuleConfig.cfc"
}
}
}
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


----

## [v1.3.0] => 2022-MAR-31

### Added

* New argument `deployServer` so you can choose to deploy or not a CommandBox server when installing ContentBox

----

## [v1.2.0] => 2022-FEB-18
Expand Down
23 changes: 19 additions & 4 deletions commands/contentbox/install-wizard.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ component extends="install" {
.ask();

args.cfmlPassword = ask(
"Enter the password for the CFML Engine administrator (Leave empty to use 'contentbox')? "
"Enter the password for the CFML Engine administrator (Leave empty to use 'contentbox', only if deployed on CommandBox)? "
);
if ( !args.cfmlPassword.len() ) {
args.cfmlPassword = "contentbox";
Expand Down Expand Up @@ -117,6 +117,18 @@ component extends="install" {
args.databaseName = "contentbox";
}

args.deployServer = multiSelect()
.setQuestion( "Do you want us to deploy and start a CFML Engine (#args.cfmlEngine#) on CommandBox for you? " )
.setOptions( [
{
display : "Yes",
value : true,
selected : true
},
{ display : "False", value : false }
] )
.ask();

args.production = multiSelect()
.setQuestion( "Is this a development or production site? " )
.setOptions( [
Expand All @@ -141,9 +153,12 @@ component extends="install" {

print.blueLine( "We are ready to install ContentBox for you with the following configuration: " );
print.table(
headerNames : [ "Configuration", "Value" ],
data = args.reduce( (results, k, v) => {
results.append( { configuration : k, value : ( v.len() ? v : '[default]' ) } );
headerNames: [ "Configuration", "Value" ],
data = args.reduce( ( results, k, v ) => {
results.append( {
configuration : k,
value : ( v.len() ? v : "[default]" )
} );
return results;
}, [] )
);
Expand Down
96 changes: 57 additions & 39 deletions commands/contentbox/install.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ component {
};

/**
* Install a ContentBox instance on the current working directory
* Install ContentBox on the current working directory with or without a running CFML Engine
*
* @name The name of the site to build
* @cfmlEngine The CFML engine to bind the installed ContentBox instance to
Expand All @@ -52,6 +52,7 @@ component {
* @databasePassword The database password to use for the datasource. Use an empty password if using Hypersonic
* @databaseName The database name to use for the datasource
* @production Are we installing for development or production, default is for development
* @deployServer If true, we will deploy and start the binded server via CommandBox
* @verbose Output much more verbose information about the installation process
**/
function run(
Expand All @@ -64,17 +65,18 @@ component {
databasePort = "",
required databaseUsername,
required databasePassword,
databaseName = "contentbox",
boolean production = false,
boolean verbose = false,
contentboxVersion = static.contentboxVersion
databaseName = "contentbox",
boolean production = false,
boolean deployServer = true,
boolean verbose = false,
contentboxVersion = static.contentboxVersion
){
var installDir = getCWD();

// Verify Engines
if ( !arrayFindNoCase( static.engines, arguments.cfmlEngine ) ) {
error(
"The cfml engine passed (#arguments.cfmlengine#) is not valid. Valid choices are #static.engines.toString()#"
"The CFML engine passed (#arguments.cfmlengine#) is not valid. Valid choices are #static.engines.toString()#"
);
return;
}
Expand All @@ -97,6 +99,7 @@ component {
.blueLine( "Starting to install ContentBox..." )
.line()
.toConsole();

command( "install" )
.params(
id = "contentbox-installer@#arguments.contentboxVersion#",
Expand Down Expand Up @@ -130,18 +133,22 @@ component {
.toConsole();
}

// Seed the right CFML Engine
variables.print
.blueLine( "Starting to seed the chosen CFML Engine to the server.json..." )
.line()
.toConsole();
command( "server set app.cfengine=#arguments.cfmlEngine#" ).run();
command( "server set name='#arguments.name#'" ).run();
command( "server set openBrowser=false" ).run();
variables.print
.greenLine( "√ CFML Engine Configured!" )
.line()
.toConsole();
// Seed the right CFML Engine to deploy
if ( arguments.deployServer ) {
variables.print
.blueLine( "Starting to seed the chosen CFML Engine (#arguments.cfmlEngine#) to deploy..." )
.line()
.toConsole();

command( "server set app.cfengine=#arguments.cfmlEngine#" ).run();
command( "server set name='#arguments.name#'" ).run();
command( "server set openBrowser=false" ).run();

variables.print
.greenLine( "√ CFML Engine Configured!" )
.line()
.toConsole();
}

// Create the .env
variables.print
Expand All @@ -158,12 +165,15 @@ component {
// Ask for startup
variables.print
.greenLine(
"ContentBox has been installed and configured. We will now verify your database credentials, install the migrations and then we can continue running the server."
"ContentBox has been installed and configured on disk. We will now verify your database credentials, and install the database migrations."
)
.redBoldLine( "Make sure your database (#arguments.databaseName#) has been created!" )
.redBoldLine(
"If this process fails, then your database credentials are not correct. Verify them and make sure they match the ones in the (.env) file we created."
);
)
.redBoldLine( "You don't have to run the installer again if it fails. You can run the following commands to finish your installation:" )
.redBoldLine( "- migrate install" )
.redBoldLine( "- run-script contentbox:migrate" );

// Confirm migrations
variables.print
Expand All @@ -181,30 +191,38 @@ component {
command( "migrate up migrationsDirectory=modules/contentbox/migrations" ).run();

// Confirm starting up the server
variables.print
.line()
.blueLine( "Please wait while we startup your server..." )
.toConsole();
command( "server start" ).run();
sleep( 3000 );
variables.print.greenLine( "√ ContentBox server started, check out the details below:" );
command( "server info" ).run();

// Adobe 2021 cfpm installs
if ( arguments.cfmlEngine.findNoCase( "adobe@2021" ) ) {
if ( arguments.deployServer ) {
variables.print
.line()
.blueLine( "Adobe 2021 detected, running cfpm installs to support ContentBox..." )
.blueLine( "Please wait while we startup your CommandBox server..." )
.toConsole();
command( "cfpm install zip,orm,mysql,postgresql,sqlserver,document,feed" ).run();
variables.print.greenLine( "√ CFPM modules installed" );
sleep( 1000 );
}
command( "server start" ).run();
sleep( 5000 );

// Adobe 2021 cfpm installs
if ( arguments.cfmlEngine.findNoCase( "adobe@2021" ) ) {
variables.print
.line()
.blueLine( "* Adobe 2021 detected, running cfpm installs to support ContentBox..." )
.toConsole();
command( "cfpm install zip,orm,mysql,postgresql,sqlserver,document,feed" ).run();
variables.print.greenLine( "√ CFPM modules installed" );
sleep( 5000 );
}

variables.print.greenLine( "√ ContentBox server started, check out the details below:" );
command( "server info" ).run();

variables.print.greenLine( "√ Opening a browser for you to continue with the web installer..." );
command( "server open" ).run();
variables.print.greenLine( "√ Opening a browser for you to continue with the web installer..." );
command( "server open" ).run();
} else {
variables.print
.line()
.boldRedLine( "* You did not deploy a server, so you must manually start your (#arguments.cfmlengine#) engine and visit the site so you can continue the web installer portions." )
.line();
}

variables.print.greenLine( "√ ContentBox CLI Install Wizard is done, enjoy your ContentBox!" );
variables.print.greenLine( "√ ContentBox installation is done, enjoy your ContentBox!" );
}

/**
Expand Down

0 comments on commit 5c2060b

Please sign in to comment.