diff --git a/Cargo.lock b/Cargo.lock index fbf07de..6bd3e74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -126,7 +126,7 @@ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "ckan-devstaller" -version = "0.1.0" +version = "0.3.0" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 63bfc7a..732c927 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ckan-devstaller" -version = "0.1.0" +version = "0.3.0" edition = "2024" [dependencies] diff --git a/README.md b/README.md index 72cd505..339fbe1 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,12 @@ # ckan-devstaller -`ckan-devstaller` attempts to install CKAN 2.11.3 from source using [ckan-compose](https://github.com/tino097/ckan-compose), intended for development use in a new Ubuntu 22.04 instance. The following are also installed and enabled by default: +`ckan-devstaller` attempts to install CKAN 2.11.3 from source using [ckan-compose](https://github.com/tino097/ckan-compose), intended for development use in a new Ubuntu 22.04 instance. -- [DataStore extension](https://docs.ckan.org/en/2.11/maintaining/datastore.html) -- [ckanext-scheming extension](https://github.com/ckan/ckanext-scheming) -- [DataPusher+ extension](https://github.com/dathere/datapusher-plus) - -[DRUF mode](https://github.com/dathere/datapusher-plus?tab=readme-ov-file#druf-dataset-resource-upload-first-workflow) is available but disabled by default. The [`datatablesview-plus` extension](https://github.com/dathere/ckanext-datatables-plus) is planned to be included in a future release. +Get started at [ckan-devstaller.dathere.com](https://ckan-devstaller.dathere.com). ## Quick start -> [!CAUTION] -> Make sure `ckan-devstaller` is run in a **new** Ubuntu 22.04 instance. Do NOT run `ckan-devstaller` in an existing instance that is important for your usage. - -> [!WARNING] -> If you are using Ubuntu 22.04 on VirtualBox, you may need to add your user to the sudoers file before running the ckan-devstaller install script. Open a terminal in your virtual machine (VM), run `su -` and log in as the root user with the password you used to set up the VM, then type `sudo adduser sudo` where `` is your username then restart your VM and run the ckan-devstaller installer script. - -> [!NOTE] -> The `/etc/ckan/default/ckan.ini` config file will have its comments removed for now. There are plans to fix this in a future release of `ckan-devstaller`. - -> [!NOTE] -> Currently `ckan-devstaller` supports x86 architecture. ARM support is planned. - -You have two common options to choose from for installation. Paste one of the following scripts into your new Ubuntu 22.04 instance's terminal. - -### Install with non-interactive mode (default config) - -```bash -wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.2.1/install.bash | bash -s default -``` - -### Install with interactive mode - -```bash -wget -O - https://github.com/dathere/ckan-devstaller/releases/download/0.2.1/install.bash | bash -``` +Please visit [ckan-devstaller.dathere.com/docs/quick-start](https://ckan-devstaller.dathere.com/docs/quick-start) for how to get started with ckan-devstaller. ## Demos diff --git a/install.bash b/install.bash index 2d14f81..dc0ec57 100644 --- a/install.bash +++ b/install.bash @@ -11,18 +11,25 @@ sudo apt install curl -y cd ~/ # Download the ckan-devstaller binary file -curl -LO https://github.com/dathere/ckan-devstaller/releases/download/0.2.1/ckan-devstaller +curl -LO https://github.com/dathere/ckan-devstaller/releases/download/0.3.0/ckan-devstaller # Add execute permission to ckan-devstaller binary file sudo chmod +x ./ckan-devstaller -# Run the ckan-devstaller binary file -# If the user provides an argument "default", run ckan-devstaller in non-interactive mode with the default config -# Otherwise run ckan-devstaller in interactive mode -flag=$1 +# Run the ckan-devstaller binary file with the specified preset and (non-)interactive mode +preset=$1 +skip_interactive=$2 -if [ $flag == "default" ]; then - ./ckan-devstaller --default +if [ $preset == "dathere-default" ]; then + if [ $skip_interactive == "skip-interactive" ]; then + ./ckan-devstaller --ckan-version 2.11.3 --extensions ckanext-scheming DataStore DataPusher+ --features enable-ssh --skip-interactive + else + ./ckan-devstaller --ckan-version 2.11.3 --extensions ckanext-scheming DataStore DataPusher+ --features enable-ssh + fi else - ./ckan-devstaller + if [ $preset == "skip-interactive" ]; then + ./ckan-devstaller --skip-interactive + else + ./ckan-devstaller + fi fi diff --git a/src/main.rs b/src/main.rs index 97840d2..8931861 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,9 +23,9 @@ use xshell_venv::{Shell, VirtualEnv}; #[derive(Parser)] #[command(version, about, long_about = None)] struct Args { - /// Skip interactive steps and install the CKAN-only preset + /// Skip interactive steps #[arg(short, long)] - default: bool, + skip_interactive: bool, #[arg(short, long)] /// CKAN version to install defined by semantic versioning from official releases from https://github.com/ckan/ckan ckan_version: Option, @@ -146,7 +146,7 @@ rm -rf README ckan-compose ahoy dpp_default_config.ini get-docker.sh permissions default_config_text.push_str("\n- Disable DRUF mode for DataPusher+"); } println!("{default_config_text}"); - let answer_customize = if args.default { + let answer_customize = if args.skip_interactive { false } else { Confirm::new("Would you like to customize the configuration for your CKAN installation?") @@ -186,7 +186,7 @@ rm -rf README ckan-compose ahoy dpp_default_config.ini get-docker.sh permissions config }; - let begin_installation = if args.default { + let begin_installation = if args.skip_interactive { true } else { Confirm::new("Would you like to begin the installation?").prompt()?