Skip to content

Commit

Permalink
Added node 12-18 support, fixed ECR integration (#148)
Browse files Browse the repository at this point in the history
* Added node 12-18 support

* Create Channel needs to create ECR Repos if needed

* Fixed env usage in create channels

* Always run docker-images job after Ccreate-channel job

* Actually push the docker images to ECR not S3

* Have to publish CI script to channels too
  • Loading branch information
Justin Boswell authored Sep 7, 2021
1 parent 0dc5917 commit 3241fd8
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 12 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/create-channel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
name: builder
path: build/builder

- name: Upload container CI script
run: aws s3 cp ./.github/workflows/linux-container-ci.sh s3://aws-crt-test-stuff/ci/${{ steps.tag.outputs.release_tag }}/linux-container-ci.sh

import-latest:
name: ${{ matrix.variant }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -97,12 +100,20 @@ jobs:
uses: ./.github/actions/release-tag
id: tag

- name: Publish image tag to env
run: echo "IMAGE_TAG=${{ steps.tag.outputs.release_tag }}" >> $GITHUB_ENV

- name: Login to docker repo
run: aws ecr get-login-password --region us-east-1 | docker login ${{ secrets.AWS_ECR_REPO }} -u AWS --password-stdin

- name: Create ECR repo if necessary
run: |
if ! aws --region us-east-1 ecr describe-repositories --repository-names aws-crt-${{ matrix.variant }} > /dev/null 2>&1; then \
aws --region us-east-1 ecr create-repository --repository-name aws-crt-${{ matrix.variant }}; \
fi
- name: Import latest aws-crt-${{ matrix.variant }} image to channels
run: |
export IMAGE_TAG=${{ steps.tag.outputs.release_tag }}
docker pull ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest || exit 0
docker tag ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:latest ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
docker push ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ on:
- '.github/docker-images/entrypoint.sh'
- '.github/workflows/docker-images.yml'
- '.github/workflows/*.sh'
workflow_run:
workflows: ["Create Channel"]
branches:
- '*'
- '!main'
types:
- completed

env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
Expand Down Expand Up @@ -54,6 +61,9 @@ jobs:
uses: ./.github/actions/release-tag
id: tag

- name: Login to docker repo
run: aws ecr get-login-password --region us-east-1 | docker login ${{ secrets.AWS_ECR_REPO }} -u AWS --password-stdin

- name: Install entrypoint
run: cat .github/docker-images/entrypoint.sh | sed s/version=LATEST/version=${{ steps.tag.outputs.release_tag }}/ > .github/docker-images/${{ matrix.variant }}/entrypoint.sh

Expand All @@ -74,8 +84,7 @@ jobs:
- name: Export ${{ matrix.variant }} image to S3/channels/${{ steps.tag.outputs.release_tag }}
run: |
export IMAGE_TAG=${{ steps.tag.outputs.release_tag }}
docker save ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG |\
aws s3 cp - s3://${{env.AWS_S3_BUCKET}}/channels/$IMAGE_TAG/aws-crt-${{ matrix.variant }}.tar.gz
docker push ${{ secrets.AWS_ECR_REPO }}/aws-crt-${{ matrix.variant }}:$IMAGE_TAG
php-images:
name: PHP ${{ matrix.version }}
Expand All @@ -101,6 +110,9 @@ jobs:
uses: ./.github/actions/release-tag
id: tag

- name: Login to docker repo
run: aws ecr get-login-password --region us-east-1 | docker login ${{ secrets.AWS_ECR_REPO }} -u AWS --password-stdin

- name: Install entrypoint
run: cat .github/docker-images/entrypoint.sh | sed s/version=LATEST/version=${{ steps.tag.outputs.release_tag }}/ > .github/docker-images/phpbrew-linux-x64/entrypoint.sh

Expand All @@ -118,9 +130,7 @@ jobs:
- name: Export PHP ${{ matrix.version }} image to S3/channels/${{ steps.tag.outputs.release_tag }}
run: |
export IMAGE_TAG=${{ steps.tag.outputs.release_tag }}
docker save ${{ secrets.AWS_ECR_REPO }}/aws-crt-php${{ matrix.version }}-linux-x64:$IMAGE_TAG \
| gzip \
| aws s3 cp - s3://${{env.AWS_S3_BUCKET}}/channels/$IMAGE_TAG/aws-crt-php${{ matrix.version }}-linux-x64.tar.gz
docker push ${{ secrets.AWS_ECR_REPO }}/aws-crt-php${{ matrix.version }}-linux-x64:$IMAGE_TAG
###############################################################################
# DOWNSTREAM TESTS
Expand Down
28 changes: 22 additions & 6 deletions builder/imports/nodejs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ def __init__(self, **kwargs):
'targets': ['linux'],
},
**kwargs)
self.url = 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh'
self.url = 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh'
self.version = kwargs.get('version', '12')

# windows nvm has stopped installing the latest version, so ask for our minspec
if current_os() == 'windows':
self.version = '10.16.0'
else:
self.version = '10'
self.nvm = 'nvm'
self.installed = False

Expand Down Expand Up @@ -116,3 +112,23 @@ def install_nvm_sh(self, env):
nvm_sh.write(NVM)
os.chmod(run_nvm, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
self.nvm = run_nvm


class Node12(NodeJS):
def __init__(self, **kwargs):
super().__init__(version='12', **kwargs)


class Node14(NodeJS):
def __init__(self, **kwargs):
super().__init__(version='14', **kwargs)


class Node16(NodeJS):
def __init__(self, **kwargs):
super().__init__(version='16', **kwargs)


class Node18(NodeJS):
def __init__(self, **kwargs):
super().__init__(version='18', **kwargs)

0 comments on commit 3241fd8

Please sign in to comment.