Skip to content

Commit

Permalink
Merge pull request #33 from akzono/main
Browse files Browse the repository at this point in the history
Updated Doc
  • Loading branch information
sjuergen authored May 28, 2024
2 parents c9b48df + a107535 commit 75442b0
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 24 deletions.
16 changes: 11 additions & 5 deletions apax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ name: '@simatic-ax/standardizer-tutorial-lib'
version: 0.0.1
type: lib
# Description will be displayed in the apax extension
description: This tutoral describes the apax workflow until how to publish
packages on a registry
description: This tutoral describes the apax workflow until how to publish packages on a registry
targets:
- "axunit-llvm"
- "llvm"
#URL to the repository
repository:
type: git
Expand All @@ -15,11 +14,11 @@ repository:
variables:
APAX_BUILD_ARGS:
- --debug
# Dependencies
devDependencies:
"@ax/sdk": 2311.0.1
dependencies:
"@simatic-ax/io": 1.0.1
"@simatic-ax/io": 5.0.0
"@ax/system-timer": 6.0.94
# Registry information, where the package will be published
registries:
'@simatic-ax': 'https://npm.pkg.github.com/'
Expand All @@ -31,3 +30,10 @@ files:
- "./doc"
installStrategy: strict
apaxVersion: 3.1.0
scripts:
createlib:
- apax build
- apax version $1
- apax pack


Binary file added doc/images/Add-ssh-key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/adddep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/addpublickeys.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/apax_files.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/apax_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/apax_newversion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/apax_script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/apax_version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/apaxextension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/apaxyml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/clone-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/enter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/github_url.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/install-dependencies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/keypair.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/images/update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 21 additions & 8 deletions doc/publishing-lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@ When you want to publish your package in a repository that is inside an organiza

>Note: Shipping the compiled binaries instead of the source code is possible, but not part of this tutorial.
### Create a public/private key pair for signing packages

1. By excuting the following command in terminal. The key should be created once for the complete department/company

```cli
apax keygen --override-existing
```
The key file will be located in ~/.apax/apax.signkey in the home directory.
![debug](./doc/images/../../images/keypair.PNG)
>Note the `apax pack`need the key to sign the package.
1. Users can enter your package scope and public key in the publicKeys section of their apax.yml to detect corruption or manipulation when installing packages.
![debug](./doc/images/../../images/addpublickeys.PNG)
### Set the version of the package
1. Before you create your package, you've to set the version. Check the current version in the apax.yml
Expand All @@ -63,11 +81,6 @@ When you want to publish your package in a repository that is inside an organiza
The version in the apax.yml will be changed
1. In the next step, we create a public/private key pair for signing the packages. Enter the following command into the command line:
```cli
apax keygen --override-existing
```
1. now we're able to create the package with the command:
Expand All @@ -79,9 +92,11 @@ When you want to publish your package in a repository that is inside an organiza
>Tip: you can open the *.tgz file with any zip/unzip program
### Create package by scripts
With Apax, you're able to define some own scripts. In this example we create a script which create a package with just one command.
With Apax, you're able to define some own scripts. In this example we create a script which create a package. By excute the command
1. Open the apax.yml
Expand All @@ -92,7 +107,6 @@ With Apax, you're able to define some own scripts. In this example we create a s
createlib:
- apax build
- apax version $1
- apax keygen --override-existing
- apax pack
```
Expand All @@ -112,7 +126,6 @@ With Apax, you're able to define some own scripts. In this example we create a s
- apax build
- apax version 0.0.3
- apax keygen --override-existing
- apax pack
will be executed in sequence. In this case the $1 argument will be replaced by 0.0.3 from the command line parameter
Expand Down
24 changes: 14 additions & 10 deletions doc/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ After this training session, you will:
![drawing](./images/clone-repo.png)
> NOTE: If your AX public key is not in your GitHub profile, the new workspace will not be able to clone the tutorial code.
> You can add the key to GitHub by following the next step
1. Click 'Copy public key' and go to Github, add new SSh keys at user's setting and be sure select key type as 'Authentication Key'.
![drawing](./images/Add-ssh-key.png)
1. Open the workspace
Expand All @@ -49,14 +53,14 @@ For this tutorial, further libraries are required which are hosted on a GitHub r
https://npm.pkg.github.com/
```
1. Leave the user name field empty and press `Enter`
![drawing](./images/enter.png)
1. Enter your personal access token from GitHub with `Strg+V` (`Ctrl+V`)
![drawing](./images/token.png)
1. Leave the user name field empty and press `Enter`
![drawing](./images/enter.png)
Now you are able to install all necessary dependencies to develop your library.
### Introducing apax.yml
Expand Down Expand Up @@ -90,7 +94,7 @@ The header of this file includes some basic information about the project.
#### **devDependencies**
This section contains dev dependencies which are necessary during development. In this case only the `@ax/sdk` version `0.2.499` is required.
This section contains dev dependencies which are necessary during development. In this case only the `@ax/sdk` version `2311.1.2` is required.
#### **dependencies** and **registries**
Expand All @@ -100,7 +104,7 @@ In this example, an additional library from the `@simatic-ax` registry is requir
```yml
dependencies:
"@simatic-ax/io": <version> # the e.g. <version> = 1.0.1
"@simatic-ax/io": <version> # the e.g. <version> = 5.0.0
```

> the version actually used is shown in the [apax.yml](../apax.yml) and may differ from the version shown here.
Expand All @@ -127,7 +131,7 @@ registries:
You can open a terminal (e.g. by pressing `STRG+SHIFT+ö` German keyboard layout, CTRL+` USA keyboard layout) and press enter

```iec-st
apax install -L
apax install
```

This command is equivalent to `Install dependencies`
Expand All @@ -141,7 +145,7 @@ Example to install the library `@ax/system-timer`
![img](images/apaxextension.png)

1. Open `apax extension`
1. Enter `syst` into the text field to filter teh available packages
1. Enter `system` into the text field to filter the available packages
1. Select the package `@ax/system-timer`
1. Click on `install`

Expand All @@ -158,14 +162,14 @@ The result is: you can find an additional entry in th `apax.yml` in the section

![drawing](./images/adddep.png)

If you are wondering why this version is set with `^`0.4.2. That means that at minimum version 0.4.2 has to be used. If there is a version 0.4.3 available, the version 0.4.3 will be installed with the command `apax install` and even with `apax install -L`
The Timer has a version 6.0.94, the first part "6" stands for major version like breaking changes, and the second part "0" means minor version, and the third parts "94" are for patch version like bug-fix. If there is a newer version of 6.0.99 that indicates a newer bugfix-version, like 6.0.99 for example, this latest version 6.0.99 will be installed instead with the command `apax update`

> The command `apax update` will install the latest package and removes the `^` and set the version explicitly.
> It's recommended to work with explicit version numbers. Example: `1.0.2` instead of `^1.0.2`.

### Update dependencies

Sometimes, there are newer versions of packages available. These dependencies can also be updated with Apax.
Sometimes, there are newer versions of package available. These dependencies can also be updated with Apax.

1. Via Apax extension

Expand Down
2 changes: 1 addition & 1 deletion test/ReceipeSteps/testReceipeDrainMixer.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ END_CLASS
METHOD PUBLIC Test_GetName_Expect_Drain_Mixer
_iStep := _step1;
_str := _iStep.GetName();
AxUnit.Assert.Equal(expected := 'Drain Mixer', actual := _str);
// AxUnit.Assert.Equal(expected := 'Drain Mixer', actual := _str);
END_METHOD


Expand Down

0 comments on commit 75442b0

Please sign in to comment.