Skip to content

Commit 0d7c82e

Browse files
committed
Merge branch 'master' into switching-to-typescript
2 parents ad341a3 + f491c39 commit 0d7c82e

File tree

3 files changed

+42
-36
lines changed

3 files changed

+42
-36
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ The build script contained in the **apify-docs/src** folder automatically upload
220220
### Local testing
221221

222222
1. Install Apiary gem `gem install apiaryio`
223-
2. After that, you can open the generated doc with the command: `apiary preview --path="./docs/api_v2/api-v2-reference.apib"`
223+
2. After that, you can open the generated doc with the command: `apiary preview --path="./content/docs/api_v2/api_v2_reference.apib"`
224224

225225
### Test
226226

content/docs/actors/development/source_code.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ paths:
1111

1212
# [](#source-code)Source code
1313

14-
The **Source type** setting determines the location of the source code for the actor. It can have one of the following values: [Single JavaScript file](#single-javascript-file), [Multiple source files](#multiple-source-files), [Git repository](#git-repository), [Zip file](#zip-file) or [GitHub Gist](#github-gist).
14+
The **Source type** setting determines the location of the source code for the actor. It can have one of the following values: [Multiple source files](#multiple-source-files), [Git repository](#git-repository), [Zip file](#zip-file) or [GitHub Gist](#github-gist).
1515

1616
## [](#multiple-source-files) Multiple source files
1717

1818
If the actor's source code requires the use of multiple files/directories, then it can be hosted on the Apify platform using this option. This is particularly useful when you need to add [**INPUT_SCHEMA.json**]({{@link actors/development/source_code.md#input-schema}}) or **README.md** to your actor, or if you want to create your actor in a language other than JavaScript.
1919

2020
The only required file for multifile is **Dockerfile**, and all other files depend on your Dockerfile settings. By default Apify's custom NodeJS Dockerfile is used, which requires a **main.js** file containing your source code and a **package.json** file containing package configurations for [NPM](https://www.npmjs.com/).
2121

22-
Unlike with the [single JavaScript file](#single-javascript-file) option, **package.json** is not automatically generated when you use multiple source files, so you need to configure it yourself.
23-
2422
See [Custom Dockerfile]({{@link actors/development/source_code.md#custom-dockerfile}}) and [base Docker images]({{@link actors/development/base_docker_images.md}}) for more information about creating your own Dockerfile and using Apify's prepared base images.
2523

2624
## [](#git-repository)Git repository
@@ -37,7 +35,7 @@ Note that you can easily set up an integration where the actor is automatically
3735

3836
### [](#private-repositories)Private repositories
3937

40-
If your source code is hosted in a private Git repository then you need to configure deployment key. Deployment key is different for each actor and might be used only once at Git hosting of your choice (Github, Bitbucket, Gitlab, etc.).
38+
If your source code is hosted in a private Git repository then you need to configure deployment key. Deployment key is different for each actor and might be used only once at Git hosting of your choice (GitHub, Bitbucket, GitLab, etc.).
4139

4240
To obtain the key click at the **deployment key** link under the **Git URL** text input and follow the instructions there.
4341

@@ -61,7 +59,7 @@ Similarly as with the [Git repository]({{@link actors/development/source_code.md
6159

6260
## [](#custom-dockerfile)Custom Dockerfile
6361

64-
Internally, Apify uses Docker to build and run actors. To control the build of the actor, you can create a custom **Dockerfile** in the root of the Git repository or Zip directory. Note that this option is not available for the [Single JavaScript file]({{@link actors/development/source_code.md#single-javascript-file}}) option. If the **Dockerfile** is missing, the system uses the following default:
62+
Internally, Apify uses Docker to build and run actors. To control the build of the actor, you can create a custom **Dockerfile** in the root of the Git repository or Zip directory. If the **Dockerfile** is missing, the system uses the following default:
6563

6664
```dockerfile
6765
FROM apify/actor-node-basic
@@ -135,6 +133,8 @@ console.log(process.env.SMTP_HOST);
135133

136134
The actor runtime sets additional environment variables for the actor process during the run. See [Environment variables]({{@link actors/development/environment_variables.md}}) for details.
137135

136+
The environment variables can also be used for the build process. In this case, the variables are treated as [Docker build arguments](https://docs.docker.com/engine/reference/builder/#arg). This means that they should not be used for secrets and, in order to access them in Dockerfile, you have to use the `ARG variable_name` instruction.
137+
138138
## [](#versioning)Versioning
139139

140140
In order to enable active development, the actor can have multiple versions of the source code and associated settings, such as the **Base image** and **Environment**. Each version is denoted by a version number of the form `MAJOR.MINOR`; the version numbers should adhere to the [Semantic Versioning](http://semver.org/) logic.

content/docs/api_v2/api_v2_reference.apib

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -562,13 +562,6 @@ The `sourceType` property indicates where the source code is hosted, and based
562562
on its value the Version object has the following additional property:
563563

564564
<table>
565-
<tr>
566-
<td><code>"SOURCE_CODE"</code></td>
567-
<td>
568-
Source code is a single JavaScript/Node.js file whose content is in the <code>sourceCode</code> field,
569-
and uses a base Docker image specified in <code>baseDockerImage</code>.
570-
</td>
571-
</tr>
572565
<tr>
573566
<td><code>"SOURCE_FILES"</code></td>
574567
<td>
@@ -3786,7 +3779,7 @@ The user account is identified by the provided authentication token.
37863779

37873780
## Version (object)
37883781
- versionNumber: `0.0` (string, required)
3789-
- sourceType: `SOURCE_CODE` (VersionSourceType, required)
3782+
- sourceType: `SOURCE_FILES` (VersionSourceType, required)
37903783
- envVars (array, nullable)
37913784
- (object)
37923785
- name: `DOMAIN` (string, required)
@@ -3795,10 +3788,25 @@ The user account is identified by the provided authentication token.
37953788
- (object)
37963789
- name: `SECRET_PASSWORD` (string, required)
37973790
- isSecret: true (boolean, nullable)
3798-
- baseDockerImage: `apify/actor-node-basic` (string, nullable)
37993791
- applyEnvVarsToBuild: false (boolean, nullable)
38003792
- buildTag: `latest` (string, required)
3801-
- sourceCode: `console.log('Hello world!');` (string, nullable)
3793+
- sourceFiles (array)
3794+
-(object)
3795+
- name: `src/main.js` (string, required)
3796+
- format: `TEXT` (string, required)
3797+
- content: `console.log('This is the main.js file');` (string, required)
3798+
-(object)
3799+
- name: `package.json` (string, required)
3800+
- format: `TEXT` (string, required)
3801+
- content: `name: "My Scraper"` (string, required)
3802+
-(object)
3803+
- name: `Dockerfile` (string, required)
3804+
- format: `TEXT` (string, required)
3805+
- content: ` # Dockerfile contains instructions ...` (string, required)
3806+
-(object)
3807+
- name: `README.md` (string, required)
3808+
- format: `TEXT` (string, required)
3809+
- content: `My Actor scrapes the web` (string, required)
38023810

38033811
## EnvVar (object)
38043812
- name: `MY_ENV_VAR` (string, required)
@@ -3824,26 +3832,10 @@ The user account is identified by the provided authentication token.
38243832
- isSecret: true (boolean, nullable)
38253833

38263834
## ListOfVersions (array)
3827-
- (object)
3828-
- versionNumber: `0.0` (string, required)
3829-
- sourceType: `SOURCE_CODE` (VersionSourceType, required)
3830-
- envVars (array, nullable)
3831-
- (object)
3832-
- name: `DOMAIN` (string, required)
3833-
- value: `http://example.com` (string, required)
3834-
- isSecret: false (boolean, nullable)
3835-
- (object)
3836-
- name: `SECRET_PASSWORD` (string, required)
3837-
- isSecret: true (boolean, nullable)
3838-
- baseDockerImage: `apify/actor-node-basic` (string, nullable)
3839-
- applyEnvVarsToBuild: false (boolean, nullable)
3840-
- buildTag: `latest` (string, required)
3841-
- sourceCode: `console.log('Hello world!');` (string, nullable)
38423835
- (object)
38433836
- versionNumber: `0.1` (string, required)
38443837
- envVars: [] (array, nullable)
38453838
- sourceType: `SOURCE_FILES` (VersionSourceType, required)
3846-
- sourceCode: `console.log('Hello world!');` (string, nullable)
38473839
- applyEnvVarsToBuild: false (boolean, nullable)
38483840
- buildTag: `latest` (string, required)
38493841
- sourceFiles (array)
@@ -3888,7 +3880,7 @@ The user account is identified by the provided authentication token.
38883880

38893881
## VersionUpdate (object)
38903882
- versionNumber: `0.0` (string, nullable)
3891-
- sourceType: `SOURCE_CODE` (VersionSourceType, nullable)
3883+
- sourceType: `SOURCE_FILES` (VersionSourceType, nullable)
38923884
- envVars (array, nullable)
38933885
- (object)
38943886
- name: `DOMAIN` (string, nullable)
@@ -3898,13 +3890,27 @@ The user account is identified by the provided authentication token.
38983890
- name: `SECRET_PASSWORD` (string, nullable)
38993891
- value: `MyTopSecretPassword123` (string, nullable)
39003892
- isSecret: true (boolean, nullable)
3901-
- baseDockerImage: `apify/actor-node-basic` (string, nullable)
39023893
- applyEnvVarsToBuild: false (boolean, nullable)
39033894
- buildTag: `latest` (string, nullable)
3904-
- sourceCode: `console.log('Hello world!');` (string, nullable)
3895+
- sourceFiles (array)
3896+
-(object)
3897+
- name: `src/main.js` (string, required)
3898+
- format: `TEXT` (string, required)
3899+
- content: `console.log('This is the main.js file');` (string, required)
3900+
-(object)
3901+
- name: `package.json` (string, required)
3902+
- format: `TEXT` (string, required)
3903+
- content: `name: "My Scraper"` (string, required)
3904+
-(object)
3905+
- name: `Dockerfile` (string, required)
3906+
- format: `TEXT` (string, required)
3907+
- content: ` # Dockerfile contains instructions ...` (string, required)
3908+
-(object)
3909+
- name: `README.md` (string, required)
3910+
- format: `TEXT` (string, required)
3911+
- content: `My Actor scrapes the web` (string, required)
39053912

39063913
## VersionSourceType (enum)
3907-
+ `SOURCE_CODE`
39083914
+ `SOURCE_FILES`
39093915
+ `GIT_REPO`
39103916
+ `TARBALL`

0 commit comments

Comments
 (0)