|
1 | 1 |
|
2 |
| -### TESTS |
| 2 | +## Deployment |
3 | 3 |
|
4 |
| -- Generate Jacoco report and push to Coverall |
| 4 | +### 1. Git |
5 | 5 |
|
| 6 | +- Start the agent |
6 | 7 | ```bash
|
7 |
| -mvn clean test jacoco:report coveralls:report |
| 8 | +eval "$(ssh-agent -s)" |
8 | 9 | ```
|
9 | 10 |
|
10 |
| -- Generate Sonar report and push to Coverall |
11 |
| - |
| 11 | +- Check key is available |
12 | 12 | ```bash
|
13 |
| -export SONAR_TOKEN=... |
14 |
| -mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=clun_astra-cli |
| 13 | +ssh-add -l |
15 | 14 | ```
|
16 | 15 |
|
17 |
| -### PACKAGING |
18 |
| - |
19 |
| -- Build the project |
20 |
| - |
| 16 | +- Add the key (if needed) |
21 | 17 | ```
|
22 |
| -mvn clean install |
| 18 | +cd ~/.ssh |
| 19 | +ssh-add githubff4j |
23 | 20 | ```
|
24 | 21 |
|
25 |
| -- Run with Agent: |
| 22 | +### 2. Update versions and dependencies |
26 | 23 |
|
27 |
| -_Make sure you are using a graalVM JDK_ |
| 24 | +- Check for dependency updates and update the `pom.xml` file when relevant. |
28 | 25 |
|
29 | 26 | ```bash
|
30 |
| -sdk install java 22.3.1.r17-grl |
31 |
| -java --version |
| 27 | +mvn versions:display-dependency-update |
32 | 28 | ```
|
33 | 29 |
|
34 |
| -``` |
35 |
| -/Library/Java/JavaVirtualMachines/graalvm-ce-java17-21.3.0/Contents/Home/bin/java -agentlib:native-image-agent=config-output-dir=/tmp/native-image -jar target/astra-cli-0.2-shaded.jar token list |
| 30 | +- Update project version |
| 31 | +```bash |
| 32 | +mvn versions:set -DnewVersion=0.4 |
36 | 33 | ```
|
37 | 34 |
|
38 |
| -- Build as a native image |
39 |
| - |
40 |
| -``` |
41 |
| -mvn clean install -Pnative |
| 35 | +- When ok commit |
| 36 | +```bash |
| 37 | +mvn versions:commit |
42 | 38 | ```
|
43 | 39 |
|
44 |
| -### PUSH |
45 |
| - |
46 |
| -- Start the `ssh-agent` |
47 |
| -``` |
48 |
| -eval "$(ssh-agent -s)" |
49 |
| -``` |
50 |
| -- Add the ssh key to the agent |
51 |
| -``` |
52 |
| -cd ~/.ssh |
53 |
| -ssh-add githubff4j |
54 |
| -``` |
55 |
| -- Update sources |
| 40 | +- Make sure everything is in sync |
56 | 41 | ```
|
57 | 42 | find . -type f -name *.DS_Store -ls -delete
|
58 | 43 | git pull
|
59 | 44 | git add -A
|
60 |
| -git commit -m "delivery" |
61 |
| -git push |
| 45 | +git commit -m "Preparing for deployment" |
62 | 46 | ```
|
63 |
| -- Release |
| 47 | + |
| 48 | +### 3. Build and Tests |
| 49 | + |
| 50 | +- Generate Jacoco report and push to Coverall and get results at [Coveralls.io](https://coveralls.io/github/datastax/astra-cli) |
| 51 | + |
| 52 | +```bash |
| 53 | +mvn clean test jacoco:report coveralls:report |
64 | 54 | ```
|
65 |
| -mvn clean -DskipTests -Darguments=-DskipTests release:prepare release:perform |
| 55 | + |
| 56 | +- Generate Sonar report and push to sonar cloud and get results at [SonarCloud.io](https://sonarcloud.io/summary/overall?id=clun_astra-cli) |
| 57 | + |
| 58 | +```bash |
| 59 | +export SONAR_TOKEN=... |
| 60 | +mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=clun_astra-cli |
66 | 61 | ```
|
67 | 62 |
|
68 |
| -### DEPLOY |
| 63 | +### 4. Packaging |
69 | 64 |
|
70 |
| -- Build the project |
| 65 | +- Install proper java and graal VM if needed |
71 | 66 |
|
72 |
| -- Copy `astra-init.sh` on each distribution folder |
| 67 | +```bash |
| 68 | +sdk install java 22.3.1.r17-grl |
| 69 | +java --version |
| 70 | +``` |
73 | 71 |
|
74 |
| -- Copy the shaded and put it in Java folder, rename to `astra-cli.jar` |
| 72 | +- Build project |
75 | 73 |
|
76 |
| -- Build in native |
| 74 | +``` |
| 75 | +mvn clean install |
| 76 | +``` |
| 77 | + |
| 78 | +- Check `reflect-config.json` and `resource-config.json` are updated with all classes and commands |
| 79 | + |
| 80 | +```json |
| 81 | +{ |
| 82 | + "name":"com.dtsx.astra.cli.org.OrgIdCmd", |
| 83 | + "allDeclaredFields":true, |
| 84 | + "methods":[{"name":"<init>","parameterTypes":[] }] |
| 85 | +} |
| 86 | +``` |
| 87 | +- Build project a native image |
77 | 88 |
|
78 | 89 | ```
|
79 | 90 | mvn clean install -Pnative
|
80 | 91 | ```
|
81 | 92 |
|
82 |
| -- Chmod everything |
| 93 | +- Chmod everything execution files |
| 94 | + |
| 95 | +```bash |
| 96 | +chmod 755 src/main/dist/astra-init.sh |
| 97 | +``` |
| 98 | + |
| 99 | +- Copy `dist/astra-init.sh` (_generated by a test)_ on each distribution folder |
| 100 | + |
| 101 | + |
| 102 | +- Copy the shaded and put it in Java folder, rename to `astra-cli.jar` |
| 103 | + |
83 | 104 |
|
84 | 105 | - Packaging
|
85 | 106 |
|
86 | 107 | ```
|
87 |
| -zip astra-cli-0.2.zip * |
88 |
| -zip astra-cli-0.2-linux.zip * |
89 |
| -zip astra-cli-0.2-windows.zip * |
90 |
| -zip astra-cli-0.2-mac.zip * |
91 |
| -tar -czf astra-cli-0.2-brew.tar.gz * |
92 |
| -brew create https://github.com/datastax/astra-cli/releases/download/0.2/astra-cli-0.2-homebrew.tar.gz |
| 108 | +zip astra-cli-0.4.zip * |
| 109 | +zip astra-cli-0.4-linux.zip * |
| 110 | +zip astra-cli-0.4-mac.zip * |
| 111 | +tar -czf astra-cli-0.4-brew.tar.gz * |
| 112 | +brew create https://github.com/datastax/astra-cli/releases/download/0.4/astra-cli-0.4-homebrew.tar.gz |
93 | 113 | ```
|
94 | 114 |
|
95 | 115 | - Edit Releases
|
|
0 commit comments