@fishawack/lab-env 5.6.1 → 5.7.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +136 -0
  2. package/_Test/boilerplate-adonis.js +1 -1
  3. package/_Test/boilerplate-craftcms.js +1 -1
  4. package/_Test/boilerplate-drupal.js +1 -1
  5. package/_Test/boilerplate-laravel.js +1 -1
  6. package/_Test/boilerplate-python.js +1 -1
  7. package/_Test/boilerplate-wordpress.js +1 -1
  8. package/_Test/boilerplate.js +1 -1
  9. package/_Test/provision.js +4 -9
  10. package/_Test/prune.js +8 -5
  11. package/bitbucket-pipelines.yml +2 -2
  12. package/cli.js +2 -0
  13. package/commands/create/cmds/dekey.js +13 -9
  14. package/commands/create/cmds/deprovision.js +66 -6
  15. package/commands/create/cmds/diagnose.js +10 -0
  16. package/commands/create/cmds/key.js +74 -41
  17. package/commands/create/cmds/provision.js +641 -22
  18. package/commands/create/cmds/rekey.js +283 -0
  19. package/commands/create/cmds/sync-secrets.js +198 -0
  20. package/commands/create/libs/output-credentials.js +59 -0
  21. package/commands/create/libs/parallel-runner.js +296 -0
  22. package/commands/create/libs/resolve-operator.js +59 -0
  23. package/commands/create/libs/utilities.js +75 -8
  24. package/commands/create/libs/vars.js +273 -377
  25. package/commands/create/services/aws/acm.js +61 -0
  26. package/commands/create/services/aws/cloudfront.js +51 -45
  27. package/commands/create/services/aws/ec2.js +781 -5
  28. package/commands/create/services/aws/elasticache.js +159 -0
  29. package/commands/create/services/aws/elasticbeanstalk.js +200 -48
  30. package/commands/create/services/aws/iam.js +430 -82
  31. package/commands/create/services/aws/index.js +1598 -100
  32. package/commands/create/services/aws/opensearch.js +155 -0
  33. package/commands/create/services/aws/rds.js +272 -0
  34. package/commands/create/services/aws/s3.js +52 -31
  35. package/commands/create/services/aws/secretsmanager.js +82 -0
  36. package/commands/create/services/aws/ses.js +203 -0
  37. package/commands/create/templates/elasticbeanstalk/.ebextensions/laravel/cron.config +45 -0
  38. package/commands/create/templates/elasticbeanstalk/.ebextensions/laravel/queue-worker.config +29 -0
  39. package/commands/create/templates/elasticbeanstalk/.ebextensions/laravel/rds-ssl.config +5 -0
  40. package/commands/create/templates/elasticbeanstalk/.ebextensions/laravel/software.config +12 -0
  41. package/commands/create/templates/elasticbeanstalk/.ebextensions/misc/setvars.config +1 -0
  42. package/commands/create/templates/elasticbeanstalk/.platform/confighooks/postdeploy/restart_queue.sh +4 -0
  43. package/commands/create/templates/elasticbeanstalk/.platform/confighooks/postdeploy/rewrite-flush.sh +1 -1
  44. package/commands/create/templates/elasticbeanstalk/.platform/confighooks/prebuild/setvars.sh +19 -0
  45. package/commands/create/templates/elasticbeanstalk/.platform/hooks/postdeploy/restart_queue.sh +4 -0
  46. package/commands/create/templates/elasticbeanstalk/.platform/hooks/prebuild/setvars.sh +19 -0
  47. package/commands/scan.js +1 -1
  48. package/core/1/CHANGELOG.md +41 -0
  49. package/core/1/Dockerfile +3 -3
  50. package/core/1/bitbucket-pipelines.yml +5 -5
  51. package/core/1/package.json +1 -1
  52. package/globals.js +4 -0
  53. package/package.json +9 -2
