Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: encrypted session handling #394

Closed
wants to merge 583 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
583 commits
Select commit Hold shift + click to select a range
42e34e7
feat(set-session): option to always set C8Y_PASSWORD variable (#288)
reubenmiller Jul 16, 2023
b58118c
fix(assert count): logic error which resulted in the minimum result b…
reubenmiller Jul 19, 2023
bc3ae83
feat(console): provide console feedback for http calls with expected …
reubenmiller Jul 19, 2023
62694f3
feat(outputTemplate): disable view logic when an outputTemplate is be…
reubenmiller Jul 19, 2023
e909679
chore(build): replaced deprecated goreleaser brew syntax (#295)
reubenmiller Jul 19, 2023
f4d265b
feat(c8y util repeat*): Support repeating a randomized number of time…
reubenmiller Jul 26, 2023
ce76b7d
fix(pagination): skip pagination when totalPages is set to 1 (#299)
reubenmiller Aug 5, 2023
279aed1
chore: bump go-c8y library dependency to fix http status code 202 bug…
reubenmiller Aug 9, 2023
7f329ee
docs(fix): add missing tab import (#302)
reubenmiller Aug 9, 2023
6bc048d
fix(software|firmware): filter software|firmware list queries to spec…
reubenmiller Sep 6, 2023
9eb719a
feat: enable HTTP compression by default (#305)
reubenmiller Sep 6, 2023
8d16f82
docs: update dependencies and small doc improvements (#307)
reubenmiller Sep 11, 2023
ab05fe0
chore: add zsh completion example (#308)
reubenmiller Sep 11, 2023
f088a30
chore: update docs for release (#309)
reubenmiller Sep 11, 2023
f579140
feat(docker): add support for arm64 images (#310)
reubenmiller Sep 11, 2023
161cee2
bump go-c8y dependency
reubenmiller Nov 29, 2023
d12783f
fix (microservices create): only match microservices that are owned b…
reubenmiller Nov 29, 2023
334ee60
fix(hostedApplications): use server side query (instead of client sid…
reubenmiller Nov 29, 2023
f0f0a9c
Merge pull request #318 from reubenmiller/fix-microservice-create-nam…
reubenmiller Nov 29, 2023
131f890
docs: prepare for release
reubenmiller Nov 29, 2023
ff0a4a8
Merge pull request #319 from reubenmiller/update-docs-2.37.1
reubenmiller Nov 29, 2023
4d0a3c8
fix: update goreleaser docker build definition to support multi platf…
reubenmiller Nov 29, 2023
e50228b
feat: update c8y-shell container image to alpine 3.18
reubenmiller Nov 29, 2023
48d30a9
feat: update c8y-pwsh container image to also support arm64
reubenmiller Nov 29, 2023
a7b85b4
refactor: update pwsh docker file name
reubenmiller Nov 29, 2023
a1c2a39
Merge pull request #320 from reubenmiller/fix-arm64-docker-images
reubenmiller Nov 29, 2023
bc74742
ci: install qemu and buildx in action
reubenmiller Nov 29, 2023
90225d6
Merge pull request #321 from reubenmiller/fix-multi-arm-build
reubenmiller Nov 29, 2023
cb187c8
fix: parsing bug when using json dryFormat and the body is a json array
reubenmiller Dec 6, 2023
943f634
ci: delete cache on test setup to avoid unexpected test failures due …
reubenmiller Dec 6, 2023
a0c8dfd
Merge pull request #322 from reubenmiller/fix-jsonarray-dry-format
reubenmiller Dec 6, 2023
c684093
feat(extensions): add support for controlling the json body type, e.g…
reubenmiller Dec 6, 2023
79b4d2d
fix invalid reference to dry format env variable
reubenmiller Dec 6, 2023
9706758
Merge pull request #324 from reubenmiller/feat-support-json-array-bod…
reubenmiller Dec 6, 2023
a2a225c
chore: bump dependencies
reubenmiller Dec 29, 2023
3961ac4
update golang version to 1.21
reubenmiller Dec 29, 2023
fa139a2
debug test setup
reubenmiller Dec 29, 2023
01894f8
disable piping on setup
reubenmiller Dec 29, 2023
3dd1edb
disable piping on setup
reubenmiller Dec 29, 2023
56a3787
ci: include bootstrap username/password when running tests
reubenmiller Dec 29, 2023
ed26c21
docs: remove out of date warning
reubenmiller Dec 29, 2023
37cf0c9
Merge pull request #327 from reubenmiller/docs-remove-repo-warning
reubenmiller Dec 29, 2023
2d3749f
Merge pull request #326 from reubenmiller/chore-update-deps-2023-12-29
reubenmiller Dec 29, 2023
9c734bb
fix(activitylog): fix typo in example
reubenmiller Dec 30, 2023
6dd4ef9
Merge pull request #328 from reubenmiller/fix-activitylog-typo
reubenmiller Dec 30, 2023
a36b76a
fix(session create): fix handling of default type
reubenmiller Dec 30, 2023
e1bd67f
Merge pull request #329 from reubenmiller/fix-session-create-type
reubenmiller Dec 30, 2023
6296c9d
feat: new command to manage go-c8y-cli helper installation
reubenmiller Dec 31, 2023
06a655a
feat: support automatic retries for specific http responses
reubenmiller Jan 1, 2024
e188b22
add response nil check
reubenmiller Jan 1, 2024
863fd56
Merge pull request #331 from reubenmiller/feat-retry-handler
reubenmiller Jan 1, 2024
6761d60
Merge pull request #330 from reubenmiller/feat-cli-management
reubenmiller Jan 1, 2024
ffb2800
fix(extensions): remove binary extension check since it is not curren…
reubenmiller Jan 1, 2024
dbcc230
Merge pull request #332 from reubenmiller/fix-disable-binary-ext-support
reubenmiller Jan 1, 2024
964d6bc
feat(operations cancel): add new convenience command to cancel an ope…
reubenmiller Jan 1, 2024
8cf5da4
Merge pull request #333 from reubenmiller/simple-cancel-operation
reubenmiller Jan 1, 2024
7dfbc2c
fix: update go-c8y lib to fix relative url path bug
reubenmiller Jan 15, 2024
5e3c4f0
Merge pull request #336 from reubenmiller/chore-update-deps
reubenmiller Jan 15, 2024
bf56ed5
docs: generate docs for upcoming release
reubenmiller Jan 15, 2024
ad9cc44
Merge pull request #337 from reubenmiller/prepare-docs-2.39.0
reubenmiller Jan 15, 2024
acfd72d
docs(resetUserPassword): Add note about ony being able to set usernam…
reubenmiller Jan 15, 2024
8b67d80
generate docs
reubenmiller Jan 15, 2024
cda65f2
Merge pull request #338 from reubenmiller/docs-add-change-password-note
reubenmiller Jan 15, 2024
eff8efd
fix zsh/bash embedded plugin
reubenmiller Jan 15, 2024
01aae52
Merge pull request #339 from reubenmiller/fix-zsh-bash-plugin
reubenmiller Jan 16, 2024
2625174
fix: escape special characters before rebuilding json object
reubenmiller Jan 18, 2024
1e44f79
fix: display of column data with special characters
reubenmiller Jan 18, 2024
5e37c2b
Merge pull request #341 from reubenmiller/fix-special-json-props
reubenmiller Jan 18, 2024
c8700ee
fix(cli profile): avoid exiting from set-session so current session d…
reubenmiller Jan 24, 2024
c2683a7
test: update trusted certificate
reubenmiller Jan 24, 2024
fc4913f
test: fix setup script which silently failed to create some items
reubenmiller Jan 24, 2024
e031fe8
test: use pattern matching when checking certificate fingerprint
reubenmiller Jan 24, 2024
b41d939
tests: fix device certificate expected values after updating test cert
reubenmiller Jan 24, 2024
93a2327
Merge pull request #342 from reubenmiller/fix-shell-profile-set-sessi…
reubenmiller Jan 24, 2024
c360a75
fix(retry): disable retries by default
reubenmiller Feb 17, 2024
3aa2a7c
Merge pull request #344 from reubenmiller/disable-retry-by-default
reubenmiller Feb 17, 2024
b29e4c0
feat(pipeline): support reading pretty printed json (#345)
reubenmiller Feb 20, 2024
8d400bc
dev: resolve C8Y_BINARY path to an absolute path
reubenmiller Feb 21, 2024
35d833c
test: disable tests for deprecated get/delete single measurements
reubenmiller Feb 21, 2024
a8923f6
test: add test setup to ensure test has required assets for the asser…
reubenmiller Feb 21, 2024
98ed002
Merge pull request #347 from reubenmiller/dev-resolve-relative-c8y-path
reubenmiller Feb 21, 2024
16eed07
ci: update workflow dependencies (#348)
reubenmiller Feb 21, 2024
2dcfdfc
ci: update goreleaser action (#350)
reubenmiller Feb 21, 2024
9fbe831
fix(extension): correct link to extensions tutorial (#351)
reubenmiller Feb 21, 2024
af417fb
feat(microservices): support updating roles property from a given mic…
reubenmiller Apr 2, 2024
0ad4991
add example creating a microservice from a manifest file
reubenmiller Apr 2, 2024
c79bee9
Merge pull request #359 from reubenmiller/feat-microservice-update-roles
reubenmiller Apr 2, 2024
c4a0be0
feat(application list): add support for `tenant` and `hasVersions` fi…
reubenmiller Mar 11, 2024
10d1da4
Merge pull request #355 from reubenmiller/feat-tenant-list
reubenmiller Apr 2, 2024
e0423f6
feat: hide sensitive info by default
reubenmiller Apr 24, 2024
6ed693c
test: use cockpit for testing
reubenmiller Apr 25, 2024
00f1c17
Merge pull request #361 from reubenmiller/feat-default-hide-sensitive
reubenmiller Apr 25, 2024
daf248a
add option builder
reubenmiller Mar 10, 2024
b759f4f
support setting custom form data property name
reubenmiller Mar 10, 2024
bfae417
feat(spec): support formDataFile type
reubenmiller Mar 10, 2024
6780670
feat(extensions): support new `formDataFile` type to control setting …
reubenmiller Mar 10, 2024
794e0db
feat(command): new command - c8y applications versions
reubenmiller Mar 10, 2024
ec06adf
add auto generated applications versions commands
reubenmiller Mar 10, 2024
0d0356e
feat(binaries): add support for piping from new application versions …
reubenmiller Mar 10, 2024
ecaf096
update auto generated code
reubenmiller Mar 10, 2024
fe65308
add application completion
reubenmiller Mar 11, 2024
c9d561e
feat(applications list): add new `availability` flag
reubenmiller Apr 2, 2024
ce54dc5
build(gen): support new uiextension type
reubenmiller Apr 5, 2024
1b8b449
add ui/extensions subcommand with basic management
reubenmiller Apr 5, 2024
3ba1772
add ui extensions versions subcommand
reubenmiller Apr 5, 2024
f856edd
support installing extension from a public url
reubenmiller Apr 5, 2024
73fdfe2
docs: add some UI extension docs
reubenmiller Apr 5, 2024
dbdfefb
disable ui extension test due to dependencies
reubenmiller Apr 5, 2024
2d3b70c
add additional logging
reubenmiller Apr 6, 2024
b5ac463
add ui extension system tests
reubenmiller Apr 6, 2024
5fdac14
support for constraints on flags
reubenmiller Apr 6, 2024
f3277bf
support request validators
reubenmiller Apr 21, 2024
93c1393
add ui extensions delete version constraints
reubenmiller Apr 21, 2024
8e8b0b7
add progress bar when creating extensions
reubenmiller Apr 21, 2024
87b308a
add ui extension version completion
reubenmiller Apr 21, 2024
8cd754e
update autogen code
reubenmiller Apr 21, 2024
e131c8b
feat(filter): add includes and notincludes filter operators
reubenmiller Apr 21, 2024
ac19ca2
add progress bar nil check
reubenmiller Apr 21, 2024
2fa0d76
extend ui extension examples
reubenmiller Apr 21, 2024
f5c1430
add example installing ui extension from a url
reubenmiller Apr 22, 2024
330fd66
allow to update availability to SHARED
reubenmiller Apr 24, 2024
b8628db
add note to code about deprecating .value
reubenmiller Apr 24, 2024
6f27b5e
support looking up shared extensions in completions and named lookups
reubenmiller Apr 24, 2024
39dc1ed
add new command to install/replace/delete extensions in an application
reubenmiller Apr 24, 2024
8013406
use update mode
reubenmiller Apr 24, 2024
60bf348
add examples of installing ui extensions to an application
reubenmiller Apr 24, 2024
f48bf6d
fix panic when processing empty string
reubenmiller Apr 24, 2024
40c286f
auto apply templates on body when using custom initializer
reubenmiller Apr 25, 2024
ee8bae9
move body initializer to a single place
reubenmiller Apr 25, 2024
6074624
control how templates are applied
reubenmiller Apr 25, 2024
474f66f
allow inserting/overriding remote config
reubenmiller Apr 25, 2024
c3e0235
reword examples
reubenmiller Apr 25, 2024
8838790
rename extension to plugin
reubenmiller Apr 25, 2024
183dd92
rename internal function to also use plugin instead of extension
reubenmiller Apr 25, 2024
7f06f92
update ui plugin management examples
reubenmiller Apr 25, 2024
35e3181
support removing orphaned and revoked plugins from an application
reubenmiller Apr 25, 2024
b7e2b22
support piped input c8y ui plugins get
reubenmiller Apr 25, 2024
0072d0b
add c8y ui applications plugins list command
reubenmiller Apr 25, 2024
d218ab2
support option to execute prepare request even on dry runs
reubenmiller Apr 25, 2024
177771b
support piping application to application plugins command
reubenmiller Apr 25, 2024
48ea8e7
add more ui plugin examples to docs
reubenmiller Apr 26, 2024
b6cf990
use plugin instead of extension
reubenmiller Apr 26, 2024
915ee74
remove orphaned powershell commands
reubenmiller Apr 26, 2024
8babe59
remove orphaned auto generated powershell files
reubenmiller Apr 26, 2024
07a0fe1
update powershell module cmdlet list
reubenmiller Apr 26, 2024
b983f46
adding tests for ui application plugin management
reubenmiller Apr 26, 2024
dd191c8
only activate the plugin if the tags includes latest
reubenmiller Apr 26, 2024
a8c54e3
change ui app plugins list output to use a custom data structure merg…
reubenmiller Apr 26, 2024
d1c543a
return an error if the user provides an invalid plugin when installin…
reubenmiller Apr 26, 2024
8478ae8
use different shared plugin in tests
reubenmiller Apr 26, 2024
3b96c2f
activate plugin on first upload
reubenmiller Apr 26, 2024
6fc4ded
move artifact name detection to new package
reubenmiller Apr 26, 2024
9bbc856
don't try detecting the artifact name from a plugin url
reubenmiller Apr 26, 2024
61fd14f
Merge pull request #354 from reubenmiller/feat-application-versions
reubenmiller Apr 26, 2024
b4fd72e
feat(set-session): ignore existing token if it is not valid for a min…
reubenmiller Apr 27, 2024
7de314d
Merge pull request #363 from reubenmiller/feat-control-token-renewal
reubenmiller Apr 27, 2024
d21ca0d
update generated docs
reubenmiller Apr 27, 2024
abb5d34
skip powershell tests which are dependent on other resources
reubenmiller Apr 27, 2024
78ffbb1
fix failing powershell tests due to changes in some default settings
reubenmiller Apr 27, 2024
d20d952
Merge pull request #364 from reubenmiller/release-2.40-docs
reubenmiller Apr 27, 2024
29d05c4
feat(set-session): ignore extensions folder when scanning for availab…
reubenmiller Apr 28, 2024
2821517
Merge pull request #366 from reubenmiller/feat-set-session-ignore-ext…
reubenmiller Apr 28, 2024
566a81e
fix typos
reubenmiller May 15, 2024
2fa1d95
add generic worker for non-request based commands
reubenmiller May 15, 2024
d52844d
feat: support outputTemplate for non-request based commands
reubenmiller May 15, 2024
9d39f87
Merge pull request #369 from reubenmiller/refactor-generic-worker
reubenmiller May 15, 2024
ed1816e
add function to convert wildcard to regex
reubenmiller May 14, 2024
5df9b0e
feat(remoteaccess): add new remote access support to create a local p…
reubenmiller May 14, 2024
4c3fb6e
fix(pipeline): set empty output if pipeline json property matching is…
reubenmiller May 15, 2024
087b278
feat: ignore arguments after --
reubenmiller May 15, 2024
43e1a4e
accept device via pipeline
reubenmiller May 15, 2024
7e95f28
fixup! fix(pipeline): set empty output if pipeline json property matc…
reubenmiller May 15, 2024
0ed1cfb
add remote access configuration management
reubenmiller May 15, 2024
bd5a9bd
support reading device from pipeline
reubenmiller May 15, 2024
61b1901
rename remote access configurations spec
reubenmiller May 16, 2024
613ee06
regenerate remote access code
reubenmiller May 16, 2024
e9f4a77
update remote access examples
reubenmiller May 16, 2024
0f17a6c
cleanup code
reubenmiller May 17, 2024
72bb282
add option to disable reading from stdin in code
reubenmiller May 17, 2024
208a14f
fix stdio mode
reubenmiller May 17, 2024
af7be5b
update auto-gen code
reubenmiller May 17, 2024
c92e50c
add remote access configuration completion and named lookups
reubenmiller May 18, 2024
af574ea
fix ssh connect examples
reubenmiller May 18, 2024
ec9defe
add custom local proxy run command
reubenmiller May 18, 2024
7805207
use latest go-c8y version
reubenmiller May 18, 2024
837c5d7
expose env variables to WSL
reubenmiller May 18, 2024
fab94db
use exit code returned by the subcommand
reubenmiller May 18, 2024
a6fe198
add on-demand test script used for manual validation
reubenmiller May 18, 2024
e21c8e8
add remote access docs
reubenmiller May 18, 2024
c5fa84b
feat(views): print file path to the matching view when using --debug
reubenmiller May 18, 2024
ca1a1e8
Merge pull request #368 from reubenmiller/feat-remote-access-client
reubenmiller May 18, 2024
163a8a7
Merge pull request #370 from reubenmiller/feat-print-view-source-file
reubenmiller May 18, 2024
ede685e
fix(outputTemplate): unescape string output
reubenmiller May 18, 2024
f6641dc
Merge pull request #371 from reubenmiller/fix-output-template-binary-…
reubenmiller May 18, 2024
c436df8
fix(data): return an error message when mixed data is provided
reubenmiller May 18, 2024
05cada6
add test to cover mixed data types
reubenmiller May 18, 2024
b5fa65c
Merge pull request #372 from reubenmiller/fix-mixed-shorthand-json
reubenmiller May 18, 2024
7d2eac8
add number formatter interface
reubenmiller May 19, 2024
51cd5c9
feat(view): display very small or large numbers using a metric prefix
reubenmiller May 19, 2024
8d9d6c8
add number format tests
reubenmiller May 19, 2024
5ab2e05
Merge pull request #373 from reubenmiller/feat-table-large-numbers
reubenmiller May 19, 2024
4afad9d
build(gen-tests): improve error message on parsing errors
reubenmiller May 19, 2024
9febd40
build(test): fail hard on errors
reubenmiller May 19, 2024
5eb3558
fix remote access configurations update example
reubenmiller May 19, 2024
857b64d
build(gen): revert to using camel case in the generated golang code
reubenmiller May 19, 2024
f0a0d33
update generated code
reubenmiller May 19, 2024
2aac348
Merge pull request #374 from reubenmiller/fix-build-errors
reubenmiller May 19, 2024
2c2a9f2
chore: upgrade golang to 1.22
reubenmiller May 19, 2024
733cd91
Merge pull request #375 from reubenmiller/chore-update-golang-1.22
reubenmiller May 19, 2024
7cb0179
update nodejs version
reubenmiller May 19, 2024
55bbf12
chore(dev-container): remove jfrog cli
reubenmiller May 19, 2024
b0184af
chore(dev-container): remove old comments
reubenmiller May 19, 2024
c1d203b
Merge pull request #376 from reubenmiller/chore-update-dev-container
reubenmiller May 19, 2024
7ae8801
build: update deprecated goreleaser syntax
reubenmiller May 19, 2024
7c737cc
ci: lock goreleaser version to 1.x
reubenmiller May 19, 2024
d525193
Merge pull request #377 from reubenmiller/build-update-brew-directory
reubenmiller May 19, 2024
eb31f40
fix(notification2): avoid panic due to concurrent socket writes
reubenmiller Jun 1, 2024
a17f842
Merge pull request #382 from reubenmiller/fix-notifications2-panic
reubenmiller Jun 1, 2024
4756fea
docs: fix type in set sessions example
reubenmiller Jun 7, 2024
6d785bf
Merge pull request #384 from reubenmiller/docs-fix-set-sessions-example
reubenmiller Jun 7, 2024
8ffe818
add example to access session from bitwarden
reubenmiller May 24, 2024
cdce87a
feat(sessions): support new login command
reubenmiller Jun 2, 2024
d706d3d
update go mod
reubenmiller Jun 2, 2024
7a83a43
fix stdin detection
reubenmiller Jun 8, 2024
4617dfa
code cleanup
reubenmiller Jun 8, 2024
861a2d5
feat(sessions): add alias for sessions command
reubenmiller Jun 8, 2024
3c03e0c
Merge pull request #386 from reubenmiller/feat-sessions-alias
reubenmiller Jun 8, 2024
9fa5959
add system tests
reubenmiller Jun 9, 2024
61231c2
Merge pull request #383 from reubenmiller/feat-session-providers
reubenmiller Jun 9, 2024
d8d3d98
feat(microservice): strip auto index suffixes from microservice filen…
reubenmiller Jun 9, 2024
0c8dd6e
Merge pull request #387 from reubenmiller/feat-microservice-name-parsing
reubenmiller Jun 9, 2024
a32df81
docs: generate man pages preparing for a new release
reubenmiller Jun 9, 2024
ba2dd8c
docs: use consistent sessions subcommand in all examples
reubenmiller Jun 9, 2024
ec216d6
Merge pull request #388 from reubenmiller/docs-generate-man-pages
reubenmiller Jun 9, 2024
b1b5d1e
rebuild module dependencies
reubenmiller Jun 9, 2024
d19e0c4
Merge pull request #389 from reubenmiller/fix-mod-tidy
reubenmiller Jun 9, 2024
992f45b
fix(set-session): only write json output if user provides --output json
reubenmiller Jun 10, 2024
5be6aae
Merge pull request #390 from reubenmiller/fix-set-session
reubenmiller Jun 10, 2024
5877f3f
fix(session): fix handling of non-file based sessions
reubenmiller Jun 10, 2024
73996ab
fix(sessions login): ignore existing C8Y_SESSION variable when loggin…
reubenmiller Jun 10, 2024
e01d6d4
fix(sessions): set C8Y_SESSION based on either path or sessionUri
reubenmiller Jun 10, 2024
e780324
Merge pull request #391 from reubenmiller/fix-session-file-handling
reubenmiller Jun 10, 2024
465ebff
fix: check if expiration date is nil before logging
reubenmiller Jun 13, 2024
9d01d77
Merge pull request #393 from reubenmiller/fix-session-encryption
reubenmiller Jun 14, 2024
411da2b
clear invalid tokens
reubenmiller Jun 15, 2024
ab86b03
improve logging of session errors
reubenmiller Jun 15, 2024
3085c1e
prevent panic when client is not set
reubenmiller Jun 15, 2024
2205f3e
disable encryption check when setting session
reubenmiller Jun 15, 2024
1387fe2
remove unused assignment
reubenmiller Jun 15, 2024
f2f1b87
don't fail on client setup
reubenmiller Jun 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 9 additions & 16 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM golang:1.18
FROM golang:1.22

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -20,7 +20,7 @@ COPY .devcontainer/install-powershell.sh /tmp/install/

# Configure apt, install packages and tools
RUN /tmp/install/install-powershell.sh \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
#
# Update and install packages
#
Expand Down Expand Up @@ -88,7 +88,7 @@ RUN /tmp/install/install-powershell.sh \
# Install bash tools
# https://github.com/bats-core/bats-core
&& npm install -g bats \
&& apt-get install -y jq bash-completion asciinema \
&& apt-get install -y vim jq bash-completion asciinema \
#
# Fish shell
&& apt-get install -y fish zsh \
Expand Down Expand Up @@ -121,14 +121,8 @@ RUN chown -R $USER_UID:$USER_GID /home/$USERNAME \
&& chsh -s /bin/zsh $USERNAME
COPY tools/asciinema/config /home/$USERNAME/.config/asciinema/

# Install powershell dependencies
# Install shell dependencies
USER $USERNAME
#RUN pwsh -Command "Install-Module -Name platyPS -Scope CurrentUser -Force" \
# && pwsh -Command "Install-Module -Name Pester -Scope CurrentUser -MinimumVersion '5.0.0' -Force"
#
# create symlink to c8y
# && mkdir -p /workspaces/go-c8y-cli/tools/PSc8y/dist/PSc8y/Dependencies/ \
# && ln -s /workspaces/go-c8y-cli/tools/PSc8y/dist/PSc8y/Dependencies/c8y.linux /usr/local/bin/c8y

# Install oh-my-zsh
RUN curl -sSfL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh -s -- "" --unattended 2>&1 \
Expand All @@ -144,25 +138,24 @@ RUN echo "autoload -U compinit; compinit -i" | sudo tee -a /home/$USERNAME/.zshr
#
# fish config
&& sudo mkdir -p /home/$USERNAME/.config/fish/
# && echo "c8y completion fish | source" >> /home/$USERNAME/.config/fish/config.fish
# && echo "source ~/c8y.plugin.fish" >> /home/$USERNAME/.config/fish/config.fish

# CI/CD tools
RUN cd /tmp \
&& command -v task || sudo /usr/local/go/bin/go install github.com/go-task/task/v3/cmd/task@latest \
&& sudo cp /root/go/bin/task /usr/local/bin/ \
&& sudo /usr/local/go/bin/go install github.com/goreleaser/goreleaser@latest \
&& sudo cp /root/go/bin/goreleaser /usr/local/bin/ \
&& curl -fL https://getcli.jfrog.io | sudo sh \
&& sudo chmod a+x jfrog \
&& sudo mv jfrog /usr/local/bin/
&& sudo cp /root/go/bin/goreleaser /usr/local/bin/

# Fix gopath permissions for non-root user
RUN sudo chown -R "$USERNAME:$USERNAME" /go

# Update this to "on" or "off" as appropriate
ENV GO111MODULE=auto
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

# Change default location of cumulocity profiles
ENV C8Y_HOME=/workspaces/go-c8y-cli/.go-c8y-cli
ENV C8Y_SESSION_HOME=/workspaces/go-c8y-cli/.cumulocity

# Switch back to dialog for any ad-hoc use of apt-get
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
],

// Install powershell module dependencies for tests etc.
"postCreateCommand": "sudo chown -R vscode /home/vscode",
"postCreateCommand": "task checkout-addons",

// Comment out the next line to run as root
"remoteUser": "vscode"
Expand Down
86 changes: 48 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: build

on:
push:
branches: [ master, main, next ]
branches: [ master, main, next, v2 ]
tags-ignore:
- 'v*'
paths-ignore:
Expand All @@ -11,60 +11,62 @@ on:
- test/*.go

pull_request:
branches: [ master, main, next ]
branches: [ master, main, next, v2 ]

jobs:

build:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Go 1.18
uses: actions/setup-go@v2
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.18
- name: Use Node.js 14
uses: actions/setup-node@v1
go-version: "1.22"
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 14
node-version: '20'

- name: install tooling
run: go install golang.org/x/tools/cmd/goimports@latest

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
version: latest
version: '~> v1'
install-only: true

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build cli
run: task build_powershell build-snapshot
run: task build-powershell build-snapshot
shell: bash

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: c8y.windows.amd64
path: dist/windows_windows_amd64_v1/bin/c8y*
if-no-files-found: error

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: c8y.linux.amd64
path: dist/linux_linux_amd64_v1/bin/c8y*
if-no-files-found: error

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: c8y.macos.amd64
path: dist/macos_darwin_amd64_v1/bin/c8y*
path: dist/macOS_darwin_amd64_v1/bin/c8y*
if-no-files-found: error

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: PSc8y Module
path: output_pwsh/PSc8y/
Expand All @@ -80,27 +82,31 @@ jobs:
C8Y_USER: ${{ secrets.C8Y_USER }}
C8Y_USERNAME: ${{ secrets.C8Y_USER }}
C8Y_PASSWORD: ${{ secrets.C8Y_PASSWORD }}
DEVICE_BOOTSTRAP_USER: ${{ secrets.DEVICE_BOOTSTRAP_USER }}
DEVICE_BOOTSTRAP_PASSWORD: ${{ secrets.DEVICE_BOOTSTRAP_PASSWORD }}

# Max timeout for each request (in milliseconds)
C8Y_SETTINGS_DEFAULTS_TIMEOUT: 30000

strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Go 1.18
uses: actions/setup-go@v2
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: "1.22"

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
id: download
with:
name: c8y.linux.amd64
Expand All @@ -127,54 +133,58 @@ jobs:
C8Y_TENANT: ${{ secrets.C8Y_TENANT }}
C8Y_USER: ${{ secrets.C8Y_USER }}
C8Y_PASSWORD: ${{ secrets.C8Y_PASSWORD }}
DEVICE_BOOTSTRAP_USER: ${{ secrets.DEVICE_BOOTSTRAP_USER }}
DEVICE_BOOTSTRAP_PASSWORD: ${{ secrets.DEVICE_BOOTSTRAP_PASSWORD }}

# Max timeout for each request (in milliseconds)
C8Y_SETTINGS_DEFAULTS_TIMEOUT: 30000

strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04]
os: [macos-latest, windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Go 1.18
uses: actions/setup-go@v2
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: "1.22"

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build powershell module
run: task build_powershell build-snapshot
run: task build-powershell build-snapshot
shell: bash

- name: Test powershell module
if: ${{ true }}
run: task test_powershell test_powershell_sessions
run: task test-powershell
shell: bash
timeout-minutes: 30

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}
path: tools/PSc8y/reports/*.xml

publish-test-results:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: [test-pwsh]
# Disabled as pester does not support junit reports (only nunit)
if: always() && false
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04]
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Get test results
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: test-results-${{ matrix.os }}
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/publish-linux-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,35 @@ jobs:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}

publish-nuget:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Go 1.18
uses: actions/setup-go@v2
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: "1.22"

- name: install tooling
run: go install golang.org/x/tools/cmd/goimports@latest

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
version: latest
version: '~> v1'
install-only: true

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build Powershell Module
run: task generate build

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: ReleaseArtifacts
path: |
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go 1.18
uses: actions/setup-go@v2
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: "1.22"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Install Task
uses: arduino/setup-task@v1
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: install tooling
run: go install golang.org/x/tools/cmd/goimports@latest

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
version: latest
version: '~> v1'
install-only: true

- name: Publish Release
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ test/c8y_test/debug.test
test/c8y_test/application.setup.properties
.cumulocity/
temp-example/
*.tmp
c8y.env
c8y.activitylog.*.json
c8y~
Expand Down
Loading