Merge branch 'patricio-wip-11' into patricio-deploy-proxy

This commit is contained in:
Joao Patricio 2023-05-03 08:12:19 +01:00
commit 48762724eb
5 changed files with 20 additions and 12 deletions

View File

@ -57,7 +57,13 @@ public function deployment()
return redirect()->route('dashboard'); return redirect()->route('dashboard');
} }
$activity = Activity::where('properties->type_uuid', '=', $deployment_uuid)->first(); $activity = Activity::where('properties->type_uuid', '=', $deployment_uuid)->first();
if (!$activity) {
return redirect()->route('project.application.deployments', [
'project_uuid' => $project->uuid,
'environment_name' => $environment->name,
'application_uuid' => $application->uuid,
]);
}
return view('project.application.deployment', [ return view('project.application.deployment', [
'application' => $application, 'application' => $application,
'activity' => $activity, 'activity' => $activity,

View File

@ -38,7 +38,7 @@ class PublicGitRepository extends Component
]; ];
public function mount() public function mount()
{ {
if (env('APP_ENV') === 'local') { if (config('app.env') === 'local') {
$this->public_repository_url = 'https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify'; $this->public_repository_url = 'https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify';
$this->port = 3000; $this->port = 3000;
} }

View File

@ -17,20 +17,15 @@ WORKDIR /artifacts
RUN apk add --no-cache bash curl git git-lfs openssh-client tar tini RUN apk add --no-cache bash curl git git-lfs openssh-client tar tini
RUN mkdir -p ~/.docker/cli-plugins RUN mkdir -p ~/.docker/cli-plugins
RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]]; then \ RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]]; then \
curl -SL https://github.com/docker/buildx/releases/download/v${DOCKER_BUILDX_VERSION}/buildx-v${DOCKER_BUILDX_VERSION}.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx && \ curl -sSL https://github.com/docker/buildx/releases/download/v${DOCKER_BUILDX_VERSION}/buildx-v${DOCKER_BUILDX_VERSION}.linux-amd64 -o ~/.docker/cli-plugins/docker-buildx && \
curl -SL https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose && \ curl -sSL https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose && \
(curl -sSL https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz | tar -C /usr/bin/ --no-same-owner -xzv --strip-components=1 docker/docker) && \ (curl -sSL https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz | tar -C /usr/bin/ --no-same-owner -xzv --strip-components=1 docker/docker) && \
(curl -sSL https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz | tar -C /usr/local/bin/ --no-same-owner -xzv pack) && \ (curl -sSL https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz | tar -C /usr/local/bin/ --no-same-owner -xzv pack) && \
curl -sSL https://nixpacks.com/install.sh | bash && \ curl -sSL https://nixpacks.com/install.sh | bash && \
chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack /root/.docker/cli-plugins/docker-buildx \ chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack /root/.docker/cli-plugins/docker-buildx \
;fi ;fi
RUN RUN
# RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-$DOCKER_VERSION -o /usr/bin/docker
# RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-$DOCKER_COMPOSE_VERSION -o ~/.docker/cli-plugins/docker-compose
# RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/pack-$PACK_VERSION -o /usr/local/bin/pack
# RUN curl -sSL https://nixpacks.com/install.sh | bash
# RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker /usr/local/bin/pack
ENTRYPOINT ["/sbin/tini", "--"] ENTRYPOINT ["/sbin/tini", "--"]
CMD ["sh", "-c", "while true; do sleep 3600; done"] CMD ["sh", "-c", "while true; do sleep 3600 && exit 0; done"]

View File

@ -1,2 +1,9 @@
#!/command/execlineb -P #!/command/execlineb -P
VERSION=$(php bootstrap/getVersion.php)
if echo "$VERSION" | grep -q "nightly"; then
php /var/www/html/artisan migrate:fresh --force
php /var/www/html/artisan db:seed --class ProductionSeeder --force
else
php /var/www/html/artisan migrate --force --isolated php /var/www/html/artisan migrate --force --isolated
fi

View File

@ -18,7 +18,7 @@
@if (data_get($application, 'ports_mappings_array')) @if (data_get($application, 'ports_mappings_array'))
@foreach ($application->ports_mappings_array as $port) @foreach ($application->ports_mappings_array as $port)
@if (env('APP_ENV') === 'local') @if (config('app.env') === 'local')
<a target="_blank" href="http://localhost:{{ explode(':', $port)[0] }}">Open <a target="_blank" href="http://localhost:{{ explode(':', $port)[0] }}">Open
{{ explode(':', $port)[0] }}</a> {{ explode(':', $port)[0] }}</a>
@else @else