Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitacf2864

Browse files
Simplifying example
1 parent2c7be74 commitacf2864

File tree

6 files changed

+107
-124
lines changed

6 files changed

+107
-124
lines changed

‎_data/nav.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@
209209
sub-pages:
210210
-title:Deploy to VM
211211
url:"/packer-gcloud"
212+
-title:Deploy to a VM using ftp
213+
url:"/transferring-php-ftp"
212214
-title:Deploy with Helm
213215
url:"/helm"
214216
-title:Deploy with Terraform
@@ -256,8 +258,6 @@
256258
url:"/spring-boot-kafka-zookeeper"
257259
-title:Web terminal
258260
url:"/web-terminal"
259-
-title:Transferring an Application via scp/ftp
260-
url:"/transferring-php-ftp-scp"
261261

262262
-title:"Artifacts Management"
263263
url:"/docker-registries"

‎_docs/whats-new/whats-new.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Recent Codefresh updates:
2222
- Both Helm 2 and Helm 3 clusters can be used at the same time
2323
- Installing the Codefresh runner behind proxy -[documentation]({{site.baseurl}}/docs/enterprise/codefresh-runner/#installing-behind-a-proxy)
2424
- Using Vault secrets in the Pipeline -[documentation]({{site.baseurl}}/docs/yaml-examples/examples/vault-secrets-in-the-pipeline/)
25-
-Transferring an Application via ftp/scp-[documentation]({{site.baseurl}}/docs/yaml-examples/examples/transferring-php-ftp-scp/)
25+
-Deploy to a VM using FTP-[documentation]({{site.baseurl}}/docs/yaml-examples/examples/transferring-php-ftp)
2626

2727
###February 2020
2828

‎_docs/yaml-examples/examples.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Codefresh can automatically launch environments (powered by Docker swarm) to [pr
8383
Codefresh can deploy to any platform such as VMs, FTP/SSH/S3 sites, app servers but of course it has great support for[Kubernetes clusters]({{site.baseurl}}/docs/deploy-to-kubernetes/deployment-options-to-kubernetes/) and[Helm releases]({{site.baseurl}}/docs/new-helm/helm-releases-management/):
8484

8585
-[Deploy to a VM with packer]({{site.baseurl}}/docs/yaml-examples/examples/packer-gcloud/)
86+
-[Deploy to a VM with FTP]({{site.baseurl}}/docs/yaml-examples/examples/transferring-php-ftp)
8687
-[Deploy Demochat to a Kubernetes cluster]({{site.baseurl}}/docs/deploy-to-kubernetes/codefresh-kubernetes-integration-demochat-example/)
8788
-[Use kubectl as part of Freestyle step]({{site.baseurl}}/docs/yaml-examples/examples/use-kubectl-as-part-of-freestyle-step)
8889
-[Deploy with Helm]({{site.baseurl}}/docs/yaml-examples/examples/helm)

‎_docs/yaml-examples/examples/transferring-php-ftp-scp.md‎

Lines changed: 0 additions & 121 deletions
This file was deleted.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title:"Transferring Applications via FTP"
3+
description:"Deploying a Php Application to a VM using FTP"
4+
group:yaml-examples
5+
sub_group:examples
6+
toc:true
7+
---
8+
9+
##Prerequisites
10+
11+
- A[free Codefresh account](https://codefresh.io/docs/docs/getting-started/create-a-codefresh-account/)
12+
- A remote machine with an ftp server and ssh setup (ensure that your ftp directory, I.e.,`/srv/ftp/pub` has the proper write permissions for the ftp user)
13+
14+
>Note that as you may already know, FTP is extremely insecure as it relies on plain-text passwords and usernames, making data very vulnerable to sniffing. A more secure solution would be to use SFTP or SCP.
15+
16+
##The Example Php Project
17+
18+
The example project can be found on[Github](https://github.com/anna-codefresh/php-composer-sample-app). The application is a simple Php application that displays an example timer.
19+
20+
{% include image.html
21+
lightbox="true"
22+
file="/images/learn-by-example/php/test-environment.png"
23+
url="/images/learn-by-example/php/test-environment.png"
24+
alt="Example Php Application"
25+
caption="Example Php Application"
26+
max-width="90%"
27+
%}
28+
29+
##Create the Pipeline
30+
31+
Our pipeline will contain four stages:
32+
33+
- A stage for cloning
34+
- A stage for packaging
35+
- A stage for transferring files
36+
37+
{% include image.html
38+
lightbox="true"
39+
file="/images/examples/php-file-transfer/pipeline.png"
40+
url="/images/examples/php-file-transfer/pipeline.png"
41+
alt="Codefresh UI Pipeline View"
42+
caption="Codefresh UI Pipeline View"
43+
max-width="90%"
44+
%}
45+
46+
Here is the entire pipeline:
47+
48+
```yaml
49+
# More examples of Codefresh YAML can be found at
50+
# https://codefresh.io/docs/docs/yaml-examples/examples/
51+
52+
version:"1.0"
53+
# Stages can help you organize your steps in stages
54+
stages:
55+
-"clone"
56+
-"install"
57+
-"transfer"
58+
steps:
59+
clone:
60+
title:"Cloning main repository..."
61+
type:"git-clone"
62+
arguments:
63+
repo:"anna-codefresh/php-composer-sample-app"
64+
git:"github"
65+
stage:"clone"
66+
install_dependencies:
67+
title:"Collecting Php dependencies..."
68+
type:"freestyle"
69+
working_directory:"./php-composer-sample-app"
70+
arguments:
71+
image:"composer:1.9.3"
72+
commands:
73+
-"composer install --ignore-platform-reqs --no-interaction --no-plugins --no-scripts --prefer-dist"
74+
stage:"install"
75+
steps:
76+
ftp_transfer:
77+
title:"Transferring application to VM via ftp..."
78+
type:"freestyle"
79+
working_directory:"./php-composer-sample-app"
80+
arguments:
81+
image:"dockito/lftp-client:latest"
82+
environment:
83+
-USER=<USER>
84+
-PASSWORD=<PASSWORD>
85+
-HOST=<HOST>
86+
-PUB_FTP_DIR=<PATH/TO/DIR>
87+
commands:
88+
-lftp -u $USER,$PASSWORD -e "cd $PUB_FTP_DIR; mkdir php-composer-sample-app; cd php-composer-sample-app; mput "*.*"; bye" $HOST
89+
stage:"transfer"
90+
```
91+
This pipeline does the following:
92+
93+
1. A [git-clone]({{$site.baseurl}}/docs/codefresh-yaml/steps/git-clone/) step that clones the main repository
94+
2. A [freestyle step]($$site.baseurl}}/docs/codefresh-yaml/steps/freestyle/) that installs the necessary Php dependencies for our application
95+
3. A freestyle step that transfers our application via ftp
96+
97+
## What to Read Next
98+
99+
- [Codefresh YAML]({{site.baseurl}}/docs/codefresh-yaml/what-is-the-codefresh-yaml/)
100+
- [Git-clone Step]({{$site.baseurl}}/docs/codefresh-yaml/steps/git-clone/)
101+
- [Freestyle Step]($$site.baseurl}}/docs/codefresh-yaml/steps/freestyle/)
102+
103+
6.35 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp