projects / org / contextualcode / platform_cc
Find the Exponential Software extensions you want
| UNIX name | Owner | Status |
|---|---|---|
| platform_cc | Contextual Code | stable |
| Version | Compatible with |
|---|---|
| N/A | N/A |
By Nathan Ogden / Contextual Code
Run the following in a Bash shell...
curl -L -s https://platform.cc/releases/install.sh | bash /dev/stdin
After that use the pcc command to run Platform.CC.
You can also install the latest development build with...
curl -L -s https://platform.cc/releases/install.sh | bash /dev/stdin -d
If you wish to copy an environment from Platform.sh you can use the platformsh:sync command. To use this command you must first obtain a Platform.sh API token. You can do this by using the platformsh:login command.
Steps...
1) Run pcc platformsh:login and follow the instructions.
2) From the project root directory run pcc platformsh:sync. This will take some time.
This command will sync the following...
On first sync Platform.CC will generate a new SSH key, it can take some time for Platform.sh to accept the new key.
This assumes that you have a project ready to go with all the appropiate configuration files (.platform.app.yaml, etc). Before running any pcc commands you should make sure that you are in the project's root directory.
1) (Optional) Set project environment variables.
Often times environment variables are used to expose secure credientials to a project.
You can use the `var:set` command to set environment variables.
In order to specifically set an environment variable the variable name must be prefixed with `env:`.
Example...
```
$ pcc var:set env:ACCESS_TOKEN secret_token_here
```
A common use case might be to set the 'COMPOSER_AUTH' environment variable so that Composer can run
without user interaction being required.
Composer auth example...
```
$ pcc var:set 'env:COMPOSER_AUTH' "$(cat ~/.composer/auth.json | tr -d '\n\r ')"
```
2) Start in the root directory of the project.
```
$ pcc project:start
```
This will pull all the needed Docker images and run the build commands for your application(s).
3) (Optional) Install database dumps.
All databases will work but Platform.CC currently only has commands to interact with MySQL/MariaDB. For all other database types you will need to user `docker exec` to access them.
For MySQL databases you can use the `pcc mysql:sql` command to execute queries.
STDIN example...
```
$ pcc mysql:sql -d main < dump.sql
```
Platform.sh CLI example...
```
$ platform db:dump -emaster -fdb_dump.sql
$ pcc mysql:sql -d main < db_dump.sql
```
4) Run deploy hooks.
Deploy hooks are not ran automatically. You can run your project's deploy hooks with the following command...
```
$ pcc project:deploy
```
This runs the deploy hooks defined in .platform.app.yaml.
5) Open in web browser.
Visit http://localhost in your browser for a list of routes.
Platform.CC should support all languages that are supported by Platform.sh. Please see https://docs.platform.sh/ for a list of languages.
Platform.CC should support all services that are supported by Platform.sh. Please see https://docs.platform.sh/ for a list of services.
The main router generates a certficate CA that you can have your browser trust to get valid SSL certificates. To get the CA certificate you can run...
pcc router:certificates:dump
You can set various flags, options, and project variables through the command line. Doing so will set the value for the current project. If you use the --global (-g) option then the value will be set globally for all projects.
pcc project:flag:set # set flag
pcc project:flag:set --unset # unset flag
pcc project:flag:set --off # turn flag off (override global)
pcc project:flag:set -g # set global flag
pcc project:flag:set -g --unset # unset global flag
pcc project:flag:list # list all flags
pcc project:option:set # set option
pcc project:option:set -g # set global option
pcc project:option:reset # unset option
pcc project:option:list # list all options
pcc variable:set # set a project variable
pcc variable:set -g # set a global project variable
pcc variable:get # get a project variable
pcc variable:delete # delete a project variable
pcc variable:delete -g # delete a global project variable
pcc variable:list # list all project variables
Flags enables or disable functionality. Some functionality is disabled by default (such as workers and cron jobs) and can be re-enabled with flags.
Enable cron jobs for the current project.
Enable routes to services such as Varnish.
Enables workers.
Enables PHP Opcache.
Enables NFS mounts on OSX.
Disables Platform.CC specific YAML overrides (.platform.app.pcc.yaml and services.pcc.yaml).
Disables the auto commit of application containers when a project is started.
Options are like flags except that they are specific values and not just on or off.
Set the internal route domain, default is "pcc.localtest.me." Every route gets an internal route... example... www.example.com becomes www-example-com.pcc.localtest.me.
Set the strategy for how Platform.CC will deal with mounts.
Platform.cc generates its own SSH keypair on first load. This is used inside application containers and to perform syncs with Platform.sh.
You can find the Platform.cc generated key in...
~/.config/platformcc/pcc_ssh_private
~/.config/platformcc/pcc_ssh_public
If you find that you need some configurations that are specific only to your Platform.CC projects, you can put those in a file called .platform.app.pcc.yaml. This should be in the same format as your .platform.app.yaml file.
When you start a project you can specify a 'save slot' to use with the 'slot' or 's' option. This lets you start the project with different storage locations for the services in your project. An example use case is loading a different MySQL database without losing the original. The slot value must be an integer.
Examples...
pcc project:start -s 1
pcc project:start --slot 2
pcc project:slot:delete 2
pcc project:slot:copy 1 2
By default Platform.CC makes a commit of the application containers once the build hooks are completed. This saves time as the build hooks won't have to be ran on every start up. However, it does appear to cause some issues in a few cases. We have included ways to bypass this functionality both with the 'disable_auto_commit' flag and with the --no-commit option on the project:start command.
You can force a re-build and re-commit when you run project:start or project:restart with the --rebuild flag.
You can update Platform.cc to the latest version with the update command.
The sharelog command will upload the log for the current project and provide a URL to share it. This is useful for reporting bugs to a Platform.cc developer.