Skip to content

Commit

Permalink
Release/v2.0.0 (#89)
Browse files Browse the repository at this point in the history
* Fixed shell check stuff

* Change to stable CLI for PHP

* Removed old code

* Remove GHA templates

* Removed templates from repo

* Removed unused variable

* WIP of Spin new refactor

* Working init

* Simplified code

* Fix default var

* Added cleanup

* Fixed reference

* Put quotes on variable

* Added check for default branch

* Improve variable setting

* Centralized download function

* Working init

* Fix spelling error

* Working new and init

* Remove debug

* chore: Update existing file warning message formatting

* Fix issue with 'new.sh' script not removing repository arguments

* Remove templates

* Fix echo bug

* chore: Update SPIN_USER_ID and SPIN_GROUP_ID assignment

* feat: Add 'deploy' action to spin script

* Centralized function

* Centralized funciton

* Set to deploy

* Organized functions

* feat: Add 'mkpasswd' command to spin script

* feat: Add Docker Compose file support to deploy.sh and provision.sh

* chore: Update ansible-galaxy collection to serversideup.spin

* feat: Update ansible-galaxy collection to serversideup.spin

* Working SSH upload

* Working deploy

* Zero downtime deployments working

* Reset download

* Remove templates

* chore: Refactor deploy.sh to improve cleanup_registry function

* feat: Add support for dynamic Docker Compose files in deploy.sh

* chore: Add template usage instructions to init.sh

* chore: Update provision.sh flag for upgrade to use uppercase 'U'

* chore: Remove unused variable in deploy.sh

* chore: Update init.sh to include template usage instructions

* chore: Update ansible-galaxy collection installation command

* chore: Update SPIN_ANSIBLE_IMAGE to version 2.16-alpine-3.19

* chore: Update provision command to support Ubuntu 22.04+ servers

* chore: Update server requirements to include Ubuntu 22.04+ support

* chore: Update provision command to support Ubuntu 22.04+ servers and add upgrade flag

* chore: Update provision command to support Ubuntu 22.04+ servers and add upgrade flag

* chore: Update provision command to support Ubuntu 22.04+ servers and add upgrade flag

* Fixed reference

* chore: Add new command reference for "spin deploy"

* Ensure new line always exists

* chore: Update .gitignore and .dockerignore to exclude .vault-password file

* Clean up and refactor

* chore: Set SPIN_ACTION to "new" when calling install.sh on a template

* Set comment

* chore: Refactor run_ansible function to use an array for additional docker arguments

* chore: Update ansible-galaxy collection installation command to use quotes for collection name

* Added vault password support

* Refactor get_ansible_variable function to use separate function for ansible vault arguments

* Refactor deploy and provision scripts to use check_galaxy_pull function

* Refactor deploy and provision scripts to use check_galaxy_pull function

* Refactor deploy.sh to use ansible vault arguments in get_hosts_from_ansible function

* chore: Refactor SSH tunnel creation in deploy.sh

* Rely on the template to set SPIN_PROJECT_DIRECTORY

* Some suggestions for the deploy command (#82)

* Some suggestions

- Read the .env file if there is one. This would make it easier to set certain variables on a per project basis.
- Make reading the configuration files dynamic. This way you don't need a .infrastructure folder if you haven't defined any config key. Only caveat is that it will use the file name to generate the environment variable. So 
```
configs:
  traefik:
    name: 'traefik-${SPIN_TRAEFIK_CONFIG_MD5_HASH}.yml'
    file: ./.infrastructure/conf/traefik/prod/traefik.yml
```
Would become:
```
configs:
  traefik:
    name: 'traefik-${SPIN_TRAEFIK_YML_CONFIG_MD5_HASH}.yml'
    file: ./.infrastructure/conf/traefik/prod/traefik.yml
```
- Remove the requirement for a Docker image. This would make it easier to run specific docker stacks with only redis or traefik

* Set environment variables to SPIN_MD5_HASH_{{config-filename}}

* Quote variable

---------

Co-authored-by: Jay Rogers <[email protected]>

* Quoted variables

* Fix comment

* Added docs how to create your own Spin template

* Added image

* Updated docs about official laravel template

* docs: Remove deprecated guide on using mkpasswd to generate user passwords

* chore: Update server preparation documentation

* Update Spin description to emphasize consistent configuration across environments

* docs: Update Spin description and deployment options

* Remove version

* Bump to =8.3 in docs

* docs: Update Spin deployment options and descriptions

* docs: Update Spin deployment options and descriptions

* Changed Git Clones from HTTPS to SSH

* chore: Update default registry port in deploy script

* Updated docs

* docs: Update deployment documentation for using different .env files per environment

* chore: Load environment variables from .env file for the target environment

* Added `spin ps`

* chore: Add post-install script for executing additional commands after template installation

* chore: Update temporary template source directory variable names

* chore: Build and push Docker images for each Dockerfile in the project directory

* Updated function to line_in_file

* Fixed link

* Ignore spin files

* chore: Update Docker image name to lowercase for consistency

* Added error checking

* chore: Refactor deploy.sh script for improved readability and maintainability

* Remove debug

* chore: Set SPIN_APP_DOMAIN based on APP_URL in deploy script

* Remove debug

* Refactor deploy.sh script for improved readability and maintainability

* chore: Update run.sh script to disable automations and S6 logging

* Refactor sed_inplace function to escape forward slashes in the replacement string

* Added further action

* Improved DX in output

* chore: Update installation guide to use "Prerequisites" instead of "Pre-requisites"

* Updated hero

* chore: Update MarketingServers.vue to improve infrastructure control and ownership

* Exit if no dockerfiles found

* chore: Fix missing newline at end of file in version.sh

* Updated GitHub Actions to be accurate

* chore: Refactor line_in_file function to use 'action' instead of 'mode'

* Refactor line_in_file function to use 'action' instead of 'mode'

* Refactor line_in_file function to use 'action' instead of 'mode'

* Removed demo until we get an updated one

* Removed site previews via GitHub Actions

* Changed instruction

---------

Co-authored-by: Nick Retel <[email protected]>
  • Loading branch information
jaydrogers and nckrtl authored Aug 9, 2024
1 parent 66115b2 commit 3581421
Show file tree
Hide file tree
Showing 68 changed files with 1,742 additions and 1,708 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/action_marketing-site-preview.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/action_marketing-site-publish.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/service_deploy-static-site.yml

This file was deleted.

5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ Spin serves as a collection of open source technologies, put together in one sim
- [serversideup/php](https://serversideup.net/open-source/docker-php/) - PHP Docker images highly optimized to work with Laravel + Spin.
- [serversideup/docker-ssh](https://github.com/serversideup/docker-ssh) - A lightweight docker image that runs SSH. This is a fantastic method on using a secure SSH tunnel into your database cluster.

## Demo
Here's a demo showing a process of creating a new Laravel project and deploying it to production:

<a href="https://www.youtube.com/watch?v=I_dq-kRDztI"><img src="https://serversideup.net/wp-content/uploads/2024/01/Youtube-player.png" /></a>

## Resources
- **[Website](https://serversideup.net/open-source/spin/)** overview of the product.
- **[Docs](https://serversideup.net/open-source/spin/docs)** for a deep-dive on how to use the product.
Expand Down
33 changes: 23 additions & 10 deletions bin/spin
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ SPIN_ENV=${SPIN_ENV:-dev}
export COMPOSE_CMD=${COMPOSE_CMD:-"docker compose"}

# Export the current user and group ID
export SPIN_USER_ID=$(id -u)
export SPIN_GROUP_ID=$(id -g)
SPIN_USER_ID=${SPIN_USER_ID:-$(id -u)}
SPIN_GROUP_ID=${SPIN_GROUP_ID:-$(id -g)}
export SPIN_USER_ID
export SPIN_GROUP_ID

# Default Images
SPIN_PHP_IMAGE=${SPIN_PHP_IMAGE:-"serversideup/php:beta-cli"}
SPIN_PHP_IMAGE=${SPIN_PHP_IMAGE:-"serversideup/php:cli"}
SPIN_NODE_IMAGE=${SPIN_NODE_IMAGE:-"node:20"}
SPIN_ANSIBLE_IMAGE=${SPIN_ANSIBLE_IMAGE:-"willhallonline/ansible:2.15-alpine-3.18"}

# Default Service Names
SPIN_DEFAULT_PHP_SERVICE_NAME=${SPIN_DEFAULT_PHP_RUN_SERVICE:-"php"}
SPIN_ANSIBLE_IMAGE=${SPIN_ANSIBLE_IMAGE:-"willhallonline/ansible:2.16-alpine-3.19"}
SPIN_ANSIBLE_COLLECTION_NAME=${SPIN_ANSIBLE_COLLECTION_NAME:-"serversideup.spin"}

# Script Configuration
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
Expand All @@ -32,7 +32,7 @@ source "$SPIN_HOME/lib/functions.sh"
setup_color

# Check for upgrades, except for development installs and on `spin update`
if [[ $(detect_installation_type) != "development" && "$1" != "update" ]]; then
if [[ "$(installation_type)" != "development" && "$1" != "update" ]]; then
check_for_upgrade
fi

Expand All @@ -44,7 +44,7 @@ case "$1" in
"" | base64 | debug | help | update | version | --version | -v)
: # Silent output for the user, but we're skipping the compose check too.
;;
init | kill | new | prune | provision | vault)
init | kill | mkpasswd | new | prune | provision | vault)
check_if_docker_is_running
;;
*)
Expand All @@ -71,6 +71,10 @@ if [ $# -gt 0 ]; then
source "$SPIN_HOME/lib/actions/debug.sh"
action_debug "$@"
;;
deploy)
source "$SPIN_HOME/lib/actions/deploy.sh"
action_deploy "$@"
;;
down)
source "$SPIN_HOME/lib/actions/down.sh"
action_down "$@"
Expand Down Expand Up @@ -99,8 +103,13 @@ if [ $# -gt 0 ]; then
source "$SPIN_HOME/lib/actions/logs.sh"
action_logs "$@"
;;
mkpasswd)
source "$SPIN_HOME/lib/actions/mkpasswd.sh"
action_mkpasswd "$@"
;;
new)
source "$SPIN_HOME/lib/actions/new.sh"
source "$SPIN_HOME/lib/actions/init.sh"
action_new "$@"
;;
provision)
Expand All @@ -111,6 +120,10 @@ if [ $# -gt 0 ]; then
source "$SPIN_HOME/lib/actions/prune.sh"
action_prune "$@"
;;
ps)
source "$SPIN_HOME/lib/actions/ps.sh"
action_ps
;;
pull)
source "$SPIN_HOME/lib/actions/pull.sh"
action_pull "$@"
Expand Down Expand Up @@ -140,7 +153,7 @@ if [ $# -gt 0 ]; then
action_version
;;
*)
echo "\"$1\" is not a valid command. Below are the commands available."
echo "\"$spin_action\" is not a valid command. Below are the commands available."
source "$SPIN_HOME/lib/actions/help.sh"
action_help
;;
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/Column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script setup>
const props = defineProps({
sticky: {
defualt: false
default: false
}
})
</script>
2 changes: 1 addition & 1 deletion docs/components/content/FeatureGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

