Skip to content

Commit

Permalink
Merge pull request spryker#13 from spryker/master
Browse files Browse the repository at this point in the history
spryker master to elmerdigital master
  • Loading branch information
kj187 committed Nov 23, 2022
2 parents 0fe8878 + f6dc37f commit a4a871d
Show file tree
Hide file tree
Showing 28 changed files with 387 additions and 117 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Spryker Docker SDK helps to set up a Docker environment for your Spryker project
This repository does not contain a specific Dockerfile or Docker Compose files. It contains a tool that prepares those files to match the infrastructure of your Spryker project.


Spryker Docker SDK reads a [Deploy file](docs/99-deploy-file-reference.v1.md) and builds a production-like Docker infrastructure for Spryker accordingly.
Spryker Docker SDK reads a [Deploy file](docs/07-deploy-file/02-deploy.file.reference.v1.md) and builds a production-like Docker infrastructure for Spryker accordingly.

The tool is used for:

Expand Down
1 change: 1 addition & 0 deletions bin/command/install/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function Command::bootstrap() {
userToRun=()
fi
docker run -i --rm "${userToRun[@]}" \
-e SPRYKER_PLATFORM_IMAGE="${SPRYKER_PLATFORM_IMAGE:-""}" \
-e SPRYKER_DOCKER_SDK_PLATFORM="${_PLATFORM}" \
-e SPRYKER_DOCKER_SDK_DEPLOYMENT_DIR="${DESTINATION_DIR}" \
-e VERBOSE="${VERBOSE}" \
Expand Down
9 changes: 9 additions & 0 deletions bin/sdk/images/baked/ecr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ function Images::tagApplications() {
for application in "${SPRYKER_APPLICATIONS[@]}"; do
local application="$(echo "$application" | tr '[:upper:]' '[:lower:]')"
docker tag "${SPRYKER_DOCKER_PREFIX}_app:${SPRYKER_DOCKER_TAG}" "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-${application}:${tag}"
docker tag "${SPRYKER_DOCKER_PREFIX}_app:${SPRYKER_DOCKER_TAG}" "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-${application}:latest"
done

docker tag "${SPRYKER_DOCKER_PREFIX}_jenkins:${SPRYKER_DOCKER_TAG}" "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-jenkins:${tag}"
docker tag "${SPRYKER_DOCKER_PREFIX}_jenkins:${SPRYKER_DOCKER_TAG}" "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-jenkins:latest"
docker tag "${SPRYKER_DOCKER_PREFIX}_pipeline:${SPRYKER_DOCKER_TAG}" "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-pipeline:${tag}"
docker tag "${SPRYKER_DOCKER_PREFIX}_pipeline:${SPRYKER_DOCKER_TAG}" "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-pipeline:latest"
}

function Images::tagFrontend() {
Expand All @@ -34,6 +37,8 @@ function Images::tagFrontend() {
local tag=${1:-${SPRYKER_DOCKER_TAG}}

docker tag "${SPRYKER_DOCKER_PREFIX}_frontend:${SPRYKER_DOCKER_TAG}" "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-frontend:${tag}"
docker tag "${SPRYKER_DOCKER_PREFIX}_frontend:${SPRYKER_DOCKER_TAG}" "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-frontend:latest"

}

function Images::push() {
Expand All @@ -45,11 +50,15 @@ function Images::push() {
local application="$(echo "$application" | tr '[:upper:]' '[:lower:]')"
echo "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-${application}:${tag}"
docker push "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-${application}:${tag}"
docker push "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-${application}:latest"
done
echo "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-frontend:${tag}"
docker push "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-frontend:${tag}"
docker push "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-frontend:latest"
echo "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-jenkins:${tag}"
docker push "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-jenkins:${tag}"
docker push "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-jenkins:latest"
echo "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-pipeline:${tag}"
docker push "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-pipeline:${tag}"
docker push "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${SPRYKER_PROJECT_NAME}-pipeline:latest"
}
2 changes: 1 addition & 1 deletion bin/service/database/postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Database::haveTables() {
EOF
)

[ "${tableCount}" -gt 0 ] && return "${TRUE}" || return "${FALSE}"
( [ ! -z "${tableCount}" ] && [ "${tableCount}" -gt 0 ]) && return "${TRUE}" || return "${FALSE}"
}

function Database::init() {
Expand Down
10 changes: 5 additions & 5 deletions context/dashboard/views/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ html
body
div(class="console")
div(class="logo")
|┌──── ┌─┐ ────┬─────┬─┐
|│ ───┼───┬─┬─┬─┬─┤ ├─┬───┬─┬─┐ │ ───┼─┐ ┐│ ┌─┘
|├─── │ ┼ │ ┌─┤ │ │───┤ ┼─┤ ┌─├─── ├─┴─┘│ └─┐
|└────┤ ┌┴─┘ ├─┐ ├─┴─┴───┴─┘ └────┴────┴─┴─┘
| └──┘ └───┘
|┌──── ┌─┐ ────┬─────┬─┐
|│ ╮ │───┬───┤ ├─┬───┬─┬─┐ │ ───┤ ╮ │ ┌─┘
|│ ╯ │ ┼ │ ├─┤───┤ ┼─┤ ┌─├─── │ ╯ │ └─┐
|└────┴───┴───┴─┴─┴───┴─┘ └────┴────┴─┴─┘
|
|╭─<span class="prompt">/dashboard</span> | Project: #{project}
|╰─$ dashboard help
|
Expand Down
6 changes: 3 additions & 3 deletions docs/01-quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ To run the Docker SDK in a local environment, follow the instructions below.

For Docker installation instructions, see one of the following:
* [Installing Docker prerequisites on MacOS](06-installation/01-installation-prerequisites/01-installing-docker-prerequisites-on-macos.md)
* [Installing Docker prerequisites on Linux](06-installation/01-installation-prerequisites/01-installing-docker-prerequisites-on-linux.md)
* [Installing Docker prerequisites on Windows](06-installation/01-installation-prerequisites/01-installing-docker-prerequisites-on-windows.md)
* [Installing Docker prerequisites on Linux](06-installation/01-installation-prerequisites/02-installing-docker-prerequisites-on-linux.md)
* [Installing Docker prerequisites on Windows](06-installation/01-installation-prerequisites/03-installing-docker-prerequisites-on-windows.md)

### Setting up a project with the Docker SDK

Expand Down Expand Up @@ -87,6 +87,6 @@ For solutions to common issues, see [Troubleshooting](09-troubleshooting.md).

## What documents should I use to start developing and configuring my project?
<!--- [02-development-usage] --->
[Deploy file reference — 1.0](07-deploy-file/02-deploy-file-reference.v1.md)
[Deploy file reference — 1.0](07-deploy-file/02-deploy.file.reference.v1.md)
[Configuration reference](10-configuration-reference.md)
[Configuring servces](06-configuring-services.md)
2 changes: 0 additions & 2 deletions docs/02-development/01-choosing-a-mount-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ To configure a mount mode, see [Configuring a mount mode](07-configuring-a-mount

Synchronization mount modes, such as mutagen or docker-sync, use algorithms to synchronize your code between host machine and a docker volume. This allows you to run applications at full speed avoiding file system mount latency.

![](../images/mutagen-diagram.png)

- Mutagen daemon listens to the host file system changes.
- Mutagen sidecar container listens to the VM file system changes.
- The daemon and the sidecar interact and update files on each side.
Expand Down
2 changes: 1 addition & 1 deletion docs/02-development/06-running-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ services:
engine: chromedriver
```

See [webdriver:](99-deploy.file.reference.v1.md#webdriver-) to learn more about webdriver configuration in the deploy file.
See [webdriver:](../07-deploy-file/02-deploy.file.reference.v1.md#webdriver-) to learn more about webdriver configuration in the deploy file.

## Configure Codeception

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Follow the steps to install and configure the required software:

5. [Development mode](../02-installation-guides/01-choosing-an-installation-mode.md#development-mode): Install Mutagen:
```shell
brew install mutagen-io/mutagen/mutagen-beta
brew list | grep mutagen | xargs brew remove && brew install mutagen-io/mutagen/mutagen mutagen-io/mutagen/mutagen-compose && mutagen daemon stop && mutagen daemon start
```

## Next steps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Review the minimum system requirements in the table:

## Installing and configuring required software
Follow the steps to install and configure the required software:
1. Download and install [Docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/) for Linux.
1. Download and install [Docker](https://docs.docker.com/engine/install/ubuntu/#installation-methods) for Linux.
@(Info)()(Signup for Docker Hub is not required.)

2. Enable BuildKit by creating or updating `/etc/docker/daemon.json`:
Expand All @@ -30,17 +30,20 @@ Follow the steps to install and configure the required software:
```
3. Restart Docker:
```shell
/etc/init.d/docker restart
sudo service docker start
```
4. Optional: Configure the `docker` group to manage Docker as a non-root user. See [Manage Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) for configuration instructions.

5. Install Docker-compose:
```shell
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
```
6. Apply executable permissions to the binary:
6. Check Docker-compose version:
```shell
sudo chmod +x /usr/local/bin/docker-compose
docker compose version
```

You've installed and configured the required software.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,14 @@ sudo apt-get install docker-ce docker-ce-cli containerd.io
Install Docker Compose:
1. Download the current stable release of Docker Compose:
```bash
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
```
2. Apply executable permissions to the binary:
2. Check Docker-compose version:
```bash
sudo chmod +x /usr/local/bin/docker-compose
docker compose version
```

### Install docker-sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document describes how to install Spryker in [Development Mode](01-choosing

To install Docker prerequisites, follow one of the guides:
* [Installing Docker prerequisites on MacOS](../01-installation-prerequisites/01-installing-docker-prerequisites-on-macos.md)
* [Installing Docker prerequisites on Linux](../01-installation-prerequisites/01-installing-docker-prerequisites-on-linux.md)
* [Installing Docker prerequisites on Linux](../01-installation-prerequisites/02-installing-docker-prerequisites-on-linux.md)



Expand Down Expand Up @@ -47,7 +47,7 @@ Make sure that you are in the correct folder by running the `pwd` command.
5. In `deploy.dev.yml`, define `image:` with the PHP image compatible with the current release of the Demo Shop:

```yaml
image: spryker/php:7.3-alpine3.12
image: spryker/php:7.4-alpine3.16
```

6. Clone the Docker SDK repository:
Expand All @@ -56,16 +56,16 @@ git clone https://github.com/spryker/docker-sdk.git --single-branch docker
```

:::(Warning) (Verification)
Make sure `docker 18.09.1+` and `docker-compose 1.23+` are installed:
Make sure `docker 18.09.1+` and `docker compose 2+` are installed:

```bash
$ docker version
$ docker-compose --version
$ docker compose version
```
:::

7. Bootstrap local docker setup:

```bash
docker/sdk bootstrap deploy.dev.yml
```
Expand All @@ -80,7 +80,7 @@ To double-check if there are any instructions, run `docker/sdk install`.
:::

9. Build and start the instance:

```bash
docker/sdk up
```
Expand All @@ -89,10 +89,10 @@ docker/sdk up

## Endpoints

To ensure that the installation is successful, make sure you can access the configured endpoints from the Deploy file. See [Deploy file reference - 1.0](../../99-deploy.file.reference.v1.md) to learn about the Deploy file.
To ensure that the installation is successful, make sure you can access the configured endpoints from the Deploy file. See [Deploy file reference - 1.0](../../07-deploy-file/02-deploy.file.reference.v1.md) to learn about the Deploy file.

:::(Info) (RabbitMQ UI credentials)
To access RabbitMQ UI, use `spryker` as a username and `secret` as a password. You can adjust the credentials in `deploy.yml`.
To access RabbitMQ UI, use `spryker` as a username and `secret` as a password. You can adjust the credentials in `deploy.yml`.
:::

## Getting the list of useful commands
Expand All @@ -101,9 +101,9 @@ To get the full and up-to-date list of commands, run `docker/sdk help`.

## Next steps

* [Troubleshooting](../../troubleshooting.md)
* [Configuring debugging](../../02-development-usage/05-configuring-debugging.md)
* [Deploy file reference - 1.0](../../99-deploy.file.reference.v1.md)
* [Troubleshooting](../../09-troubleshooting.md)
* [Configuring debugging](../../02-development/05-configuring-debugging.md)
* [Deploy file reference - 1.0](../../07-deploy-file/02-deploy.file.reference.v1.md)
* [Configuring services](../../06-configuring-services.md)
* [Setting up a self-signed SSL certificate](https://documentation.spryker.com/docs/setting-up-a-self-signed-ssl-certificate)
* [Additional DevOPS guidelines](https://documentation.spryker.com/docs/additional-devops-guidelines)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This document describes how to install Spryker in [Development Mode](01-choosing

## Installing Docker prerequisites on Windows

To install Docker prerequisites for Windows, follow [Installing Docker prerequisites on Windows](../01-installation-prerequisites/01-installing-docker-prerequisites-on-windows.md).
To install Docker prerequisites for Windows, follow [Installing Docker prerequisites on Windows](../01-installation-prerequisites/03-installing-docker-prerequisites-on-windows.md).



Expand Down Expand Up @@ -46,7 +46,7 @@ Make sure that you are in the correct folder by running the `pwd` command.
6. In `deploy.dev.yml`, define `image:` with the PHP image compatible with the current release of the Demo Shop:

```yaml
image: spryker/php:7.3-alpine3.12
image: spryker/php:7.4-alpine3.16
```

7. Clone the Docker SDK repository:
Expand All @@ -55,11 +55,11 @@ git clone https://github.com/spryker/docker-sdk.git --single-branch docker
```

:::(Warning) (Verification)
Make sure `docker 18.09.1+` and `docker-compose 1.23+` are installed:
Make sure `docker 18.09.1+` and `docker compose 2+` are installed:

```bash
$ docker version
$ docker-compose --version
$ docker compose version
```
:::

Expand Down Expand Up @@ -114,7 +114,7 @@ Depending on the hardware performance, the first project launch can take up to 2

## Endpoints

To ensure that the installation is successful, make sure you can access the configured endpoints from the Deploy file. See [Deploy file reference - 1.0](../../99-deploy.file.reference.v1.md) to learn about the Deploy file.
To ensure that the installation is successful, make sure you can access the configured endpoints from the Deploy file. See [Deploy file reference - 1.0](../../07-deploy-file/02-deploy.file.reference.v1.md) to learn about the Deploy file.

:::(Info) (RabbitMQ UI credentials)
To access RabbitMQ UI, use `spryker` as a username and `secret` as a password. You can adjust the credentials in `deploy.yml`.
Expand All @@ -126,9 +126,9 @@ To get the full and up-to-date list of commands, run `docker/sdk help`.

## Next steps

* [Troubleshooting](../../troubleshooting.md)
* [Configuring debugging](../../02-development-usage/05-configuring-debugging.md)
* [Deploy file reference - 1.0](../../99-deploy.file.reference.v1.md)
* [Troubleshooting](../../09-troubleshooting.md)
* [Configuring debugging](../../02-development/05-configuring-debugging.md)
* [Deploy file reference - 1.0](../../07-deploy-file/02-deploy.file.reference.v1.md)
* [Configuring services](../../06-configuring-services.md)
* [Setting up a self-signed SSL certificate](https://documentation.spryker.com/docs/setting-up-a-self-signed-ssl-certificate)
* [Additional DevOPS guidelines](https://documentation.spryker.com/docs/additional-devops-guidelines)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This document describes the procedure of installing Spryker in [Demo Mode](01-ch
To install Docker prerequisites, follow one of the guides:

* [Installing Docker prerequisites on MacOS](../01-installation-prerequisites/01-installing-docker-prerequisites-on-macos.md)
* [Installing Docker prerequisites on Linux](../01-installation-prerequisites/01-installing-docker-prerequisites-on-linux.md)
* [Installing Docker prerequisites on Linux](../01-installation-prerequisites/02-installing-docker-prerequisites-on-linux.md)


## Installing Spryker in Demo mode on MacOS and Linux
Expand Down Expand Up @@ -49,11 +49,11 @@ Make sure that you are in the correct folder by running the `pwd` command.
git clone git@github.com:spryker/docker-sdk.git --single-branch docker
```
:::(Warning) (Verification)
Make sure `docker 18.09.1+` and `docker-compose 1.23+` are installed:
Make sure `docker 18.09.1+` and `docker compose 2+` are installed:

```bash
$ docker version
$ docker-compose --version
$ docker compose version
```
:::

Expand All @@ -78,7 +78,7 @@ You can run `docker/sdk install` after `bootstrap` to get the list of the instru
:::

8. Once the job finishes, build and start the instance:

```shell
docker/sdk up
```
Expand All @@ -89,7 +89,7 @@ Depending on the hardware performance, the first project launch can take up to 2

## Endpoints

To ensure that the installation is successful, make sure you can access the configured endpoints from the Deploy file. See [Deploy file reference - 1.0](../../99-deploy.file.reference.v1.md) to learn about the Deploy file.
To ensure that the installation is successful, make sure you can access the configured endpoints from the Deploy file. See [Deploy file reference - 1.0](../../07-deploy-file/02-deploy.file.reference.v1.md) to learn about the Deploy file.

:::(Info) (RabbitMQ UI credentials)
To access RabbitMQ UI, use `spryker` as a username and `secret` as a password. You can adjust the credentials in `deploy.yml`.
Expand All @@ -103,8 +103,8 @@ To get the full and up-to-date list of commands, run `docker/sdk help`.
## Next steps

* [Troubleshooting](../../09-troubleshooting.md)
* [Configuring debugging](../../02-development-usage/05-configuring-debugging.md)
* [Deploy file reference - 1.0](../../99-deploy.file.reference.v1.md)
* [Configuring debugging](../../02-development/05-configuring-debugging.md)
* [Deploy file reference - 1.0](../../07-deploy-file/02-deploy.file.reference.v1.md)
* [Configuring services](../../06-configuring-services.md)
* [Setting up a self-signed SSL certificate](https://documentation.spryker.com/docs/setting-up-a-self-signed-ssl-certificate)
* [Additional DevOPS guidelines](https://documentation.spryker.com/docs/additional-devops-guidelines)
Loading

0 comments on commit a4a871d

Please sign in to comment.