Skip to content

Commit

Permalink
Add a timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
nutjob4life committed Mar 6, 2024
1 parent f5c75d0 commit ee739bc
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/pds/roundup/_nodejs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .errors import RoundupError, InvokedProcessError
from .step import Step, StepName, NullStep, RequirementsStep, DocPublicationStep, ChangeLogStep as BaseChangeLogStep
from .util import git_config, invoke, invokeGIT, TAG_RE, add_version_label_to_open_bugs, commit, delete_tags
import shutil, logging, os, json, re
import shutil, logging, os, json, re, datetime

_logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -226,25 +226,19 @@ def execute(self):
class _ArtifactPublicationStep(_NodeJSStep):
'''A step that publishes artifacts to the npmjs.com'''
def execute(self):
_logger.warning('🪵 Here is my npmrc:')
with open('.npmrc', 'r') as npmrc:
for line in npmrc:
_logger.warning(line)
_logger.warning('😳 Who am I?')
invoke(['npm', 'whoami'])
_logger.warning('💣 Here goes publish step')
try:
if self.assembly.isStable():
argv = ['npm', 'publish', '--verbose', '--access', 'public']
else:
# In NASA-PDS/devops#69 @jordanpadams may prefer "beta" to "unstable"
argv = ['npm', 'publish', '--verbose', '--access', 'public', '--tag', 'unstable']
# In NASA-PDS/devops#69 @jordanpadams pefers "beta" to "unstable". This was
# corroborated in our stand up meeting on 2024-03-05. Further, we need a
# timestamp on unstable releases; Java and Python release do this automatically.
ts = datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S')
argv = ['npm', 'publish', '--verbose', '--access', 'public', '--tag', f'beta-{ts}']
invoke(argv)
except InvokedProcessError:
# For unstalbe releases, we ignore this
if self.assembly.isStable(): raise
# During development, let's also fail here for unstable
else: raise


class _DocPublicationStep(DocPublicationStep):
Expand Down

0 comments on commit ee739bc

Please sign in to comment.