<span class="my-2 font-inter text-lg font-bold text-slate-50">GitHub Action Support</span>

<span class="font-inter text-base text-slate-300 font-normal">Spin provides templates to automate the delivery of your application through CI/CD.</span>
<span class="font-inter text-base text-slate-300 font-normal">We provide open source GitHub Actions to help you ship automatically and easily.</span>
</div>

<div class="flex flex-col bg-[#151A1F] p-4 rounded-lg">
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/MarketingGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

<span class="my-2 font-inter text-lg font-bold text-slate-50">GitHub Action Support</span>

<span class="font-inter text-base text-slate-300 font-normal">Spin provides templates to automate the delivery of your application through CI/CD.</span>
<span class="font-inter text-base text-slate-300 font-normal">We provide open source GitHub Actions to help you ship automatically and easily.</span>
</div>

<div class="flex flex-col bg-[#151A1F] p-4 rounded-lg">
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/MarketingHero.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="mx-auto max-w-[940px] flex flex-col px-6 pt-36 lg:pt-48">
<h1 class="font-inter text-[32px] leading-[32px] text-white font-bold lg:text-center lg:text-[60px] lg:leading-[64px]">
Zero-downtime deployments, 100% replication, <span class="text-[#1CE783]">without breaking the bank</span>.
Docker Simplified. Deploy Anywhere. Zero Downtime. Any OS.
</h1>

