From 917f668cf320a33692c350c1fa100ac3647e578b Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 11 Sep 2018 19:17:29 +0200 Subject: [PATCH 1/2] Added release instructions to readme file, and improved how to build instructions --- .gitignore | 1 + README.md | 14 +++++++++----- build.sh | 9 +++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index e3bcd671..92cf8d4f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ vendor/ data/database.sqlite docs/swagger-ui docker-compose.override.yml +composer.phar diff --git a/README.md b/README.md index f47c72fa..9f0e3668 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,12 @@ Then, you will need a built version of the project. There are a few ways to get If for any reason you want to build the project yourself, follow these steps: * Clone the project with git (`git clone https://github.com/shlinkio/shlink.git`), or download it by clicking the **Clone or download** green button. - * Download the [Composer](https://getcomposer.org/) PHP package manager. - * Use composer to install the production project dependencies by running `php composer.phar install --no-dev --optimize-autoloader --no-progress --no-interaction`. + * Download the [Composer](https://getcomposer.org/download/) PHP package manager inside the project folder. + * Run `./build.sh 1.0.0`, replacing the version with the version number you are going to build (the version number is only used for the generated dist file). + + After that, you will have a `shlink_x.x.x_dist.zip` dist file inside the `build` directory. + + This is the process used when releasing new shlink versions. After tagging the new version with git, the Github release is created, attaching generated dist file to it. Despite how you built the project, you are going to need to install it now, by following these steps: @@ -128,16 +132,16 @@ Currently the image does not expose an entry point which let's you interact with ## Using shlink -Once shlink is installed, there are two main ways to interact with it, in order to create shortened URLs: +Once shlink is installed, there are two main ways to interact with it: * **The command line**. Try running `bin/cli` and see all the available commands. All of those commands can be run with the `--help`/`-h` flag in order to see how to use them and all the available options. - It is probably a good idea symlinking the CLI entry point (`bin/cli`) to somewhere in your path, so that you can run shlink from any directory. + It is probably a good idea to symlink the CLI entry point (`bin/cli`) to somewhere in your path, so that you can run shlink from any directory. * **The REST API**. The complete docs on how to use the API can be found [here](https://shlink.io/api-docs), and a sandbox which also documents every endpoint can be found [here](https://shlink.io/swagger-ui/index.html). However, you probably don't want to consume the raw API yourself. That's why a nice [web client](https://github.com/shlinkio/shlink-web-client) is provided that can be directly used from [https://app.shlink.io](https://app.shlink.io), or you can host it yourself too. -Both the API and CLI allow you to do the same operations, except for API key management, which can be done from the command line only. +Both the API and CLI allow you to do the same operations, except for API key management, which can be done from the command line interface only. diff --git a/build.sh b/build.sh index 65e4b291..e4986ddf 100755 --- a/build.sh +++ b/build.sh @@ -10,6 +10,7 @@ fi version=$1 builtcontent=$(readlink -f "../shlink_${version}_dist") projectdir=$(pwd) +[ -f ./composer.phar ] && composerBin='./composer.phar' || composerBin='composer' # Copy project content to temp dir echo 'Copying project files...' @@ -20,10 +21,11 @@ cp -R "${projectdir}"/* "${builtcontent}" cd "${builtcontent}" # Install dependencies +echo "Installing dependencies with $composerBin..." rm -rf vendor rm -f composer.lock -composer self-update -composer install --no-dev --optimize-autoloader --no-progress --no-interaction +$composerBin self-update +$composerBin install --no-dev --optimize-autoloader --no-progress --no-interaction # Delete development files echo 'Deleting dev files...' @@ -50,6 +52,9 @@ rm -rf config/autoload/{{,*.}local.php{,.dist},.gitignore} sed -i "s/%SHLINK_VERSION%/${version}/g" config/autoload/app_options.global.php # Compressing file +echo 'Compressing files...' rm -f "${projectdir}"/build/shlink_${version}_dist.zip zip -ry "${projectdir}"/build/shlink_${version}_dist.zip "../shlink_${version}_dist" rm -rf "${builtcontent}" + +echo 'Done!' From 0af10048605005639d2980f84eba3a52a019a7d6 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 11 Sep 2018 19:25:13 +0200 Subject: [PATCH 2/2] Ordered gitignore placing all composer-related files together --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 92cf8d4f..9426e5f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ .idea build composer.lock +composer.phar vendor/ .env data/database.sqlite docs/swagger-ui docker-compose.override.yml -composer.phar