You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common way to customize the build process is to define environment variables, which can be accessed from any stage in your build process.
4
+
5
+
### Public ENV variables reference
6
+
7
+
-`ABSTRUSE_BRANCH`
8
+
- for push builds, or builds not triggered by a pull request, this is the name of the branch.
9
+
- for builds triggered by a pull request this is the name of the branch targeted by the pull request.
10
+
- for builds triggered by a tag, this is the same as the name of the tag (`ABSTRUSE_TAG`)
11
+
12
+
-`ABSTRUSE_BUILD_DIR`
13
+
- The absolute path to the directory where the repository being built has been copied on the worker.
14
+
15
+
-`ABSTRUSE_BUILD_ID`
16
+
- The id of the current build that Abstruse CI uses internally.
17
+
18
+
-`ABSTRUSE_JOB_ID`
19
+
- The if of the current job that Abstruse CI uses internally.
20
+
21
+
-`ABSTRUSE_COMMIT`
22
+
- The commit that the current build is testing.
23
+
24
+
-`ABSTRUSE_EVENT_TYPE`
25
+
- Indicates how the build was triggered. One of `push` or `pull_request`
26
+
27
+
-`ABSTRUSE_PULL_REQUEST`
28
+
- The pull request number if the current job is a pull request, “false” if it’s not a pull request.
29
+
30
+
-`ABSTRUSE_PULL_REQUEST_BRANCH`
31
+
- if the current job is a pull request, the name of the branch from which the PR originated.
32
+
- if the current job is a push build, this variable is empty (`""`)
33
+
34
+
-`ABSTRUSE_TAG`
35
+
- If the current build is for a git tag, this variable is set to the tag’s name.
36
+
37
+
-`ABSTRUSE_PULL_REQUEST_SHA`
38
+
- if the current job is a pull request, the commit SHA of the HEAD commit of the PR.
39
+
- if the current job is a push build, this variable is empty (`""`)
40
+
41
+
-`ABSTRUSE_SECURE_ENV_VARS`
42
+
- Set to `true` if there are any encrypted environment variables.
43
+
- Set to `false` if no encrypted environment variables are available.
44
+
45
+
-`ABSTRUSE_TEST_RESULT`
46
+
- is set to `0` if the build is successful and `1-255` if the build is broken.
47
+
- this variable is available only since `test` command is executed
48
+
49
+
### Define public ENV variables in .abstruse.yml
50
+
51
+
You can define multiple ENV variables per item.
52
+
53
+
```yml
54
+
matrix:
55
+
- env: SCRIPT=lint NODE_VERSION=8
56
+
- env: SCRIPT=test NODE_VERSION=8
57
+
- env: SCRIPT=test:e2e NODE_VERSION=8
58
+
- env: SCRIPT=test:protractor NODE_VERSION=8
59
+
- env: SCRIPT=test:karma NODE_VERSION=8
60
+
```
61
+
62
+
### Define variables public and encrypted variables under repository
63
+
64
+
Variables defined in repository settings are the same for all builds, and when you restart an old build, it uses the latest values. These variables are not automatically available to forks.
65
+
66
+
Define variables in the Repository Settings that:
67
+
68
+
- differ per repository.
69
+
- contain sensitive data, such as third-party credentials (encrypted variables).
0 commit comments