<p class="text-slate-300 font-inter text-xl mt-4 lg:text-2xl lg:mt-8 lg:text-center">Save thousands. Break free from vendor lock. Replicate your app from development to production. All open source on GitHub.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content/MarketingServers.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="mx-auto max-w-[940px] flex flex-col mt-8 md:mt-16">
<h2 class="w-full text-center font-inter text-white text-3xl md:text-5xl font-bold max-w-xl mx-auto">💪 Manage servers right from your project</h2>
<p class="w-full text-center mt-6 text-slate-300 font-inter text-xl md:text-2xl">Control and own your infrastructure without the headache.</p>
<p class="w-full text-center mt-6 text-slate-300 font-inter text-xl md:text-2xl">Control and own your infrastructure without headaches.</p>

<div class="px-4">
<div class="rounded-[10px] mx-auto max-w-[940px] my-8 md:my-16 overflow-hidden">
Expand Down
92 changes: 0 additions & 92 deletions docs/content/docs/1.getting-started/2.prerequisites.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/content/docs/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ layout: docs
</p>

::lead-p
Spin is one of the fastest ways to create a new project, configure a development environment, and ship your app into production -- all being **100% replicated** throughout each environment. Think of Spin as **Laravel Sail, but you can ship your configuration to production**.
Spin is one of the fastest ways to create a new project and ship to any host of your choice -- all running **100% the exact same configuration across all environments**. Think of Spin as **Laravel Sail, but you can ship your configuration to production**.
::