@@ -0,0 +1,203 @@
1
+ const crypto = require("crypto");
2
+ const os = require("os");
3
+ const { readFileSync, writeFileSync } = require("fs");
4
+ const { SESClient, ListIdentitiesCommand } = require("@aws-sdk/client-ses");
5
+ const {
6
+ IAMClient,
7
+ CreateUserCommand,
8
+ GetUserCommand,
9
+ CreateAccessKeyCommand,
10
+ ListAccessKeysCommand,
11
+ DeleteAccessKeyCommand,
12
+ AddUserToGroupCommand,
13
+ } = require("@aws-sdk/client-iam");
14
+ const { fromIni } = require("@aws-sdk/credential-providers");
15
+ const { Spinner } = require("../../libs/utilities");
16
+
17
+ const SES_REGION = "us-east-1";
18
+ const SES_PROFILE = "fishawack";
19
+
20
+ const getClient = () =>
21
+ new SESClient({
22
+ region: SES_REGION,
23
+ credentials: fromIni({ profile: SES_PROFILE }),
24
+ });
25
+
26
+ module.exports.listVerifiedIdentities = async () => {
27
+ const client = getClient();
28
+
29
+ const res = await Spinner.prototype.simple(
30
+ "Retrieving verified SES identities",
31
+ () => {
32
+ return client.send(
33
+ new ListIdentitiesCommand({ IdentityType: "Domain" }),
34
+ );
35
+ },
36
+ );
37
+
38
+ return res.Identities || [];
39
+ };
40
+
41
+ /**
42
+ * Derives an SES SMTP password from an IAM secret access key.
43
+ * Uses the standard AWS SES SMTP credential derivation algorithm.
44
+ * https://docs.aws.amazon.com/ses/latest/dg/smtp-credentials.html
45
+ */
46
+ module.exports.deriveSmtpPassword = (secretAccessKey, region = SES_REGION) => {
47
+ const VERSION = Buffer.from([0x04]);
48
+ const date = "11111111";
49
+ const service = "ses";
50
+ const terminal = "aws4_request";
51
+ const message = "SendRawEmail";
52
+
53
+ let signature = Buffer.from(`AWS4${secretAccessKey}`, "utf8");
54
+ for (const element of [date, region, service, terminal, message]) {
55
+ signature = crypto
56
+ .createHmac("sha256", signature)
57
+ .update(element)
58
+ .digest();
59
+ }
60
+
61
+ return Buffer.concat([VERSION, signature]).toString("base64");
62
+ };
63
+
64
+ const SES_SMTP_HOST = "email-smtp.us-east-1.amazonaws.com";
65
+ const SES_GROUP = "AWSSESSendingGroupDoNotRename";
66
+
67
+ const getIAMClient = () =>
68
+ new IAMClient({
69
+ region: SES_REGION,
70
+ credentials: fromIni({ profile: SES_PROFILE }),
71
+ });
72
+
73
+ module.exports.ensureOperatorSESCredentials = async (username) => {
74
+ const UserName = `fw-auto-${username}-operator`;
75
+ const client = getIAMClient();
76
+
77
+ // Create user (or confirm it already exists)
78
+ try {
79
+ await Spinner.prototype.simple(
80
+ `Creating SES IAM user ${UserName}`,
81
+ () => client.send(new CreateUserCommand({ UserName })),
82
+ );
83
+ } catch {
84
+ await Spinner.prototype.simple(
85
+ `Retrieving existing SES IAM user ${UserName}`,
86
+ () => client.send(new GetUserCommand({ UserName })),
87
+ );
88
+ }
89
+
90
+ // Add user to SES sending group
91
+ await Spinner.prototype.simple(`Adding ${UserName} to ${SES_GROUP}`, () =>
92
+ client.send(
93
+ new AddUserToGroupCommand({ UserName, GroupName: SES_GROUP }),
94
+ ),
95
+ );
96
+
97
+ // Check for existing keys
98
+ const existing = await client.send(new ListAccessKeysCommand({ UserName }));
99
+
100
+ if (existing.AccessKeyMetadata.length) {
101
+ return null;
102
+ }
103
+
104
+ // Create access key and derive SMTP password
105
+ const keyRes = await Spinner.prototype.simple(
106
+ "Creating access key for SES user",
107
+ () => client.send(new CreateAccessKeyCommand({ UserName })),
108
+ );
109
+
110
+ const smtpPassword = module.exports.deriveSmtpPassword(
111
+ keyRes.AccessKey.SecretAccessKey,
112
+ );
113
+
114
+ // Wait for IAM credentials to propagate across AWS services
115
+ await Spinner.prototype.simple(
116
+ "Waiting for IAM credentials to propagate",
117
+ () => new Promise((r) => setTimeout(r, 10000)),
118
+ );
119
+
120
+ return {
121
+ username: keyRes.AccessKey.AccessKeyId,
122
+ password: smtpPassword,
123
+ host: SES_SMTP_HOST,
124
+ };
125
+ };
126
+
127
+ module.exports.rotateOperatorSESCredentials = async (username) => {
128
+ const UserName = `fw-auto-${username}-operator`;
129
+ const client = getIAMClient();
130
+
131
+ // List and delete existing keys
132
+ const existing = await Spinner.prototype.simple(
133
+ `Listing access keys for ${UserName}`,
134
+ () => client.send(new ListAccessKeysCommand({ UserName })),
135
+ );
136
+
137
+ for (const key of existing.AccessKeyMetadata) {
138
+ await Spinner.prototype.simple(
139
+ `Removing old access key ${key.AccessKeyId}`,
140
+ () =>
141
+ client.send(
142
+ new DeleteAccessKeyCommand({
143
+ UserName,
144
+ AccessKeyId: key.AccessKeyId,
145
+ }),
146
+ ),
147
+ );
148
+ }
149
+
150
+ // Create new access key and derive SMTP password
151
+ const keyRes = await Spinner.prototype.simple(
152
+ "Creating new access key for SES user",
153
+ () => client.send(new CreateAccessKeyCommand({ UserName })),
154
+ );
155
+
156
+ const smtpPassword = module.exports.deriveSmtpPassword(
157
+ keyRes.AccessKey.SecretAccessKey,
158
+ );
159
+
160
+ // Wait for IAM credentials to propagate across AWS services
161
+ await Spinner.prototype.simple(
162
+ "Waiting for IAM credentials to propagate",
163
+ () => new Promise((r) => setTimeout(r, 10000)),
164
+ );
165
+
166
+ return {
167
+ username: keyRes.AccessKey.AccessKeyId,
168
+ password: smtpPassword,
169
+ host: SES_SMTP_HOST,
170
+ };
171
+ };
172
+
173
+ const SES_FROM = "digitalautomation@avalerehealth.com";
174
+ const MISC_PATH = `${os.homedir()}/targets/misc.json`;
175
+
176
+ module.exports.updateMiscNodemailer = (creds) => {
177
+ const { misc } = require("../../libs/vars");
178
+
179
+ let file = {};
180
+
181
+ try {
182
+ file = JSON.parse(readFileSync(MISC_PATH, { encoding: "utf8" }));
183
+ } catch {
184
+ const { mkdirSync } = require("fs");
185
+ mkdirSync(require("path").dirname(MISC_PATH), { recursive: true });
186
+ file = { bitbucket: {}, gitlab: {} };
187
+ }
188
+
189
+ file.nodemailer = {
190
+ driver: "AWSSES",
191
+ AWSSES: {
192
+ username: creds.username,
193
+ password: creds.password,
194
+ host: creds.host,
195
+ },
196
+ from: SES_FROM,
197
+ };
198
+
199
+ writeFileSync(MISC_PATH, JSON.stringify(file, null, 4));
200
+
201
+ // Mutate the in-memory misc object so email.js picks up fresh creds
202
+ misc.nodemailer = file.nodemailer;
203
+ };
@@ -0,0 +1,45 @@
1
+ files:
2
+ "/usr/local/bin/is_first_instance.sh":
3
+ mode: "000755"
4
+ owner: root
5
+ group: root
6
+ content: |
7
+ #!/bin/bash
8
+ # Get IMDSv2 token (required on Amazon Linux 2023)
9
+ TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" 2>/dev/null)
10
+
11
+ INSTANCE_ID=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id 2>/dev/null)
12
+ REGION=$(curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/dynamic/instance-identity/document 2>/dev/null | jq -r .region)
13
+
14
+ # Find the Auto Scaling Group name from the Elastic Beanstalk environment
15
+ ASG=$(aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" \
16
+ --region "$REGION" --output json | jq -r '.[][] | select(.Key=="aws:autoscaling:groupName") | .Value')
17
+
18
+ # Find the first instance in the Auto Scaling Group
19
+ FIRST=$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names "$ASG" \
20
+ --region "$REGION" --output json | \
21
+ jq -r '.AutoScalingGroups[].Instances[] | select(.LifecycleState=="InService") | .InstanceId' | sort | head -1)
22
+
23
+ # If the instance ids are the same exit 0
24
+ [ "$FIRST" = "$INSTANCE_ID" ]
25
+
26
+ "/usr/local/bin/laravel_cron.sh":
27
+ mode: "000755"
28
+ owner: root
29
+ group: root
30
+ content: |
31
+ #!/bin/bash
32
+ /usr/local/bin/is_first_instance.sh || exit
33
+ cd /var/app/current && echo $(date -u) $(php artisan schedule:run)
34
+
35
+ "/etc/cron.d/laravel_cron":
36
+ mode: "000644"
37
+ owner: root
38
+ group: root
39
+ content: |
40
+ * * * * * root bash -l /usr/local/bin/laravel_cron.sh >> /var/log/laravel_cron.log 2>&1
41
+
42
+ commands:
43
+ rm_old_cron:
44
+ command: "rm -f /etc/cron.d/laravel_cron.bak"
45
+ ignoreErrors: true
@@ -0,0 +1,29 @@
1
+ files:
2
+ "/etc/systemd/system/queue-worker.service":
3
+ mode: "000644"
4
+ owner: root
5
+ group: root
6
+ content: |
7
+ [Unit]
8
+ Description=Laravel Queue Worker
9
+ After=network.target php-fpm.service
10
+
11
+ [Service]
12
+ User=webapp
13
+ Group=webapp
14
+ WorkingDirectory=/var/app/current
15
+ EnvironmentFile=/etc/sysconfig/env
16
+ ExecStart=/usr/bin/php /var/app/current/artisan queue:work --timeout=620 --tries=1
17
+ Restart=always
18
+ RestartSec=5
19
+ StandardOutput=append:/var/log/queue-worker.log
20
+ StandardError=append:/var/log/queue-worker.log
21
+
22
+ [Install]
23
+ WantedBy=multi-user.target
24
+
25
+ commands:
26
+ 01_systemd_reload:
27
+ command: systemctl daemon-reload
28
+ 02_enable_queue:
29
+ command: systemctl enable queue-worker
@@ -0,0 +1,5 @@
1
+ commands:
2
+ 01-download-rds-cert:
3
+ command: |
4
+ mkdir -p /opt/rds-certs
5
+ curl -so /opt/rds-certs/global-bundle.pem https://truststore.pki.rds.amazonaws.com/global/global-bundle.pem
@@ -1,4 +1,16 @@
1
+ packages:
2
+ yum:
3
+ jq: []
4
+ mariadb105: []
5
+
6
+ commands:
7
+ 01_install_phpredis:
8
+ command: "yum install -y php$(php -r 'echo PHP_MAJOR_VERSION.\".\".PHP_MINOR_VERSION;')-pecl-redis6"
9
+ test: "! php -m | grep -q redis"
10
+
1
11
  option_settings:
12
+ aws:elasticbeanstalk:application:environment:
13
+ BASH_ENV: /etc/profile.d/sh.local
2
14
  aws:elasticbeanstalk:container:php:phpini:
3
15
  document_root: /public
4
16
  aws:elasticbeanstalk:environment:proxy:
@@ -6,6 +6,7 @@ commands:
6
6
  setvars:
7
7
  command: |
8
8
  /opt/elasticbeanstalk/bin/get-config environment | jq -r "to_entries | .[] | \"export \(.key)='\(.value)'\"" > /etc/profile.d/sh.local
9
+ /opt/elasticbeanstalk/bin/get-config environment | jq -r 'to_entries | .[] | "\(.key)=\"\(.value)\""' > /etc/sysconfig/env
9
10
 
10
11
  packages:
11
12
  yum:
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ systemctl restart queue-worker
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash
2
2
 
3
3
  # Flush rewrites to recreate .htaccess files for existing permalink structure
4
- wp rewrite flush --hard || true
4
+ wp rewrite flush --hard || true
@@ -0,0 +1,19 @@
1
+ #!/bin/bash
2
+
3
+ ENV_NAME=$(/opt/elasticbeanstalk/bin/get-config container -k environment_name)
4
+ SECRET_ENV=${SECRET_MIRROR_ENV:-$ENV_NAME}
5
+ REGION=$(TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") && curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/region)
6
+
7
+ > /etc/profile.d/sh.local
8
+ > /etc/sysconfig/env
9
+
10
+ for GROUP in <%= SECRET_GROUPS %>; do
11
+ SECRET_JSON=$(aws secretsmanager get-secret-value \
12
+ --secret-id "${SECRET_ENV}-${GROUP}" \
13
+ --region "$REGION" \
14
+ --query SecretString \
15
+ --output text 2>/dev/null) || continue
16
+
17
+ echo "$SECRET_JSON" | jq -r 'to_entries | .[] | "export \(.key)='"'"'\(.value)'"'"'"' >> /etc/profile.d/sh.local
18
+ echo "$SECRET_JSON" | jq -r 'to_entries | .[] | "\(.key)=\"\(.value)\""' >> /etc/sysconfig/env
19
+ done
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ systemctl restart queue-worker
@@ -0,0 +1,19 @@
1
+ #!/bin/bash
2
+
3
+ ENV_NAME=$(/opt/elasticbeanstalk/bin/get-config container -k environment_name)
4
+ SECRET_ENV=${SECRET_MIRROR_ENV:-$ENV_NAME}
5
+ REGION=$(TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") && curl -s -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/region)
6
+
7
+ > /etc/profile.d/sh.local
8
+ > /etc/sysconfig/env
9
+
10
+ for GROUP in <%= SECRET_GROUPS %>; do
11
+ SECRET_JSON=$(aws secretsmanager get-secret-value \
12
+ --secret-id "${SECRET_ENV}-${GROUP}" \
13
+ --region "$REGION" \
14
+ --query SecretString \
15
+ --output text 2>/dev/null) || continue
16
+
17
+ echo "$SECRET_JSON" | jq -r 'to_entries | .[] | "export \(.key)='"'"'\(.value)'"'"'"' >> /etc/profile.d/sh.local
18
+ echo "$SECRET_JSON" | jq -r 'to_entries | .[] | "\(.key)=\"\(.value)\""' >> /etc/sysconfig/env
19
+ done
package/commands/scan.js CHANGED
@@ -32,7 +32,7 @@ const run = () => {
32
32
  });
33
33
 
34
34
  if (failed) {
35
- if (_.coreConfig.attributes.failOnScanErrors) {
35
+ if (_.coreConfig?.attributes?.failOnScanErrors) {
36
36
  throw new Error(
37
37
  "Scan found issues. Failing the build as failOnScanErrors flag is set to true.",
38
38
  );
@@ -1,5 +1,46 @@
1
1
  ## Changelog
2
2
 
3
+ ### 1.10.4 (2026-08-21)
4
+
5
+ #### Bug Fixes
6
+
7
+ * switch back to access token for prs ([7a0ecee](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/7a0ecee2f07a899a3d30e5c80ece39d096b660b0))
8
+
9
+ ### 1.10.4-beta.1 (2026-08-21)
10
+
11
+ #### Bug Fixes
12
+
13
+ * switch back to access token for prs ([7a0ecee](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/7a0ecee2f07a899a3d30e5c80ece39d096b660b0))
14
+
15
+ ### 1.10.3 (2026-08-21)
16
+
17
+ #### Bug Fixes
18
+
19
+ * use new bitbucket token instead of git credentials ([bb1a48b](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/bb1a48be086554fd8fa16a22f27968fd8938d7bc))
20
+
21
+ ### 1.10.2 (2026-08-21)
22
+
23
+ #### Bug Fixes
24
+
25
+ * drop support for watertight ([fd584bc](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/fd584bc838b89da6ea7306e19a8bef0d99e1405c))
26
+
27
+ ### 1.10.1-beta.2 (2026-08-21)
28
+
29
+ #### Bug Fixes
30
+
31
+ * drop support for watertight ([fd584bc](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/fd584bc838b89da6ea7306e19a8bef0d99e1405c))
32
+ ### 1.10.1 (2026-08-21)
33
+
34
+ #### Bug Fixes
35
+
36
+ * allow git install from npm now the default is to block them ([de7783a](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/de7783aae76baa52db6b6497b2ae75b4a6198837))
37
+
38
+ ### 1.10.1-beta.1 (2026-08-21)
39
+
40
+ #### Bug Fixes
41
+
42
+ * allow git install from npm now the default is to block them ([de7783a](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/de7783aae76baa52db6b6497b2ae75b4a6198837))
43
+
3
44
  ### 1.10.0 (2026-02-20)
4
45
 
5
46
  #### Features
package/core/1/Dockerfile CHANGED
@@ -34,6 +34,9 @@ ENV GIT_DISCOVERY_ACROSS_FILESYSTEM=1
34
34
  # Disable npm message about updates being available
35
35
  RUN su node -c "npm config set update-notifier false"
36
36
 
37
+ # Allow installing from git repos
38
+ RUN su node -c "npm config set allow-git all"
39
+
37
40
  # Add node user to www-data group
38
41
  RUN usermod -a -G www-data node
39
42
 
@@ -108,9 +111,6 @@ RUN npm install -g electron-packager@latest
108
111
  RUN apt-get install -y wine64 && \
109
112
  ln -s /usr/bin/wine /usr/bin/wine64
110
113
 
111
- # Install watertight
112
- RUN --mount=type=ssh npm install -g git+ssh://git@bitbucket.org/fishawackdigital/watertight-node-auto.git#v6.0.0
113
-
114
114
  # Cleanup apt-get install folders
115
115
  RUN apt-get clean && \
116
116
  rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@@ -19,7 +19,7 @@ pipelines:
19
19
  - npm install -g semantic-release@24 @semantic-release/changelog@6 @semantic-release/git@10 conventional-changelog-conventionalcommits@8
20
20
  # Release version via node so can exit out when no release made
21
21
  - |
22
- node -e "const spawn = require('child_process').spawn('semantic-release', ['--repositoryUrl', 'https://$GIT_CREDENTIALS@bitbucket.org/$BITBUCKET_REPO_FULL_NAME'], { env: { ...process.env, FORCE_COLOR: true } }); spawn.stderr.on('data', d => process.stderr.write(d.toString())); spawn.stdout.on('data', d => {process.stdout.write(d.toString()); if(d.toString().includes('There are no relevant changes, so no new version is released.') || d.toString().includes('therefore a new version won\'t be published.')){process.exit(1);}})" || exit 0
22
+ node -e "const spawn = require('child_process').spawn('semantic-release', ['--repositoryUrl', 'https://x-bitbucket-api-token-auth:$BITBUCKET_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME'], { env: { ...process.env, FORCE_COLOR: true } }); spawn.stderr.on('data', d => process.stderr.write(d.toString())); spawn.stdout.on('data', d => {process.stdout.write(d.toString()); if(d.toString().includes('There are no relevant changes, so no new version is released.') || d.toString().includes('therefore a new version won\'t be published.')){process.exit(1);}})" || exit 0
23
23
  # Copy ssh keys so physical files exist for agent to use
24
24
  - cp /build/*/ssh/* ~/.ssh/
25
25
  # Start ssh agent and add all (if any) keys
@@ -29,7 +29,7 @@ pipelines:
29
29
  # Open PR to re-sync beta after release
30
30
  - |
31
31
  curl https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/pullrequests \
32
- -u $GIT_CREDENTIALS \
32
+ --header "Authorization: Bearer $BITBUCKET_ACCESS_TOKEN" \
33
33
  --header 'Content-Type: application/json' \
34
34
  --data "{
35
35
  \"title\": \"fw-auto: sync beta after release\",
@@ -54,7 +54,7 @@ pipelines:
54
54
  # Commit and create pull request for new version on lab-env repo
55
55
  - git config --global user.email "digital@fishawack.com"
56
56
  - git config --global user.name "Digital Fishawack"
57
- - git clone https://$GIT_CREDENTIALS@bitbucket.org/fishawackdigital/lab-env
57
+ - git clone https://x-bitbucket-api-token-auth:$BITBUCKET_TOKEN@bitbucket.org/fishawackdigital/lab-env
58
58
  - cd lab-env
59
59
  - git checkout -b "$BITBUCKET_REPO_SLUG-$BITBUCKET_COMMIT" origin/beta
60
60
  - git submodule init
@@ -66,7 +66,7 @@ pipelines:
66
66
  - git push origin "$BITBUCKET_REPO_SLUG-$BITBUCKET_COMMIT"
67
67
  - |
68
68
  curl https://api.bitbucket.org/2.0/repositories/fishawackdigital/lab-env/pullrequests \
69
- -u $GIT_CREDENTIALS \
69
+ --header "Authorization: Bearer $BITBUCKET_ACCESS_TOKEN" \
70
70
  --header 'Content-Type: application/json' \
71
71
  --data "{
72
72
  \"title\": \"Bumped $BITBUCKET_REPO_SLUG\",
@@ -102,4 +102,4 @@ pipelines:
102
102
  - npm install -g semantic-release@24 @semantic-release/changelog@6 @semantic-release/git@10 conventional-changelog-conventionalcommits@8
103
103
  # Release version via node so can exit out when no release made
104
104
  - |
105
- node -e "const spawn = require('child_process').spawn('semantic-release', ['--repositoryUrl', 'https://$GIT_CREDENTIALS@bitbucket.org/$BITBUCKET_REPO_FULL_NAME'], { env: { ...process.env, FORCE_COLOR: true } }); spawn.stderr.on('data', d => process.stderr.write(d.toString())); spawn.stdout.on('data', d => {process.stdout.write(d.toString()); if(d.toString().includes('There are no relevant changes, so no new version is released.') || d.toString().includes('therefore a new version won\'t be published.')){process.exit(1);}})" || exit 0
105
+ node -e "const spawn = require('child_process').spawn('semantic-release', ['--repositoryUrl', 'https://x-bitbucket-api-token-auth:$BITBUCKET_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME'], { env: { ...process.env, FORCE_COLOR: true } }); spawn.stderr.on('data', d => process.stderr.write(d.toString())); spawn.stdout.on('data', d => {process.stdout.write(d.toString()); if(d.toString().includes('There are no relevant changes, so no new version is released.') || d.toString().includes('therefore a new version won\'t be published.')){process.exit(1);}})" || exit 0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core",
3
- "version": "1.10.0",
3
+ "version": "1.10.4",
4
4
  "description": "lab-env docker config for the @fishawack/core/1 npm module",
5
5
  "scripts": {
6
6
  "setup": "ln -sfn ../../.commitlintrc.json .commitlintrc.json && ln -sfn ../../.editorconfig .editorconfig && ln -sfn ../../.prettierignore .prettierignore && ln -sfn ../../.husky/ .husky && husky &>/dev/null || true",
package/globals.js CHANGED
@@ -233,6 +233,7 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
233
233
  args[0] !== "new" &&
234
234
  args[0] !== "key" &&
235
235
  args[0] !== "dekey" &&
236
+ args[0] !== "rekey" &&
236
237
  args[0] !== "lint" &&
237
238
  args[0] !== "workspace" &&
238
239
  args[0] !== "prune"
@@ -279,6 +280,7 @@ if (composer && composer.require && composer.require["laravel/framework"]) {
279
280
  args[0] !== "new" &&
280
281
  args[0] !== "key" &&
281
282
  args[0] !== "dekey" &&
283
+ args[0] !== "rekey" &&
282
284
  args[0] !== "lint" &&
283
285
  args[0] !== "workspace" &&
284
286
  args[0] !== "prune"
@@ -354,6 +356,7 @@ if (process.env.FW_NEXT || forced) {
354
356
  args[0] !== "new" &&
355
357
  args[0] !== "key" &&
356
358
  args[0] !== "dekey" &&
359
+ args[0] !== "rekey" &&
357
360
  args[0] !== "lint" &&
358
361
  args[0] !== "workspace" &&
359
362
  args[0] !== "prune"
@@ -714,6 +717,7 @@ if (
714
717
  args[0] !== "--help" &&
715
718
  args[0] !== "key" &&
716
719
  args[0] !== "dekey" &&
720
+ args[0] !== "rekey" &&
717
721
  args[0] !== "lint" &&
718
722
  args[0] !== "workspace" &&
719
723
  args[0] !== "prune"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-env",
3
- "version": "5.6.1",
3
+ "version": "5.7.0-beta.10",
4
4
  "description": "Docker manager for FW",
5
5
  "main": "cli.js",
6
6
  "scripts": {
@@ -21,12 +21,18 @@
21
21
  "fw": "cli.js"
22
22
  },
23
23
  "dependencies": {
24
+ "@aws-sdk/client-acm": "^3.1067.0",
24
25
  "@aws-sdk/client-cloudfront": "^3.141.0",
25
26
  "@aws-sdk/client-ec2": "^3.399.0",
26
27
  "@aws-sdk/client-elastic-beanstalk": "^3.395.0",
28
+ "@aws-sdk/client-elasticache": "^3.1075.0",
27
29
  "@aws-sdk/client-iam": "^3.150.0",
30
+ "@aws-sdk/client-opensearch": "^3.1065.0",
31
+ "@aws-sdk/client-rds": "^3.395.0",
28
32
  "@aws-sdk/client-s3": "^3.141.0",
29
- "@aws-sdk/credential-providers": "^3.1011.0",
33
+ "@aws-sdk/client-secrets-manager": "^3.395.0",
34
+ "@aws-sdk/client-ses": "^3.1075.0",
35
+ "@aws-sdk/credential-providers": "^3.1075.0",
30
36
  "apache-md5": "^1.1.8",
31
37
  "axios": "^0.21.4",
32
38
  "chalk": "4.1.0",
@@ -40,6 +46,7 @@
40
46
  "glob": "^13.0.6",
41
47
  "inquirer": "8.1.2",
42
48
  "lodash": "^4.17.21",
49
+ "log-update": "^4.0.0",
43
50
  "nodemailer": "^6.9.15",
44
51
  "ora": "5.4.1",
45
52
  "p-limit": "^7.3.0",