Skip to content

Commit a563190

Browse files
authored
2.x: Wiki update, removed yarn, using ce-dev-ce-provision-config 2.x (#209)
* 2.x: Fixed some bits about localgov * 2.x: Getting the latest release available per branch * 2.x: Removed yarn from doc and other old stuff * 2.x: Fixed devel tag * 2.x: Using ce-dev-ce-provision-config 2.x * 2.x: Added new param ansible_collection_dir * 2.x: Added missing var to ce_deploy too
1 parent c5b822b commit a563190

File tree

9 files changed

+40
-26
lines changed

9 files changed

+40
-26
lines changed

README.md

+17-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ ce-dev 2.x
22
======
33
Local Stack wrapper tool
44

5-
[![2.x: Linux - Build ce_dev binaries, images and templates (test)](https://github.com/codeenigma/ce-dev/actions/workflows/ce-dev-devel-linux.yml/badge.svg?branch=devel-2.x)](https://github.com/codeenigma/ce-dev/actions/workflows/ce-dev-devel-linux.yml)
5+
[![2.x: Ubuntu - Test image builds on PR](https://github.com/codeenigma/ce-dev/actions/workflows/ubuntu-pr.yml/badge.svg)](https://github.com/codeenigma/ce-dev/actions/workflows/ubuntu-pr.yml)
6+
7+
[![devel-2.x: Ubuntu - Test image builds on PR](https://github.com/codeenigma/ce-dev/actions/workflows/devel-ubuntu-pr.yml/badge.svg)](https://github.com/codeenigma/ce-dev/actions/workflows/devel-ubuntu-pr.yml)
8+
69
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=codeenigma_ce-dev&metric=security_rating)](https://sonarcloud.io/dashboard?id=codeenigma_ce-dev)
710
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=codeenigma_ce-dev&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=codeenigma_ce-dev)
811
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=codeenigma_ce-dev&metric=bugs)](https://sonarcloud.io/dashboard?id=codeenigma_ce-dev)
@@ -18,6 +21,7 @@ Local Stack wrapper tool
1821
* Removed drupal 8 and drupal 9 templates.
1922
* The way to assign IPs have changed.
2023
* All the packages used are up to date.
24+
* Removed yarn as dependency.
2125

2226
## Key features
2327
- Allows several projects (or the host) to re-use the same ports
@@ -48,8 +52,8 @@ Once you make your changes in the source dode ({root}/src folder), you need to c
4852
execute the following commands:
4953

5054
```
51-
yarn clean
52-
yarn build
55+
npm run clean
56+
npm run build
5357
```
5458

5559
This will clean and compile the new js files. A new folder {root}/lib is generated
@@ -77,9 +81,6 @@ it means you would need to have the local docker images with tag 2.x
7781
dioni@dionice:~/projects/wrap$ docker image ls
7882
[sudo] contraseña para dioni:
7983
REPOSITORY TAG IMAGE ID CREATED SIZE
80-
codeenigma/drupal10-db 2.x 5cae51ec65c0 3 days ago 409MB
81-
codeenigma/drupal10-web 2.x 83cc832fb73d 3 days ago 1.47GB
82-
codeenigma/blank-blank 2.x 5157934972ad 3 days ago 1.26GB
8384
codeenigma/ce-dev 2.x 8753195771fc 3 days ago 691MB
8485
codeenigma/ce-dev-controller 2.x 5aed115a5e74 3 days ago 1.83GB
8586
```
@@ -95,22 +96,16 @@ If you don't have the local images, you can follow these steps:
9596
```angular2html
9697
/bin/sh docker-images/export.sh --version 2.x --image-name ce-dev --dockerfile-path base
9798
/bin/sh docker-images/export.sh --version 2.x --image-name ce-dev-controller --dockerfile-path controller
98-
/bin/sh templates/test.sh --template ce-dev.compose.yml
9999
```
100100

101-
The last step will generate the drupal10-web, drupal10-db and blank docker images. Also, it will create docker containers
102-
with the same name. You can remove these containers because we only need the images.
103-
104-
Now we can start to test our ce-dev changes as it is described in the previous point 'How to compile'
105-
106101

107102
### Testing a new ce-dev release locally.
108103

109104
If you need to test the creation of releases locally, we can do it using oclif.
110105

111106
oclif is an open source framework for building a command line interface (CLI) in Node.js and Typescript https://oclif.io/
112107

113-
As part of the command we used ```yarn build```, a folder /lib was generated. This folder contains the javascript code
108+
As part of the command we used ```npm run build```, a folder /lib was generated. This folder contains the javascript code
114109
used by oclif.
115110

116111
According to your system, your local ce-dev version will be different. Here the list of available targets:
@@ -127,7 +122,15 @@ Probably you will use linux-...64 or darwin-...64 version.
127122

128123
Use oclif pack to generate a new release for your system:
129124

130-
i.e: <code>yarn oclif pack tarballs --targets=linux-x64 --no-xz</code>
125+
i.e:
126+
<code>
127+
128+
npm run prepack-oclif
129+
130+
npx oclif pack tarballs --targets=linux-x64 --no-xz
131+
132+
npm run postpack-oclif
133+
</code>
131134

132135
This will generate a tar.gz file inside a new directory named /dir/ce-dev-xxxxxx
133136
You can un-compress and put it where you want. i.e: you can put it in /opt too (where you have the current ce-dev)

RELEASE

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
2.0.1
1+
2.0.2
22

3-
## Changes since 2.0.0
3+
## Changes since 2.0.1
44

5-
* Added Drupal 11 template
5+
* Using https://github.com/codeenigma/ce-dev-ce-provision-config 2.x
6+
* Removed yarn as dependency, using only npm
67
* Updated references to 2.x-devel with devel-2.x

docker-images/controller-ci/provision.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
own_repository_branch: 2.x
2020
own_repository_skip_checkout: false
2121
config_repository: https://github.com/codeenigma/ce-dev-ce-provision-config.git
22-
config_repository_branch: 1.x
22+
config_repository_branch: 2.x
2323
config_repository_skip_checkout: false
2424
username: "{{ _ce_provision_username }}"
2525
install_username: "{{ _ce_provision_username }}"
@@ -30,6 +30,7 @@
3030
ssh_key_type: rsa
3131
aws_support: true
3232
local_dir: /home/controller/ce-provision
33+
ansible_collections_dir: "/home/ce-dev/ce-deploy/galaxy/ansible_collections"
3334
groups: []
3435
contrib_roles:
3536
- directory: wazuh

docker-images/controller-devel/provision.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
new_user: true
2626
key_name: id_rsa.pub
2727
local_dir: /home/ce-dev/ce-deploy
28+
ansible_collections_dir: "/home/ce-dev/ce-deploy/galaxy/ansible_collections"
2829
ce_provision_dir: "/home/ce-dev/ce-provision"
2930
groups: []
3031
galaxy_custom_requirements_file: ""
@@ -42,7 +43,7 @@
4243
own_repository_branch: 2.x
4344
own_repository_skip_checkout: false
4445
config_repository: https://github.com/codeenigma/ce-dev-ce-provision-config.git
45-
config_repository_branch: 1.x
46+
config_repository_branch: 2.x
4647
config_repository_skip_checkout: false
4748
username: "{{ _ce_provision_username }}"
4849
install_username: "{{ _ce_provision_username }}"
@@ -53,6 +54,7 @@
5354
ssh_key_type: rsa
5455
aws_support: true
5556
local_dir: /home/ce-dev/ce-provision
57+
ansible_collections_dir: "/home/ce-dev/ce-deploy/galaxy/ansible_collections"
5658
groups: []
5759
contrib_roles:
5860
- directory: wazuh

docker-images/controller/provision.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
new_user: true
2626
key_name: id_rsa.pub
2727
local_dir: /home/ce-dev/ce-deploy
28+
ansible_collections_dir: "/home/ce-dev/ce-deploy/galaxy/ansible_collections"
2829
ce_provision_dir: "/home/ce-dev/ce-provision"
2930
groups: []
3031
galaxy_custom_requirements_file: ""
@@ -42,7 +43,7 @@
4243
own_repository_branch: 2.x
4344
own_repository_skip_checkout: false
4445
config_repository: https://github.com/codeenigma/ce-dev-ce-provision-config.git
45-
config_repository_branch: 1.x
46+
config_repository_branch: 2.x
4647
config_repository_skip_checkout: false
4748
username: "{{ _ce_provision_username }}"
4849
install_username: "{{ _ce_provision_username }}"
@@ -53,6 +54,7 @@
5354
ssh_key_type: rsa
5455
aws_support: true
5556
local_dir: /home/ce-dev/ce-provision
57+
ansible_collections_dir: "/home/ce-dev/ce-deploy/galaxy/ansible_collections"
5658
groups: []
5759
contrib_roles:
5860
- directory: wazuh

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ce-dev",
33
"description": "Local Stack wrapper tool",
4-
"version": "2.0.1",
4+
"version": "2.0.2",
55
"author": "Codeenigma",
66
"bin": "./bin/run.js",
77
"bugs": "https://github.com/codeenigma/ce-dev/issues",

src/commands/build.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ export default class BuildCmd extends BaseCmd {
7979
if (this.composeConfig['x-ce_dev']) {
8080
containerName = this.composeConfig['x-ce_dev'].project_name + '-' + name
8181
}
82+
8283
let version = AppSettings.ceDevVersion + '.x'
8384
if (this.developmentMode) {
84-
version += '-devel'
85+
version = 'devel-' + version
8586
}
8687

8788
ux.action.start('Committing container ' + containerName + ' as a new image.')
@@ -98,8 +99,9 @@ export default class BuildCmd extends BaseCmd {
9899
private generateCompose(): void {
99100
let version = AppSettings.ceDevVersion + '.x'
100101
if (this.developmentMode) {
101-
version += '-devel'
102+
version = 'devel-' + version
102103
}
104+
103105
ux.action.start('Generating new compose file ' + this.composeDest + '.')
104106
for (const [name, service] of Object.entries(this.composeConfig.services)) {
105107
const containerName = this.composeConfig['x-ce_dev'].project_name + '-' + name

src/commands/push.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ export default class PushCmd extends DockerImagesCmd {
5050
private push(): void {
5151
let version = AppSettings.ceDevVersion + '.x'
5252
if (this.developmentMode) {
53-
version += '-devel'
53+
version = 'devel-' + version
5454
}
55+
5556
for (const name of Object.keys(this.composeConfig.services)) {
5657
const containerName = this.composeConfig['x-ce_dev'].project_name + '-' + name
5758
ux.action.start('Pushing image ' + containerName)

src/controller-manager.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ export default class ControllerManager {
250250
// If in development mode, we use devel version.
251251
let version = AppSettings.ceDevVersion + '.x';
252252
if (this.developmentMode) {
253-
version += '-devel';
253+
version = 'devel-' + version
254254
}
255+
255256
execSync(this.dockerBin + ' pull codeenigma/ce-dev-controller:' + version, {
256257
stdio: 'inherit',
257258
})
@@ -261,8 +262,9 @@ export default class ControllerManager {
261262
const ipManager = new IPManager(this.config, this.dockerBin)
262263
let version = AppSettings.ceDevVersion + '.x'
263264
if (this.developmentMode) {
264-
version += '-devel'
265+
version = 'devel-' + version
265266
}
267+
266268
return {
267269
networks: {
268270
ce_dev: {

0 commit comments

Comments
 (0)