Choose any host, easily provision and maintain your servers, and ship your application with confidence.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: 'Learn how to install Spin on Linux.'
layout: docs
---

## Pre-requisites
## Prerequisites
You must have a working installation of Docker.

::note
Expand Down
59 changes: 59 additions & 0 deletions docs/content/docs/2.project-templates/1.laravel-basic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
head.title: 'Laravel Basic - Spin by Server Side Up'
title: 'Laravel Basic'
description: 'Learn about the official Laravel template provided by the Spin community.'
layout: docs
---
# Laravel Basic
::lead-p
The Spin community maintains an official Laravel template that you can use to get up and running with Laravel quickly. This template is designed to get you up and running with the latest stable version of Laravel with the default configurations running SQLite.
::

::responsive-image
---
src: ./images/docs/community-templates/spin-official-laravel-template.png
alt: 'Official Laravel Template by Spin'
maxWidth: 500
---
::

## Project Information
Here's information where you can learn more about the project:

| Property | Value |
|-------------------------|-------------------------|
| Title | Laravel Basic Template |
| Description | A basic installation of Laravel with SQLite. |
| Authors | [Jay Rogers (@jaydrogers)](https://x.com/jaydrogers), [Dan Pastori (@danpastori)](https://x.com/danpastori) |
| License | [GNU GPL v3.0](https://github.com/serversideup/spin-template-laravel-basic/blob/main/LICENSE) |
| Repository URL | https://github.com/serversideup/spin-template-laravel-basic |
| Issues Tracker URL | https://github.com/serversideup/spin-template-laravel-basic/issues |

## Creating a new Laravel project
::code-panel
---
label: Create a new Laravel project
---
```bash
spin new laravel <project-name>
```
::

Run the command above to create a new Laravel project with Spin. By default, the new project will be created in the current directory as `./laravel`. You can specify a different project name by replacing `<project-name>` with your desired name.



## Adding to an existing Laravel Project
::code-panel
---
label: Add to an existing Laravel project
---
```bash
spin init laravel
```
::

## Further Configuration
There are more steps for you to complete after creating a project or adding Spin to your existing project. All of this information can be found in the project's README file.

[View the project README →](https://github.com/serversideup/spin-template-laravel-basic)
Loading

0 comments on commit 3581421

Please sign in to comment.