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
Copy file name to clipboardExpand all lines: README.md
+71-83Lines changed: 71 additions & 83 deletions
Original file line number
Diff line number
Diff line change
@@ -31,16 +31,11 @@ The first thing to do is to change the version number. In the root of the SDK co
31
31
#### Building the JAR
32
32
In order to build an SDK runtime JAR, navigate to the root directory of the repository, and execute:
33
33
```
34
-
./build.sh
34
+
./gradlew jar
35
35
```
36
-
The build script will produce a few build directories and output `sdk-<version>.jar` file.
36
+
This will produce the jar under `build/libs`.
37
37
38
-
Note that the build script does not yet do a lot of error checking. So, it is sometimes not immediately apparent if the build did not succeed. Check the timestamp on the `sdk-<version>.jar` file to make sure it's been newly-built. If not, you might have to scroll through the `build.sh` output to find an error message.
39
-
40
-
If you want to remove the results of the JAR build, they can be cleaned by going to the root directory of the respository and executing:
41
-
```
42
-
./clean.sh
43
-
```
38
+
Note that the build not yet do a lot of error checking. So, it is sometimes not immediately apparent if the build did not succeed. Check the timestamp on the `sdk-<version>.jar` file to make sure it's been newly-built. If it's not up to date, you might need to modify the script `bin/build.sh` to produce more output, rerun the jar task, and look at the failure messages.
44
39
45
40
#### Building the Python distribution
46
41
@@ -76,7 +71,7 @@ We need to put the local SDK build somewhere that the appgate code can access it
76
71
77
72
#### Making Local SDK Build Available
78
73
79
-
This step is easy. Simply copy `sdk-<version>.jar` to `appliance/lib` in the `app-gate`.
74
+
This step is easy. Simply copy `build/libs/sdk-<version>.jar` to `appliance/lib` in the `app-gate`.
80
75
81
76
Don't forget to check this change into git if you plan on using `git dx-test` or `git appliance-deploy` to test. (Note: you will **not** be pushing this! We'll undo this change later.)
82
77
@@ -86,49 +81,49 @@ Don't forget to check this change into git if you plan on using `git dx-test` or
86
81
Delphix Engine and IntelliJ both use gradle to build. So, we have to ensure that the gradle build knows how to find and use our local SDK build. This is a two-step process.
87
82
88
83
89
-
**Step 1** We need to tell gradle to look for jars in the `lib` directory. In order to do that, we will have to add the following code to `appliance/gradle-lib/java-common.gradle`:
90
-
91
-
```
92
-
flatDir {
93
-
dirs "${gradleLibDir}/../lib/"
94
-
}
95
-
```
96
-
97
-
The above entry has to be added in the list of external repositories. Here is a more complete listing.
98
-
99
-
```
100
-
/*
101
-
* External repositories we fetch jars from. This should never include a repository
102
-
* that is not managed by Delphix. Third party repos should be mirrored through
103
-
* http://artifactory.delphix.com/.
104
-
*/
105
-
repositories {
106
-
/*
107
-
* Legacy location for jars that were checked directly into the app-gate.
**Step 2** We have to tell gradle to actually use our local SDK where applicable. We have two modules that need to see the SDK: `appdata` and `workflow`. So, we have to edit both `appliance/server/appdata/build.gradle` and `appliance/server/workflow/build.gradle`).
122
-
123
-
We need to add the following line:
124
-
```
125
-
compile name: "sdk-<version>"
126
-
```
127
-
128
-
We also need to remove (or comment out) this line so that gradle will not try to use an artifactory build:
1. We need to tell gradle to look for jars in the `lib` directory. In order to do that, we will have to add the following code to `appliance/gradle-lib/java-common.gradle`:
85
+
86
+
```
87
+
flatDir {
88
+
dirs "${gradleLibDir}/../lib/"
89
+
}
90
+
```
91
+
92
+
The above entry has to be added in the list of external repositories. Here is a more complete listing.
93
+
94
+
```
95
+
/*
96
+
* External repositories we fetch jars from. This should never include a repository
97
+
* that is not managed by Delphix. Third party repos should be mirrored through
98
+
* http://artifactory.delphix.com/.
99
+
*/
100
+
repositories {
101
+
/*
102
+
* Legacy location for jars that were checked directly into the app-gate.
2. We have to tell gradle to actually use our local SDK where applicable. We have two modules that need to see the SDK: `appdata` and `workflow`. So, we have to edit both `appliance/server/appdata/build.gradle` and `appliance/server/workflow/build.gradle`).
117
+
118
+
We need to add the following line:
119
+
```
120
+
compile name: "sdk-<version>"
121
+
```
122
+
123
+
We also need to remove (or comment out) this line so that gradle will not try to use an artifactory build:
Once you complete the above two steps, IntelliJ should notice the changes to your build files and rebuild the project. If you don't have the auto-rebuild option turned on, refresh the gradle build.
134
129
@@ -155,46 +150,39 @@ In addition, it's customary to publish a "provisional" appgate review, so that p
155
150
156
151
## Pushing and Deploying SDK Code
157
152
158
-
### Preparation
159
153
160
-
1. Make sure you have both the JAR and the Python distribution built, as described above. Double check that you have the correct version in `build.gradle`.
154
+
### Publishing
161
155
162
-
2. You will need your Artifactory API key, which you can get by navigating to http://artifactory.delphix.com/artifactory/webapp/#/profile (make sure you're logged in).
156
+
There are two Gradle tasks that do publishing: `publishDebug` and `publishProd`. They differ in two ways:
163
157
164
-
3. Make sure that you have `twine` installed (run `pip install twine`), and make sure that your `~/.pypirc` file has your credentials:
165
-
```bash
166
-
[~] cat ~/.pypirc
167
-
[distutils]
168
-
index-servers =
169
-
local
158
+
1. They publish the Python distributions to separate repositories on Artifactory (the jar is always published to the same one.). `publishDebug` uploads to `dvp-local-pypi`. This is a special repository that has been setup to test the SDK. It falls back our our production PyPI repository, but artifacts uploaded to `dvp-local-pypi` do not impact production artifacts. This should be used for testing. `publishProd` does upload the Python distributions to our production Artifactory PyPI repository, `delphix-local`.
2. `publishProd` runs tests, formatting, and linting while `publishDebug` does not.
176
161
177
-
### Publishing
162
+
NOTE: The external release to `pypi.org` is done outside of the build system.
178
163
179
-
We do not yet have an autobuild/autodeploy mechanism for SDK changes, and so you must manually perform three related steps separately
164
+
#### Setup
180
165
181
-
1. Push your source changes to our git server with `git push`.
182
-
!!! note
183
-
Depending on what you've changed, you may find a variety of "lock files" that have been changed. These need to be checked in and pushed alongside your source changes. These guarantee consistent builds from developer to developer.
166
+
1. There are three environment variables that need to be set in order to publish: `ARTIFACTORY_PYPI_USER`, `ARTIFACTORY_PYPI_PASS`, and `ARTIFACTORY_JAR_KEY`.
184
167
185
-
2. Publish the Jar to our Artifactory server with this command:
`ARTIFACTORY_PYPI_USER` and `ARTIFACTORY_PYPI_PASS` are one set of credentials used to upload the Python distributions to our internal PyPI repositories. The credentials are the same for both internal PyPI repositories mentioned above.
169
+
`ARTIFACTORY_JAR_KEY`
189
170
190
-
3. Publish the Python distribution to our Pypi server with these commands:
191
-
```bash
192
-
twine upload -r local tools/build/python-dist/*
193
-
twine upload -r local libs/build/python-dist/*
194
-
twine upload -r local platform/build/python-dist/*
195
-
twine upload -r local common/build/python-dist/*
196
-
twine upload -r local dvp/build/python-dist/*
197
-
```
171
+
- `ARTIFACTORY_PYPI_USER` and `ARTIFACTORY_PYPI_PASS` is the username/password combo given to you by whoever setup your Artifactory pypi account. If you do not have one, please reach out to the `#appdata-core` channel. These used to upload the Python distributions to our internal PyPI repositories. The credentials are the same for both internal PyPI repositories mentioned above.
172
+
- `ARTIFACTORY_JAR_KEY` is your Artifactory API key and is used to upload the jar. It can be retreived from http://artifactory.delphix.com/artifactory/webapp/#/profile. You may have to login. This is different from the PyPI credentials because the artifacts are being uploaded to different repositories on Artifactory.
173
+
174
+
2. `twine` needs to be installed. This is a Python package that is used to upload Python distributions. If it's not installed, install it by running `pip install twine`.
175
+
176
+
177
+
#### Debug Publishing
178
+
179
+
Run `./gradlew publishDebug`. This will build the jar, every Python distribution, and upload them to Artifactory with the Python distributions going to our testing repository, `dvp-local-pypi`.
180
+
181
+
You can install `dvp` from this repository with the command `pip install -i https://artifactory.delphix.com/artifactory/api/pypi/dvp-local-pypi/simple dvp==<version>`.
182
+
183
+
#### Final Publishing
184
+
185
+
Once you are absolutely certain all changes have been made run `./gradlew publishProd`. This will run checks, build the jar, create the Python distributions, and upload all of them to Artifactory with the Python distributions going to `delphix-local`.
die "ARTIFACTORY_PYPI_USER, ARTIFACTORY_PYPI_PASS, and/or ARTIFACTORY_JAR_KEY environment variables are not set. Set them or pass them in as arguments to upload.sh."
24
+
fi
25
+
26
+
# dvp-local-pypi is used for testing and is the default. delphix-local is our internal production PyPI repository and
27
+
# should only be used when publishing final versions.
0 commit comments