Skip to content

Commit

Permalink
update(aws-cli): use latest install instructions for aws-cli v2 (#27)
Browse files Browse the repository at this point in the history
* update(aws-cli): use latest install instructions for aws-cli v2

Signed-off-by: eudaimos <[email protected]>

* fix(libc): use libc6 instead of glibc

Signed-off-by: eudaimos <[email protected]>
  • Loading branch information
eudaimos authored Jul 25, 2021
1 parent 09e53db commit 998141d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
10 changes: 5 additions & 5 deletions pkg/aws/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import "fmt"
// for an invocation image using this mixin
func (m *Mixin) Build() error {
// TODO: This gets whatever the latest version of the cli is, there isn't a way for us to say what version we are using
fmt.Fprintln(m.Out, `RUN apt-get update && apt-get install -y curl unzip python less groff`)
fmt.Fprintln(m.Out, `RUN curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "/tmp/awscli-bundle.zip"`)
fmt.Fprintln(m.Out, `RUN unzip /tmp/awscli-bundle.zip -d /tmp`)
fmt.Fprintln(m.Out, `RUN /tmp/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws`)
fmt.Fprintln(m.Out, `RUN rm -fr /tmp/awscli-bundle.zip /tmp/awscli-bundle`)
fmt.Fprintln(m.Out, `RUN apt-get update && apt-get install -y --no-install-recommends curl unzip libc6 less groff`)
fmt.Fprintln(m.Out, `RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"`)
fmt.Fprintln(m.Out, `RUN unzip awscliv2.zip`)
fmt.Fprintln(m.Out, `RUN ./aws/install`)
fmt.Fprintln(m.Out, `RUN rm -fr awscliv2.zip ./aws`)
return nil
}
17 changes: 9 additions & 8 deletions pkg/aws/build_test.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
package aws

import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)

func TestMixin_Build(t *testing.T) {
m := NewTestMixin(t)

err := m.Build()
err := m.Build()
require.NoError(t, err, "Build failed")

gotOutput := m.TestContext.GetOutput()

wantOutput := `RUN apt-get update && apt-get install -y curl unzip python less groff
RUN curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "/tmp/awscli-bundle.zip"
RUN unzip /tmp/awscli-bundle.zip -d /tmp
RUN /tmp/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
RUN rm -fr /tmp/awscli-bundle.zip /tmp/awscli-bundle
wantOutput := `RUN apt-get update && apt-get install -y --no-install-recommends curl unzip libc6 less groff
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
RUN unzip awscliv2.zip
RUN ./aws/install
RUN rm -fr awscliv2.zip ./aws
`

assert.Equal(t, wantOutput, gotOutput)
}
}

0 comments on commit 998141d

Please sign in to comment.