Skip to content

Commit

Permalink
Set default image in dockerfile, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Oct 9, 2024
1 parent 93c4350 commit cdb4f47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions .github/actions/run-ee-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ inputs:
# All inputs in composite actions are strings
use-server-rc:
required: true
default: false
description: Deploy server release candidate?
default: 'false'
server-tag:
required: true
description: Specify Docker tag
default: 'latest'
# Github Composite Actions can't access secrets
# so we need to pass them in as inputs
docker-hub-username:
description: Required for using release candidates
required: false
docker-hub-password:
description: Required for using release candidates
required: false

runs:
Expand All @@ -41,7 +45,8 @@ runs:
- run: echo SUPERUSER_NAME_AND_PASSWORD="superuser" >> $GITHUB_ENV
shell: bash

- run: |
- name: Set credentials in config file
run: |
crudini --existing=param --set config.conf enterprise-edition user ${{ env.SUPERUSER_NAME_AND_PASSWORD }}
crudini --existing=param --set config.conf enterprise-edition password ${{ env.SUPERUSER_NAME_AND_PASSWORD }}
working-directory: test
Expand All @@ -55,7 +60,7 @@ runs:
- run: echo IMAGE_NAME=aerospike/aerospike-server-enterprise${{ inputs.use-server-rc == 'true' && '-rc' || '' }}:${{ inputs.server-tag }} >> $GITHUB_ENV
shell: bash

- run: echo SECURITY_IMAGE_NAME=${{ env.IMAGE_NAME }}-security >> $GITHUB_ENV
- run: echo NEW_IMAGE_NAME=${{ env.IMAGE_NAME }}-security-and-sc >> $GITHUB_ENV
shell: bash

# macOS Github runners and Windows self-hosted runners don't have buildx installed by default
Expand All @@ -69,7 +74,7 @@ runs:
context: .github/workflows/docker-build-context
build-args: |
server_image=${{ env.IMAGE_NAME }}
tags: ${{ env.SECURITY_IMAGE_NAME }}
tags: ${{ env.NEW_IMAGE_NAME }}
# setup-buildx-action configures Docker to use the docker-container build driver
# This driver doesn't publish an image locally by default
# so we have to manually enable it
Expand All @@ -78,7 +83,7 @@ runs:
- run: echo SERVER_CONTAINER_NAME="aerospike" >> $GITHUB_ENV
shell: bash

- run: docker run -d --name ${{ env.SERVER_CONTAINER_NAME }} -p 3000:3000 ${{ env.SECURITY_IMAGE_NAME }}
- run: docker run -d --name ${{ env.SERVER_CONTAINER_NAME }} -p 3000:3000 ${{ env.NEW_IMAGE_NAME }}
shell: bash

- uses: ./.github/actions/wait-for-as-server-to-start
Expand All @@ -94,6 +99,7 @@ runs:
- run: docker exec ${{ env.SERVER_CONTAINER_NAME }} asadm $ASADM_AUTH_FLAGS --enable --execute "manage revive ns test"
shell: bash

# Apply changes
- run: docker exec ${{ env.SERVER_CONTAINER_NAME }} asadm $ASADM_AUTH_FLAGS --enable --execute "manage recluster"
shell: bash

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-context/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG server_image
ARG server_image=aerospike/aerospike-server-enterprise
ARG ROSTER_FILE_NAME=roster.smd
# Temp file for passing node id from one build stage to another
# Docker doesn't support command substitution for setting values for ARG variables, so we have to do this
Expand Down

0 comments on commit cdb4f47

Please sign in to comment.